rvico TRichView Reference | TRichView

TCustomRichView.OnJump

Top  Previous  Next

Occurs when user clicks on hypertext item.

type

  TJumpEvent = procedure(Sender: TObject; id: Integer) of object;

 

property OnJump: TJumpEvent;

Parameter

id is an identifier of hypertext link (the first link in the document has id=FirstJumpNo, the next link has id=FirstJumpNo+1, and so on).

In editor, this numeration is available only when the editor works in hypertext mode:

while user holds  Ctrl  key (see EditorOptions) until he/she releases it, or the document is modified, or the editor loses focus;
if ReadOnly=True.

So, when using this event in editor, perform all actions that use this id before any action changing document or moving focus out of editor.

In viewer, this even can also be initiated using keyboard, if TabNavigation<>rvtnNone. User uses  Tab  to highlight the hyperlink, then  Enter  to activate it (to call this event).

Example:

procedure TMyForm.MyRichViewJump(Sender: TObject; id: Integer);

var ItemNo: Integer;

    RVData: TCustomRVFormattedData;

    s: String;

begin

  MyRichView.GetJumpPointLocation(id, RVData, ItemNo);

  s := RVData.GetItemTag(ItemNo);

  Application.MessageBox(PChar(s), 'Link', MB_OK or MB_ICONINFORMATION);

end;

 

See also events:

OnRVMouseMove.

See also:

RichView hypertext.


TRichView © trichview.com