X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/408776d0347b651ab4b00c2d613f8e51b1985a91..c29c95fe24973b94fd724db767193171ca7c513d:/interface/wx/print.h?ds=sidebyside diff --git a/interface/wx/print.h b/interface/wx/print.h index c8c6e68ed2..4713bf32eb 100644 --- a/interface/wx/print.h +++ b/interface/wx/print.h @@ -3,7 +3,7 @@ // Purpose: interface of wxPreviewControlBar // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -117,7 +117,33 @@ public: void OnPaint(wxPaintEvent& event); }; +/** + Preview frame modality kind. + + The elements of this enum can be used with wxPreviewFrame::Initialize() to + indicate how should the preview frame be shown. + + @since 2.9.2 +*/ +enum wxPreviewFrameModalityKind +{ + /** + Disable all the other top level windows while the preview frame is shown. + + This is the default behaviour. + */ + wxPreviewFrame_AppModal, + + /** + Disable only the parent window while the preview frame is shown. + */ + wxPreviewFrame_WindowModal, + /** + Show the preview frame non-modally and don't disable any other windows. + */ + wxPreviewFrame_NonModal +}; /** @class wxPreviewFrame @@ -169,15 +195,47 @@ public: virtual void CreateControlBar(); /** - Creates the preview canvas and control bar, and calls wxWindow::MakeModal(@true) - to disable other top-level windows in the application. + Initializes the frame elements and prepares for showing it. - This function should be called by the application prior to showing the frame. - */ + Calling this method is equivalent to calling InitializeWithModality() + with wxPreviewFrame_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. + */ virtual void Initialize(); /** - Enables the other frames in the application, and deletes the print preview + 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 @a kind + parameter: + - If it is wxPreviewFrame_AppModal, all the other application + windows will be disabled when this frame is shown. This is the same + behaviour as that of simple Initialize(). + - If it is wxPreviewFrame_WindowModal, only the parent window of + the preview frame will be disabled when it is shown. + - And if it is wxPreviewFrame_NonModal, no windows at all will be + disabled while the preview is shown. + + Notice that this function (or Initialize()) must be called by the + application prior to showing the frame but you still must call @c + Show(true) to actually show it afterwards. + + @param kind + The modality kind of preview frame. + + @since 2.9.2 + */ + virtual void InitializeWithModality(wxPreviewFrameModalityKind 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. */ @@ -231,8 +289,8 @@ public: Use IsOk() to check whether the wxPrintPreview object was created correctly. */ wxPrintPreview(wxPrintout* printout, - wxPrintout* printoutForPrinting, - wxPrintData* data = NULL); + wxPrintout* printoutForPrinting = NULL, + wxPrintDialogData* data = NULL); /** Destructor. @@ -586,6 +644,11 @@ public: @beginWxPythonOnly This method returns the output-only parameters as a tuple. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method takes no arguments and returns a + 2-element list (w, h). + @endWxPerlOnly */ void GetPPIPrinter(int* w, int* h) const; @@ -601,6 +664,11 @@ public: @beginWxPythonOnly This method returns the output-only parameters as a tuple. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method takes no arguments and returns a + 2-element list (w, h). + @endWxPerlOnly */ void GetPPIScreen(int* w, int* h) const; @@ -630,6 +698,11 @@ public: @beginWxPythonOnly This method returns the output-only parameters as a tuple. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method takes no arguments and returns a + 2-element list (w, h). + @endWxPerlOnly */ void GetPageSizeMM(int* w, int* h) const; @@ -646,6 +719,11 @@ public: @beginWxPythonOnly This method returns the output-only parameters as a tuple. @endWxPythonOnly + + @beginWxPerlOnly + In wxPerl this method takes no arguments and returns a + 2-element list (w, h). + @endWxPerlOnly */ void GetPageSizePixels(int* w, int* h) const; @@ -688,9 +766,26 @@ public: /** Returns @true if the printout is currently being used for previewing. + + @see GetPreview() */ virtual bool IsPreview() const; + /** + Returns the associated preview object if any. + + If this printout object is used for previewing, returns the associated + wxPrintPreview. Otherwise returns @NULL. + + The returned pointer is not owned by the printout and must not be + deleted. + + @see IsPreview() + + @since 2.9.1. + */ + wxPrintPreview *GetPreview() const; + /** Set the user scale and device origin of the wxDC associated with this wxPrintout so that one screen pixel maps to one device pixel on the DC. @@ -710,14 +805,14 @@ public: void MapScreenSizeToDevice(); /** - This sets the user scale of the wxDC assocated with this wxPrintout to the same + This sets the user scale of the wxDC associated with this wxPrintout to the same scale as MapScreenSizeToPaper() but sets the logical origin to the top left corner of the page rectangle. */ void MapScreenSizeToPage(); /** - This sets the user scale of the wxDC assocated with this wxPrintout to the same + This sets the user scale of the wxDC associated with this wxPrintout to the same scale as MapScreenSizeToPageMargins() but sets the logical origin to the top left corner of the page margins specified by the given wxPageSetupDialogData object. */ @@ -733,7 +828,7 @@ public: (It will, of course, be larger or smaller in the preview image, depending on the zoom factor.) - Use this if you want WYSIWYG behavior, e.g., in a text editor. + Use this if you want WYSIWYG behaviour, e.g., in a text editor. */ void MapScreenSizeToPaper();