DBSRichViewEdit - Keep zoom when switching to the next doc

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
TJ_NOR
Posts: 2
Joined: Wed Nov 30, 2016 2:54 pm

DBSRichViewEdit - Keep zoom when switching to the next doc

Post by TJ_NOR »

Hi
I am using the component to show documents. If i am zooming out and go to my next document i the database the zoom jumps back to 100%
What can i do to solve it? I have tried to keep track of the zoom with a variable but haven't found a event where i can set it back properly.

TJ
Sergey Tkachenko
Site Admin
Posts: 17236
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I suggest to process TDBSRichViewEdit.OnZoomChanged to store the last chosen ZoomPercent, and apply it in TDataSet.AfterScroll:

Code: Select all

ZoomPercent: Single; // defined in the form, initial value 0

procedure TForm1.DBSRichViewEdit1ZoomChanged(Sender: TObject);
begin
  ZoomPercent := DBSRichViewEdit1.ViewProperty.ZoomPercent;
end;

procedure TForm1.FDTable1AfterScroll(DataSet: TDataSet);
begin
  if ZoomPercent > 0 then
    DBSRichViewEdit1.ViewProperty.ZoomPercent := ZoomPercent;
end;
Post Reply