.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.PrintDialogData:

==========================================================================================================================================
|phoenix_title|  **wx.PrintDialogData**
==========================================================================================================================================

This class holds information related to the visual characteristics of :ref:`wx.PrintDialog`. 
         

It contains a :ref:`wx.PrintData`  object with underlying printing settings. 








         



.. seealso:: :ref:`Printing Framework Overview <printing framework overview>`, :ref:`wx.PrintDialog`, :ref:`PrintDialog Overview <printdialog overview>`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>PrintDialogData</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.PrintDialogData_inheritance.svg" alt="Inheritance diagram of PrintDialogData" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.PrintDialogData.html" title="This class holds information related to the visual characteristics of wx.PrintDialog." alt="" coords="5,82,172,111"/> <area shape="rect" id="node2" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="39,5,138,34"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.PrintDialogData.__init__`                                             Default constructor.
:meth:`~wx.PrintDialogData.EnableCurrentPage`                                    Allows or disallows selecting printing the "Current Page" in the dialog.
:meth:`~wx.PrintDialogData.EnableHelp`                                           Enables or disables the "Help" button.
:meth:`~wx.PrintDialogData.EnablePageNumbers`                                    Enables or disables the "Page numbers" controls.
:meth:`~wx.PrintDialogData.EnablePrintToFile`                                    Enables or disables the "Print to file" checkbox.
:meth:`~wx.PrintDialogData.EnableSelection`                                      Enables or disables the "Selection" radio button.
:meth:`~wx.PrintDialogData.GetAllPages`                                          Returns ``True`` if the user requested that all pages be printed.
:meth:`~wx.PrintDialogData.GetCollate`                                           Returns ``True`` if the user requested that the document(s) be collated.
:meth:`~wx.PrintDialogData.GetCurrentPage`                                       Returns ``True`` if the user requested that the current page be printed.
:meth:`~wx.PrintDialogData.GetFromPage`                                          Returns the `from`  page number, as entered by the user.
:meth:`~wx.PrintDialogData.GetMaxPage`                                           Returns the `maximum`  page number.
:meth:`~wx.PrintDialogData.GetMaxPageRanges`                                     Returns the maximum number of page ranges that the user can specify.
:meth:`~wx.PrintDialogData.GetMinPage`                                           Returns the `minimum`  page number.
:meth:`~wx.PrintDialogData.GetNoCopies`                                          Returns the number of copies requested by the user.
:meth:`~wx.PrintDialogData.GetPageRanges`                                        Returns the page ranges to print.
:meth:`~wx.PrintDialogData.GetPrintData`                                         Returns a reference to the internal :ref:`wx.PrintData`  object.
:meth:`~wx.PrintDialogData.GetPrintToFile`                                       Returns ``True`` if the user has selected printing to a file.
:meth:`~wx.PrintDialogData.GetSelection`                                         Returns ``True`` if the user requested that the selection be printed (where "selection" is a concept specific to the application).
:meth:`~wx.PrintDialogData.GetSpecifiedPages`                                    Returns ``True`` if the user requested printing only the specified pages.
:meth:`~wx.PrintDialogData.GetToPage`                                            Returns the `"print to"`  page number, as entered by the user.
:meth:`~wx.PrintDialogData.IsOk`                                                 Returns ``True`` if the print data is valid for using in print dialogs.
:meth:`~wx.PrintDialogData.SetAllPages`                                          Selects the "All pages" radio button.
:meth:`~wx.PrintDialogData.SetCollate`                                           Sets the "Collate" checkbox to ``True`` or ``False``.
:meth:`~wx.PrintDialogData.SetCurrentPage`                                       Selects the "Current Page" radio button when the dialog is initially shown.
:meth:`~wx.PrintDialogData.SetFromPage`                                          Sets the `from`  page number.
:meth:`~wx.PrintDialogData.SetMaxPage`                                           Sets the `maximum`  page number.
:meth:`~wx.PrintDialogData.SetMaxPageRanges`                                     Sets the maximum number of page ranges that the user can specify.
:meth:`~wx.PrintDialogData.SetMinPage`                                           Sets the `minimum`  page number.
:meth:`~wx.PrintDialogData.SetNoCopies`                                          Sets the default number of copies the user has requested to be printed out.
:meth:`~wx.PrintDialogData.SetPrintData`                                         Sets the internal :ref:`wx.PrintData`.
:meth:`~wx.PrintDialogData.SetPrintToFile`                                       Sets the "Print to file" checkbox to ``True`` or ``False``.
:meth:`~wx.PrintDialogData.SetSelection`                                         Selects the "Selection" radio button.
:meth:`~wx.PrintDialogData.SetToPage`                                            Sets the `"print to"`  page number.
:meth:`~wx.PrintDialogData.__bool__`                                             
:meth:`~wx.PrintDialogData.__nonzero__`                                          
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.PrintDialogData.AllPages`                                             See :meth:`~wx.PrintDialogData.GetAllPages` and :meth:`~wx.PrintDialogData.SetAllPages`
:attr:`~wx.PrintDialogData.Collate`                                              See :meth:`~wx.PrintDialogData.GetCollate` and :meth:`~wx.PrintDialogData.SetCollate`
:attr:`~wx.PrintDialogData.CurrentPage`                                          See :meth:`~wx.PrintDialogData.GetCurrentPage` and :meth:`~wx.PrintDialogData.SetCurrentPage`
:attr:`~wx.PrintDialogData.FromPage`                                             See :meth:`~wx.PrintDialogData.GetFromPage` and :meth:`~wx.PrintDialogData.SetFromPage`
:attr:`~wx.PrintDialogData.MaxPage`                                              See :meth:`~wx.PrintDialogData.GetMaxPage` and :meth:`~wx.PrintDialogData.SetMaxPage`
:attr:`~wx.PrintDialogData.MaxPageRanges`                                        See :meth:`~wx.PrintDialogData.GetMaxPageRanges` and :meth:`~wx.PrintDialogData.SetMaxPageRanges`
:attr:`~wx.PrintDialogData.MinPage`                                              See :meth:`~wx.PrintDialogData.GetMinPage` and :meth:`~wx.PrintDialogData.SetMinPage`
:attr:`~wx.PrintDialogData.NoCopies`                                             See :meth:`~wx.PrintDialogData.GetNoCopies` and :meth:`~wx.PrintDialogData.SetNoCopies`
:attr:`~wx.PrintDialogData.PageRanges`                                           See :meth:`~wx.PrintDialogData.GetPageRanges`
:attr:`~wx.PrintDialogData.PrintData`                                            See :meth:`~wx.PrintDialogData.GetPrintData` and :meth:`~wx.PrintDialogData.SetPrintData`
:attr:`~wx.PrintDialogData.PrintToFile`                                          See :meth:`~wx.PrintDialogData.GetPrintToFile` and :meth:`~wx.PrintDialogData.SetPrintToFile`
:attr:`~wx.PrintDialogData.Selection`                                            See :meth:`~wx.PrintDialogData.GetSelection` and :meth:`~wx.PrintDialogData.SetSelection`
:attr:`~wx.PrintDialogData.SpecifiedPages`                                       See :meth:`~wx.PrintDialogData.GetSpecifiedPages`
:attr:`~wx.PrintDialogData.ToPage`                                               See :meth:`~wx.PrintDialogData.GetToPage` and :meth:`~wx.PrintDialogData.SetToPage`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.PrintDialogData(Object)

   **Possible constructors**::

       PrintDialogData() -> None
       
       PrintDialogData(dialogData) -> None
       
       PrintDialogData(printData) -> None
       
   
   This class holds information related to the visual characteristics of
   PrintDialog.



   .. method:: __init__(self, *args, **kw)



      |overload| **Overloaded Implementations:**

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor. 
                       
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, dialogData)`
      
      Copy constructor. 
                       
      
      
      :param `dialogData`: 
      :type `dialogData`: wx.PrintDialogData
      
      
      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, printData)`
      
      Construct an object from a print dialog data object. 
                       
      
      
      :param `printData`: 
      :type `printData`: wx.PrintData
      
      
      
      
      :rtype: `None`     
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: EnableCurrentPage(self, flag)

      Allows or disallows selecting printing the "Current Page" in the dialog. 
                 

      This currently only has an effect under MSW, where the native dialog enables the "Current Page" radio button if this function is called to allow the user to print the current page only. 


                


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: EnableHelp(self, flag)

      Enables or disables the "Help" button. 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: EnablePageNumbers(self, flag)

      Enables or disables the "Page numbers" controls. 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: EnablePrintToFile(self, flag)

      Enables or disables the "Print to file" checkbox. 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: EnableSelection(self, flag)

      Enables or disables the "Selection" radio button. 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: GetAllPages(self)

      Returns ``True`` if the user requested that all pages be printed. 
                 

      :rtype: `bool`








   .. method:: GetCollate(self)

      Returns ``True`` if the user requested that the document(s) be collated. 
                 

      :rtype: `bool`








   .. method:: GetCurrentPage(self)

      Returns ``True`` if the user requested that the current page be printed. 
                 

      Note that the "current page" is defined by the application. 

      It only makes sense to call this function if :meth:`EnableCurrentPage`   had been called before, otherwise it always returns ``False``. 


                

      :rtype: `bool`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetFromPage(self)

      Returns the `from`  page number, as entered by the user. 
                 

      This function can't be used if multiple page ranges were specified, use :meth:`GetPageRanges`   instead. 
                 

      :rtype: `int`








   .. method:: GetMaxPage(self)

      Returns the `maximum`  page number. 
                 

      :rtype: `int`








   .. method:: GetMaxPageRanges(self)

      Returns the maximum number of page ranges that the user can specify. 
                 


                

      :rtype: `int`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     







      .. seealso:: SetMaxRanges()  








   .. method:: GetMinPage(self)

      Returns the `minimum`  page number. 
                 

      :rtype: `int`








   .. method:: GetNoCopies(self)

      Returns the number of copies requested by the user. 
                 

      :rtype: `int`








   .. method:: GetPageRanges(self)

      Returns the page ranges to print. 
                 

      This vector contains the page ranges to be printed. If it is empty, all pages are printed, otherwise only the pages in the specified ranges are. 


                

      :rtype: `PrintPageRanges`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     







      .. seealso:: :meth:`SetPageRanges`   








   .. method:: GetPrintData(self)

      Returns a reference to the internal :ref:`wx.PrintData`  object. 
                 

      :rtype: :ref:`wx.PrintData`








   .. method:: GetPrintToFile(self)

      Returns ``True`` if the user has selected printing to a file. 
                 

      :rtype: `bool`








   .. method:: GetSelection(self)

      Returns ``True`` if the user requested that the selection be printed (where "selection" is a concept specific to the application). 
                 

      :rtype: `bool`








   .. method:: GetSpecifiedPages(self)

      Returns ``True`` if the user requested printing only the specified pages. 
                 

      The pages to print can be retrieved using :meth:`GetPageRanges` . 


                

      :rtype: `bool`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: GetToPage(self)

      Returns the `"print to"`  page number, as entered by the user. 
                 

      This function can't be used if multiple page ranges were specified, use :meth:`GetPageRanges`   instead. 
                 

      :rtype: `int`








   .. method:: IsOk(self)

      Returns ``True`` if the print data is valid for using in print dialogs. 
                 

      This can return ``False`` on Windows if the current printer is not set, for example. On all other platforms, it returns ``True``. 
                 

      :rtype: `bool`








   .. method:: SetAllPages(self, flag=True)

      Selects the "All pages" radio button. 
                 

      When called with ``True`` value, enables printing all pages. This is the default behaviour. 

      If `flag`  is ``False``, this function doesn't do anything unless it had been called with ``True`` value before and in this case it switches to printing the selected pages only (see :meth:`GetSpecifiedPages` ). 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: SetCollate(self, flag)

      Sets the "Collate" checkbox to ``True`` or ``False``. 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: SetCurrentPage(self, flag=True)

      Selects the "Current Page" radio button when the dialog is initially shown. 
                 

      This function can only be called when :meth:`EnableCurrentPage`   is used as well. 

      If `flag`  is ``False``, this function doesn't do anything unless it had been called with ``True`` value before and in this case it switches to printing the selected pages only (see :meth:`GetSpecifiedPages` ). 


                


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     







      .. seealso:: :meth:`GetCurrentPage`   








   .. method:: SetFromPage(self, page)

      Sets the `from`  page number. 
                 

      Together with :meth:`SetToPage` , this function can be used to define a single range of pages to print. If you need to specify multiple ranges, use :meth:`SetPageRanges`   instead. 


                


      :param `page`: 
      :type `page`: int




      :rtype: `None`     







      .. note:: 

         If :meth:`SetPageRanges`   was used to specify multiple ranges, this function cannot be used as there is no single "from" page to set.   








   .. method:: SetMaxPage(self, page)

      Sets the `maximum`  page number. 
                 


      :param `page`: 
      :type `page`: int




      :rtype: `None`     








   .. method:: SetMaxPageRanges(self, maxRanges)

      Sets the maximum number of page ranges that the user can specify. 
                 

      This value is used as a limit for the number of page ranges that can be used in the print dialog. The default value is 64. 

      Currently this is only used in wxMSW. 


                


      :param `maxRanges`: 
      :type `maxRanges`: int




      :rtype: `None`     







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: SetMinPage(self, page)

      Sets the `minimum`  page number. 
                 


      :param `page`: 
      :type `page`: int




      :rtype: `None`     








   .. method:: SetNoCopies(self, n)

      Sets the default number of copies the user has requested to be printed out. 
                 


      :param `n`: 
      :type `n`: int




      :rtype: `None`     








   .. method:: SetPrintData(self, printData)

      Sets the internal :ref:`wx.PrintData`. 
                 


      :param `printData`: 
      :type `printData`: wx.PrintData




      :rtype: `None`     








   .. method:: SetPrintToFile(self, flag)

      Sets the "Print to file" checkbox to ``True`` or ``False``. 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: SetSelection(self, flag=True)

      Selects the "Selection" radio button. 
                 

      The effect of printing the selection depends on how the application implements this command, if at all. 

      This function should only be called when :meth:`EnableSelection`   is used as well. 

      If `flag`  is ``False``, this function doesn't do anything unless it had been called with ``True`` value before and in this case it switches to printing the selected pages only (see :meth:`GetSpecifiedPages` ). 
                 


      :param `flag`: 
      :type `flag`: bool




      :rtype: `None`     








   .. method:: SetToPage(self, page)

      Sets the `"print to"`  page number. 
                 

      Together with :meth:`SetFromPage` , this function can be used to define a single range of pages to print. If you need to specify multiple ranges, use :meth:`SetPageRanges`   instead. 


                


      :param `page`: 
      :type `page`: int




      :rtype: `None`     







      .. note:: 

         If :meth:`SetPageRanges`   was used to specify multiple ranges, this function cannot be used as there is no single "to" page to set.   








   .. method:: __bool__(self)



      :rtype: `bool`








   .. method:: __nonzero__(self)



      :rtype: `bool`








   .. attribute:: AllPages

      See :meth:`~wx.PrintDialogData.GetAllPages` and :meth:`~wx.PrintDialogData.SetAllPages`


   .. attribute:: Collate

      See :meth:`~wx.PrintDialogData.GetCollate` and :meth:`~wx.PrintDialogData.SetCollate`


   .. attribute:: CurrentPage

      See :meth:`~wx.PrintDialogData.GetCurrentPage` and :meth:`~wx.PrintDialogData.SetCurrentPage`


   .. attribute:: FromPage

      See :meth:`~wx.PrintDialogData.GetFromPage` and :meth:`~wx.PrintDialogData.SetFromPage`


   .. attribute:: MaxPage

      See :meth:`~wx.PrintDialogData.GetMaxPage` and :meth:`~wx.PrintDialogData.SetMaxPage`


   .. attribute:: MaxPageRanges

      See :meth:`~wx.PrintDialogData.GetMaxPageRanges` and :meth:`~wx.PrintDialogData.SetMaxPageRanges`


   .. attribute:: MinPage

      See :meth:`~wx.PrintDialogData.GetMinPage` and :meth:`~wx.PrintDialogData.SetMinPage`


   .. attribute:: NoCopies

      See :meth:`~wx.PrintDialogData.GetNoCopies` and :meth:`~wx.PrintDialogData.SetNoCopies`


   .. attribute:: PageRanges

      See :meth:`~wx.PrintDialogData.GetPageRanges`


   .. attribute:: PrintData

      See :meth:`~wx.PrintDialogData.GetPrintData` and :meth:`~wx.PrintDialogData.SetPrintData`


   .. attribute:: PrintToFile

      See :meth:`~wx.PrintDialogData.GetPrintToFile` and :meth:`~wx.PrintDialogData.SetPrintToFile`


   .. attribute:: Selection

      See :meth:`~wx.PrintDialogData.GetSelection` and :meth:`~wx.PrintDialogData.SetSelection`


   .. attribute:: SpecifiedPages

      See :meth:`~wx.PrintDialogData.GetSpecifiedPages`


   .. attribute:: ToPage

      See :meth:`~wx.PrintDialogData.GetToPage` and :meth:`~wx.PrintDialogData.SetToPage`

