TppPreviewPlugIn and TppIniStoragePlugIns
Hello
What should I do to save values of OutlinePanel.Width and ZoomPercentage in
the PreviewWindow ?
Also suppose, that ZoomSetting is equal to zsPageWidth , if so,
ZoomPercentage is equal to 100%.
But really we see, for example, value of 124% in the EditMask (1280x1024).
In other words, we will see differ size of the page in the PreviewWindow
after saving ZoomPercentage's value as 100 and then restoring it.
--
WBR Sergey Kovalev svk@siamed.ru
SIA International Ltd
What should I do to save values of OutlinePanel.Width and ZoomPercentage in
the PreviewWindow ?
Also suppose, that ZoomSetting is equal to zsPageWidth , if so,
ZoomPercentage is equal to 100%.
But really we see, for example, value of 124% in the EditMask (1280x1024).
In other words, we will see differ size of the page in the PreviewWindow
after saving ZoomPercentage's value as 100 and then restoring it.
--
WBR Sergey Kovalev svk@siamed.ru
SIA International Ltd
This discussion has been closed.
Comments
fired.
type
TMyPreview = class(TppPreview)
public
procedure AfterPreview; override;
procedure BeforePreview; override;
end;
implementation
uses ppIniStorage;
const
PreviewWindow = 'PreviewWindow';
OutlinePanelWidth = 'OutlinePanelWidth';
//--------------------------------------------------------------------------
----
procedure TMyPreview.AfterPreview;
var
FIniStorage: TppIniStorage;
begin
inherited AfterPreview;
FIniStorage:=TppIniStoragePlugIn.CreateInstance;
FIniStorage.WriteInteger(PreviewWindow, OutlinePanelWidth,
AccessoryToolbar.Width);
end;
procedure TMyPreview.BeforePreview;
var
FIniStorage: TppIniStorage;
begin
inherited BeforePreview;
FIniStorage:=TppIniStoragePlugIn.CreateInstance;
AccessoryToolbar.Width:=FIniStorage.ReadInteger(PreviewWindow,
OutlinePanelWidth,
AccessoryToolbar.Width);
end;
fired
I want to take you more details.
TMyPreview.AfterPreview is not fired in the PreviewWindow after closing the
window.
AfterPreview is fired in the DesignerWindow after moving from the TabPreview
and it is not fired after closing the DesignerWindow.
--
WBR Sergey Kovalev svk@siamed.ru
SIA International Ltd
That is correct. If you want to fire this event when the Preview form is
closed, then create a custom preview dialog and register it for use with RB.
The default preview dialog is located in ppPrvDlg.pas.
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
procedure TMyPreview.PerformPreviewAction(aPreviewAction:
TppPreviewActionType);
begin
inherited PerformPreviewAction(aPreviewAction);
if aPreviewAction = paClose then AfterPreview;
end;
ancestor preview in ppPreview.pas. You will have to check if assigned on the
event property by name directly and call the method as it is done here:
procedure TppCustomPreview.Print;
begin
if FReport = nil then Exit;
if (Assigned(BeforePrint)) then BeforePrint(Self);
try
FViewer.Print;
finally
if (Assigned(AfterPrint)) then AfterPrint(Self);
end;
--
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com