Page 1 of 1

How to completely disable header/footer editing?

Posted: Mon Jan 18, 2016 2:26 pm
by Tavo
Hey there!!! Salute from Buenos Aires and sorry for my bad english...
I need to work with documents that have a header and a footer that are stored separately (in another TFieldBlob).
I need both documents (header and ffoter) are read-only so that users can not modify them.
I tried with ....

Code: Select all

   Self.SRV.RVHeader.ReadOnly := True ;
   Self.SRV.RVFooter.ReadOnly := True ;
It works, but anyway this causes two unwanted effects:

- It is visually indicated by the appearance of the editor.
- Editor header (readonly) takes focus

Is there a way to tell TSRichViewEdit only show the contents of the subdocuments and not allow to edit them?

Thanks in advance

..

Posted: Mon Jan 18, 2016 4:59 pm
by Sergey Tkachenko
Process SRV.OnChangeActiveEditor:

Code: Select all

procedure TForm3.SRVChangeActiveEditor(Sender: TSRichViewEdit; 
  ActiveEditor: TRichViewEdit); 
begin 
  if (ActiveEditor=Sender.RVHeader) or (ActiveEditor=Sender.RVFooter) then 
    Sender.StartEditing(srvrveMain) 
end;

Posted: Mon Jan 18, 2016 5:05 pm
by Tavo
This was exactly what I needed
It works perfectly
Thank you, Sergey