I store document in the way:
Code: Select all
procedure TDocEditFrame.SaveFile(const FileName: string);
var
fs: TFileStream;
begin
fs := TFileStream.Create(FileName, fmCreate or fmOpenWrite);
try
SRVE.RVHeader.SaveRVFToStream(fs, False);
SRVE.RVFooter.SaveRVFToStream(fs, False);
SRVE.RichViewEdit.SaveRVFToStream(fs, False);
finally
fs.Free;
end;
end;
Code: Select all
procedure TDocEditFrame.LoadFile(const FileName: string);
var
fs: TFileStream;
begin
fs := TFileStream.Create(FileName, fmOpenRead);
try
SRVE.RVHeader.Clear;
SRVE.RVFooter.Clear;
SRVE.RichViewEdit.Clear;
SRVE.RVHeader.LoadRVFFromStream(fs);
SRVE.RVFooter.LoadRVFFromStream(fs);
SRVE.RichViewEdit.LoadRVFFromStream(fs);
SRVE.RVHeader.Format;
SRVE.RVFooter.Format;
SRVE.RichViewEdit.Format;
SRVE.SetRVMargins;
finally
fs.Free;
end;
end;
I'm aware I need to handle TRVAControlPanel.OnMarginsChanged and call SRVE.SetRVMargins from inside. But this event doesn't fire.
So what should I do to save/load the page format?