Open link using Onjump event work fine.
But on my old application with TrichEdit I handle OnDblClick event to open link (so without CTRL pressed). So I need to do the same with TrichViewEdit.
So I try to do the same with :
Code: Select all
procedure MyTRichView.OnTRichViewEditRVDblClick(Sender: TCustomRichView; ClickedWord: TRVUnicodeString; Style: Integer);
var
LRVData: TCustomRVFormattedData;
LItemNo, LOffs: Integer;
LLink: String;
pt: TPoint;
begin
if not assigned(Sender) then
exit;
LGlobalMousePos := Mouse.CursorPos;
LLocalMousePos := (Sender as TControl).ScreenToClient(LGlobalMousePos);
pt := Sender.ClientToDocument(Point(LLocalMousePos.X, LLocalMousePos.Y));
if Sender.GetItemAt(pt.X, pt.Y, LRVData, LItemNo, LOffs, True) and
LRVData.GetItem(LItemNo).GetBoolValueEx(rvbpJump, Sender.Style) then // Doesn't work for hyperlink/jump
begin
LLLink := LRVData.GetItemTag(LItemNo);
OpenUrl(LLLink);
end;
end;
But if the end-user click on a hyperlink (= which call the onjump event is CTRL is down) the condition :
Code: Select all
if Sender.GetItemAt(pt.X, pt.Y, LRVData, LItemNo, LOffs, True) and
LRVData.GetItem(LItemNo).GetBoolValueEx(rvbpJump, Sender.Style) then
So how to detect the url clicked in a OnRVDblClick event ?