This class provides the default method of managing the print preview interface.
Member functions may be overridden to replace functionality, or the class may be used without derivation.
See also
wx.PreviewCanvas, wx.PreviewControlBar, wx.PrintPreview
Constructor. |
|
Creates a wx.PreviewCanvas. |
|
Creates a wx.PreviewControlBar. |
|
Initializes the frame elements and prepares for showing it. |
|
Initializes the frame elements and prepares for showing it with the given modality kind. |
|
Enables any disabled frames in the application, and deletes the print preview object, implicitly deleting any printout objects associated with the print preview object. |
wx.
PreviewFrame
(Frame)¶Possible constructors:
PreviewFrame(preview, parent, title="PrintPreview", pos=DefaultPosition,
size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
This class provides the default method of managing the print preview interface.
__init__
(self, preview, parent, title="PrintPreview", pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)¶Constructor.
Pass a print preview object plus other normal frame arguments. The print preview object will be destroyed by the frame when it closes.
Note that size typically should not be specified explicitly to let the frame use its default size, adapted to its contents.
preview (wx.PrintPreview) –
parent (wx.Window) –
title (string) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
name (string) –
CreateCanvas
(self)¶Creates a wx.PreviewCanvas.
Override this function to allow a user-defined preview canvas object to be created.
CreateControlBar
(self)¶Creates a wx.PreviewControlBar.
Override this function to allow a user-defined preview control bar object to be created.
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
Initialize
(self)¶Initializes the frame elements and prepares for showing it.
Calling this method is equivalent to calling InitializeWithModality
with PreviewFrame_AppModal argument, please see its documentation for more details.
Please notice that this function is virtual mostly for backwards compatibility only, there is no real need to override it as it’s never called by wxWidgets itself.
InitializeWithModality
(self, kind)¶Initializes the frame elements and prepares for showing it with the given modality kind.
This method creates the frame elements by calling CreateCanvas
and CreateControlBar
methods (which may be overridden to customize them) and prepares to show the frame according to the value of kind parameter:
If it is PreviewFrame_AppModal, all the other application windows will be disabled when this frame is shown. This is the same behaviour as that of simple wx.Initialize .
If it is PreviewFrame_WindowModal, only the parent window of the preview frame will be disabled when it is shown.
And if it is PreviewFrame_NonModal, no windows at all will be disabled while the preview is shown.
Notice that this function (or wx.Initialize ) must be called by the application prior to showing the frame but you still must call Show(true)
to actually show it afterwards.
kind (PreviewFrameModalityKind) – The modality kind of preview frame.
New in version 2.9.2.
OnCloseWindow
(self, event)¶Enables any disabled frames in the application, and deletes the print preview object, implicitly deleting any printout objects associated with the print preview object.
event (wx.CloseEvent) –