RichViewActions and OnHyperlinkForm
Posted: Wed May 03, 2006 1:59 am
I noticed that when I used the OnHyperlinkForm event in the rvActionInsertHyperlink1 action the dialog never appeared. In checking the code it bypasses the dialog regardless of the value of Proceed.
I made the following change to the code, which works. Was this fix needed or did I misunderstand the purpose of the event?
function TrvActionInsertHyperlink.DoShowForm(InsertNew: Boolean; var Text,
Target: String): Boolean;
var frm: TfrmRVHyp;
begin
{ if Assigned(FOnHyperlinkForm) then begin
Result := True;
FOnHyperlinkForm(Self, InsertNew, Text, Target, Result);
end
else begin }
// modification to allow OnHyperlinkForm event to be called and then
// still show the form
if Assigned(FOnHyperlinkForm) then begin
Result := True;
FOnHyperlinkForm(Self, InsertNew, Text, Target, Result);
end;
if Result then begin
// end of modification
frm := TfrmRVHyp.Create(Application);
...
I made the following change to the code, which works. Was this fix needed or did I misunderstand the purpose of the event?
function TrvActionInsertHyperlink.DoShowForm(InsertNew: Boolean; var Text,
Target: String): Boolean;
var frm: TfrmRVHyp;
begin
{ if Assigned(FOnHyperlinkForm) then begin
Result := True;
FOnHyperlinkForm(Self, InsertNew, Text, Target, Result);
end
else begin }
// modification to allow OnHyperlinkForm event to be called and then
// still show the form
if Assigned(FOnHyperlinkForm) then begin
Result := True;
FOnHyperlinkForm(Self, InsertNew, Text, Target, Result);
end;
if Result then begin
// end of modification
frm := TfrmRVHyp.Create(Application);
...