TCustomRichView.OnItemHint

<< Click to display table of contents >>

TCustomRichView.OnItemHint

Allows to define custom popup hints for items.

type

  TRVItemHintEvent = procedure (Sender: TCustomRichView;

    RVData: TCustomRVData; ItemNo: Integer; 

    var HintText: TRVUnicodeStringof object;

 

property OnItemHint: TRVItemHintEvent;

This event occurs when mouse pointer moves over the item.

Parameters

RVData document containing this item (RichView.RVData, or table cell, or cell inplace editor's RVData)

ItemNo index of the item inside RVData.

HintText  on input, it's a value of rvespHint item property. On output, it's a message that will be displayed.

 

Item popup hint can be displayed if rvoShowItemHints is in RichView.Options and RichView.ShowHint=True.

Cell Hints cannot be altered in this event.

 

See also:

OnGetItemCursor.

 

Example [VCL and LCL]

Besides the default hint, this code displays:

for hyperlinks: tag;

for images: Delphi class type, width and height.

procedure TMyForm.MyRichViewEditItemHint(Sender: TCustomRichView;

  RVData: TCustomRVData; ItemNo: Integer;

  var HintText: TRVUnicodeString);

var Tag: TRVTag;

    VAlign: TRVVAlign;

    Name: TRVUnicodeString;

    gr: TGraphic;

begin

  if RVData.GetItem(ItemNo).GetBoolValueEx(

    rvbpJump, Sender.Stylethen 

  begin

    if HintText<>'' then

      HintText := HintText+#13;

    HintText := HintText + 'Target: '+RVData.GetItemTag(ItemNo);

  end;

  if (RVData.GetItemStyle(ItemNo)=rvsPictureor

     (RVData.GetItemStyle(ItemNo)=rvsHotPicturethen

  begin

    if HintText<>'' then

      HintText := HintText+#13;

    RVData.GetPictureInfo(ItemNo, Name, gr, VAlign, Tag);

    HintText := HintText+gr.ClassName+

      ' ('+IntToStr(gr.Width)+','+IntToStr(gr.Height)+')';

  end;

end;