|
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:
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 := PChar(RVData.GetItemTag(ItemNo)); Application.MessageBox(PChar(s), 'Link', MB_OK or MB_ICONINFORMATION); end; This example assumes that rvoTagsArePChars is in Options
See also events: See also: |