procedure TtfMain.reAllyComChange(Sender: TObject);
var
B : TBitMap;
pos,pos2,pos3 : Integer;
i : integer;
ltext,ltext2 :
string;
begin
LockWindowUpdate(
Handle);
reAllyCom.OnChange:=nil;
try
try
B:=TBitmap.Create;
try
for i:= 0
to Pred(Length(SMILEY_FIELD))
do
begin
pos:=reAllyCom.FindText(SMILEY_FIELD[i], 0, Length(reAllyCom.Text),[]);
ilSmilies.GetBitmap(i,B);
b.TransparentColor:=clWhite;
b.Transparent:=True;
while Pos >= 0
do
begin
reAllyCom.SetSelection(Pos,Pos + Length(SMILEY_FIELD[i]),true);
reAllyCom.InsertGraphic(B,false);
reAllyCom.SelStart:=Length(reAllyCom.Text);
Pos:=reAllyCom.FindText(SMILEY_FIELD[i], Pos + Pred(Length(SMILEY_FIELD[i])), Length(reAllyCom.Text),[]);
end;
end;
pos:=reAllyCom.FindText('
[b]',0,Length(reAllyCom.Text),[]);
pos2:=reAllyCom.FindText('
[/b]',pos+3,Length(reAllyCom.Text),[]);
while (Pos >=0)
and(pos2>=0)
do
begin
ltext:=reallycom.GetTextRange(pos+3,pos2);
reallycom.SetSelection(pos,pos2+4,true);
//Hier muss der Text rausgelöscht werden!
reAllyCom.InsertFormatText(pos,ltext,[fsbold]);
pos2:=reAllyCom.FindText('
[/b]',pos+3,Length(reAllyCom.Text),[]);
pos:=reAllyCom.FindText('
[b]',pos+3,Length(reAllyCom.Text),[]);
end;
finally
B.Free;
end;
except
Beep;
end;
finally
reAllyCom.OnChange:=reAllyComChange;
LockWindowUpdate(0);
end;
end;