trichview.com

trichview.support.thirdparty




TrvActionInsertHyperlink.DoShowForm suggested change


Return to index


Author

Message

Mark Smith

Posted: 04/23/2003 1:06:31


Problem: If you've got a handler for OnHyperlinkForm, then the current

implementation of DoShowForm never shows a form for editing hyperlinks.


Solution: Amend the DoShowForm method as shown:


  if Assigned(FOnHyperlinkForm) then begin

    Result := True;

    FOnHyperlinkForm(Self, InsertNew, Text, Target, Result);

  end; //change-----

  if (not Result) then begin //change-----

    frm := TfrmRVHyp.Create(Application);

    try

      if not InsertNew then begin

        frm.txtText.Enabled := False;

        if Text='' then

          frm.txtText.Text := RVA_GetS(rvam_hl_Selection)

        else

          frm.txtText.Text := Text;

        frm.txtText.Color := clBtnFace;

        frm.txtTarget.Text := Target;

      end //change-----

      else //change-----

      begin //change-----

        frm.txtText.Text := Text; //change-----

        frm.txtTarget.Text := Target; //change-----

      end; //change-----

      Result := frm.ShowModal=mrOk;

      if Result then begin

        Text := frm.txtText.Text;

        Target := frm.txtTarget.Text;

      end;

    finally

      frm.Free;

    end;

  end;


This way, setting Proceed to false inside the OnHyperlinkForm method will cause

the hyperlink editor to be shown with the title and target values set in the

handler.


Regards

Mark Smith

Virtual Methods





Powered by ABC Amber Outlook Express Converter