Can I disable double click on Header / Footer

General TRichView support forum. Please post your questions here
Post Reply
starhu
Posts: 49
Joined: Fri Jan 17, 2014 6:33 pm

Can I disable double click on Header / Footer

Post by starhu »

Hello,

If I double click on Header / Footer, ScalerichView will show the editor part of it.
Even if I set SRichViewEdit1.RVHeader.ReadOnly := True;

Can I disable double click on header and footer?

Thank you
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, there are options to hide headers and footers, but no options to prevent activation of editing (however, you cannot change them if they are readonly).

Currently, the only solution is moving the caret back to the main editor in OnChangeActiveEditor event:

Code: Select all

procedure TForm3.SRichViewEdit1ChangeActiveEditor(Sender: TSRichViewEdit;
  ActiveEditor: TRichViewEdit);
begin
  if (ActiveEditor=Sender.RVHeader) or (ActiveEditor=Sender.RVFooter) then
    Sender.StartEditing(srvrveMain)
end;
starhu
Posts: 49
Joined: Fri Jan 17, 2014 6:33 pm

Post by starhu »

I tried it, but it didn't get into the event if I double clicked on the Header.

I put a breakpoint and it never stopped there. :(
Might it be the reason that I use the multi tabbed demo?

Thank you
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I think yes - you need to assign this event to new editors.
In the original ActionTestTabs demo, properties of a new editor are assigned in the procedure TForm3.AddEditor.
You can add there:

Code: Select all

  srve.OnChangeActiveEditor  := ActiveEditor.OnChangeActiveEditor ;
starhu
Posts: 49
Joined: Fri Jan 17, 2014 6:33 pm

Post by starhu »

Thank you, it works!
Post Reply