trichview.com

trichview.support




Re: Emotion icon


Return to index


Author

Message

Chia Chen Yap

Posted: 03/12/2004 3:33:53


procedure rveEditorKeyPress(Sender: TObject;

  var Key: Char);

var

  rve: TCustomRichViewEdit;

  ItemNo, WordEnd, WordStart: Integer;

  s: String;


  function IsDelimiter(ch: Char): Boolean;

  begin

    Result := (ch =' ') ;

  end;


begin

  inherited;

  if not IsDelimiter(Key) then

    exit;


  rve := m_rveActive.TopLevelEditor;

  ItemNo := rve.CurItemNo;

  WordEnd := rve.OffsetInCurItem;


  if rve.GetItemStyle(ItemNo)<0 then

    exit;


  s := rve.GetItemTextA(ItemNo);

  WordStart := WordEnd;


  if WordStart<1 then

    exit;


  while (WordStart -1 > 0) and not IsDelimiter(s[WordStart-1]) do

    dec(WordStart);


  s := Copy(s, WordStart, WordEnd - WordStart);


  if (s = ':)') then begin

    rve.SetSelectionBounds(ItemNo, WordStart, ItemNo, WordEnd);

    rve.InsertBullet(5, imglEmotionIcons);

  end;


end;

"Sergey Tkachenko" <[email protected]> wrote in message

news:[email protected]...

> Which demo do you refer to?

>

>





Powered by ABC Amber Outlook Express Converter