trichview.com

trichview.support




InsertControl problem


Return to index


Author

Message

Michal Pajkowski

Posted: 06/23/2003 19:57:48


Hi!


is it possible to InsertControl into not formated document

at_the_cursor_position  (or at_the_end_of_document)?


otherwords, little longer :)


i do program some multiline_sentances chat with basic font editing

(B/I/U/Color/Size) and emoticons (animated)

when i copy sentence from rveStatement  to rveConversation i do it item by

item


if item is a text, i do copy it by AddNL(Sentence, ItemStyle, ParaNo);

(ParaNo changing from -1 to 0 every new line)

but when i reach some emoticon (i.e. ':)', ':)))') i want to put some

animated gif there

i do it by code (suggested by Sergey a few days ago :), thx):


      gif := TGifImage.Create;

      gif.LoadFromFile('d:\gif\action-smiley-012.gif');

      img := TImage.Create(nil);

      img.AutoSize := true;

      img.Picture.Graphic := gif;

      rveConversation.InsertControl( '', img, rvvaBaseLine);

      gif.Free;


and after that in rveConversation i receive only: all emoticons that should

be, followed by text anly after last emoticon

i.e.:

if in rveSentance I put:


    11111111111 :) 2222222222 :) 3333333333333

    4444444444 :) 555555555


in rveConcersation i reveive:

    :) :) :)

    555555555



( :) are of course changed to my animated gif)

i guess, that InsertControl put control at the beginning of document, and

additionaly delete all text items

funny thing, when i say these sentence once more in the same runtime, in

rveConcersation i reveive:

in rveConcersation i reveive:

    :) :) :) :) :) :)

    555555555

    555555555


should it be like that? am i doing sth wrong?


when i try to avoid that problem by do

    rveConcersation.FormatTail

    rveConcersation.SetSelectionBounds(ItemNo,Offs,ItemNo,Offs);

just before

    rveConversation.InsertControl( '', img, rvvaBaseLine);


it does same "wordwarp" after last emoticon in given line, so

rveConversation would be like that:

    11111111111 :) 2222222222 :)

    3333333333333

    4444444444 :)

    555555555


what to do?


best

panorek





Powered by ABC Amber Outlook Express Converter