| Version: 3.3.1

Public Member Functions | List of all members
wxPrintDialogData Class Reference
Class List by Category » Printing Framework | Class List by Category » Common Dialogs | Class List by Category » Data Structures

`#include <wx/cmndata.h>`

Inheritance diagram for wxPrintDialogData:
[legend]

## Detailed Description

This class holds information related to the visual characteristics of wxPrintDialog.

It contains a wxPrintData object with underlying printing settings.

##

Library: wxCore
Category: Printing Framework, Common Dialogs, Data Structures

See also
  Printing Framework Overview, wxPrintDialog, wxPrintDialog Overview

## Public Member Functions
| wxPrintDialogData ()
| Default constructor. More...
| wxPrintDialogData (const wxPrintDialogData &dialogData)
| Copy constructor. More...
| wxPrintDialogData (const wxPrintData &printData)
| Construct an object from a print dialog data object. More...
virtual | ~wxPrintDialogData ()
| Destructor. More...
void | EnableHelp (bool flag)
| Enables or disables the "Help" button. More...
void | EnablePageNumbers (bool flag)
| Enables or disables the "Page numbers" controls. More...
void | EnablePrintToFile (bool flag)
| Enables or disables the "Print to file" checkbox. More...
void | EnableSelection (bool flag)
| Enables or disables the "Selection" radio button. More...
void | EnableCurrentPage (bool flag)
| Allows or disallows selecting printing the "Current Page" in the dialog. More...
bool | GetAllPages () const
| Returns true if the user requested that all pages be printed. More...
bool | GetCollate () const
| Returns true if the user requested that the document(s) be collated. More...
int | GetFromPage () const
| Returns the from page number, as entered by the user. More...
int | GetMaxPage () const
| Returns the maximum page number. More...
int | GetMinPage () const
| Returns the minimum page number. More...
int | GetNoCopies () const
| Returns the number of copies requested by the user. More...
wxPrintData & | GetPrintData ()
| Returns a reference to the internal wxPrintData object. More...
bool | GetPrintToFile () const
| Returns true if the user has selected printing to a file. More...
bool | GetSelection () const
| Returns true if the user requested that the selection be printed (where "selection" is a concept specific to the application). More...
bool | GetCurrentPage () const
| Returns true if the user requested that the current page be printed. More...
bool | GetSpecifiedPages () const
| Returns true if the user requested printing only the specified pages. More...
int | GetToPage () const
| Returns the "print to" page number, as entered by the user. More...
bool | IsOk () const
| Returns true if the print data is valid for using in print dialogs. More...
void | SetAllPages (bool flag=true)
| Selects the "All pages" radio button. More...
void | SetCollate (bool flag)
| Sets the "Collate" checkbox to true or false. More...
void | SetFromPage (int page)
| Sets the from page number. More...
void | SetMaxPage (int page)
| Sets the maximum page number. More...
void | SetMinPage (int page)
| Sets the minimum page number. More...
void | SetNoCopies (int n)
| Sets the default number of copies the user has requested to be printed out. More...
void | SetPrintData (const wxPrintData &printData)
| Sets the internal wxPrintData. More...
void | SetPrintToFile (bool flag)
| Sets the "Print to file" checkbox to true or false. More...
void | SetSelection (bool flag=true)
| Selects the "Selection" radio button. More...
void | SetCurrentPage (bool flag=true)
| Selects the "Current Page" radio button when the dialog is initially shown. More...
void | SetSetupDialog (bool flag)
void | SetToPage (int page)
| Sets the "print to" page number. More...
void | operator= (const wxPrintData &data)
| Assigns print data to this object. More...
void | operator= (const wxPrintDialogData &data)
| Assigns another print dialog data object to this object. More...
void | SetMaxPageRanges (int maxRanges)
| Sets the maximum number of page ranges that the user can specify. More...
int | GetMaxPageRanges () const
| Returns the maximum number of page ranges that the user can specify. More...
const std::vector< wxPrintPageRange > & | GetPageRanges () const
| Returns the page ranges to print. More...
void | SetPageRanges (const std::vector< wxPrintPageRange > &pageRanges)
| Sets the ranges of pages to print. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to nullptr the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=nullptr, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Additional Inherited Members
Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Constructor & Destructor Documentation

## ◆ wxPrintDialogData() [1/3]

wxPrintDialogData::wxPrintDialogData | ( |  | ) |

Default constructor.

## ◆ wxPrintDialogData() [2/3]

wxPrintDialogData::wxPrintDialogData | ( | const wxPrintDialogData & | dialogData | ) |

Copy constructor.

## ◆ wxPrintDialogData() [3/3]

wxPrintDialogData::wxPrintDialogData | ( | const wxPrintData & | printData | ) |

Construct an object from a print dialog data object.

## ◆ ~wxPrintDialogData()

virtual wxPrintDialogData::~wxPrintDialogData | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ EnableCurrentPage()

void wxPrintDialogData::EnableCurrentPage | ( | bool | 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.

Since
  3.3.0

## ◆ EnableHelp()

void wxPrintDialogData::EnableHelp | ( | bool | flag | ) |

Enables or disables the "Help" button.

## ◆ EnablePageNumbers()

void wxPrintDialogData::EnablePageNumbers | ( | bool | flag | ) |

Enables or disables the "Page numbers" controls.

## ◆ EnablePrintToFile()

void wxPrintDialogData::EnablePrintToFile | ( | bool | flag | ) |

Enables or disables the "Print to file" checkbox.

## ◆ EnableSelection()

void wxPrintDialogData::EnableSelection | ( | bool | flag | ) |

Enables or disables the "Selection" radio button.

## ◆ GetAllPages()

bool wxPrintDialogData::GetAllPages | ( |  | ) | const

Returns true if the user requested that all pages be printed.

## ◆ GetCollate()

bool wxPrintDialogData::GetCollate | ( |  | ) | const

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

## ◆ GetCurrentPage()

bool wxPrintDialogData::GetCurrentPage | ( |  | ) | const

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 EnableCurrentPage() had been called before, otherwise it always returns false.

Since
  3.3.0

## ◆ GetFromPage()

int wxPrintDialogData::GetFromPage | ( |  | ) | const

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

This function can't be used if multiple page ranges were specified, use GetPageRanges() instead.

## ◆ GetMaxPage()

int wxPrintDialogData::GetMaxPage | ( |  | ) | const

Returns the maximum page number.

## ◆ GetMaxPageRanges()

int wxPrintDialogData::GetMaxPageRanges | ( |  | ) | const

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

See also
  SetMaxRanges()

Since
  3.3.0

## ◆ GetMinPage()

int wxPrintDialogData::GetMinPage | ( |  | ) | const

Returns the minimum page number.

## ◆ GetNoCopies()

int wxPrintDialogData::GetNoCopies | ( |  | ) | const

Returns the number of copies requested by the user.

## ◆ GetPageRanges()

const std::vector<wxPrintPageRange>& wxPrintDialogData::GetPageRanges | ( |  | ) | const

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.

See also
  SetPageRanges()

Since
  3.3.0

## ◆ GetPrintData()

wxPrintData& wxPrintDialogData::GetPrintData | ( |  | ) |

Returns a reference to the internal wxPrintData object.

## ◆ GetPrintToFile()

bool wxPrintDialogData::GetPrintToFile | ( |  | ) | const

Returns true if the user has selected printing to a file.

## ◆ GetSelection()

bool wxPrintDialogData::GetSelection | ( |  | ) | const

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

## ◆ GetSpecifiedPages()

bool wxPrintDialogData::GetSpecifiedPages | ( |  | ) | const

Returns true if the user requested printing only the specified pages.

The pages to print can be retrieved using GetPageRanges().

Since
  3.3.0

## ◆ GetToPage()

int wxPrintDialogData::GetToPage | ( |  | ) | const

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

This function can't be used if multiple page ranges were specified, use GetPageRanges() instead.

## ◆ IsOk()

bool wxPrintDialogData::IsOk | ( |  | ) | const

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.

## ◆ operator=() [1/2]

void wxPrintDialogData::operator= | ( | const wxPrintData & | data | ) |

Assigns print data to this object.

## ◆ operator=() [2/2]

void wxPrintDialogData::operator= | ( | const wxPrintDialogData & | data | ) |

Assigns another print dialog data object to this object.

## ◆ SetAllPages()

void wxPrintDialogData::SetAllPages | ( | bool | 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 GetSpecifiedPages()).

## ◆ SetCollate()

void wxPrintDialogData::SetCollate | ( | bool | flag | ) |

Sets the "Collate" checkbox to true or false.

## ◆ SetCurrentPage()

void wxPrintDialogData::SetCurrentPage | ( | bool | flag = `true` | ) |

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

This function can only be called when 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 GetSpecifiedPages()).

See also
  GetCurrentPage()

Since
  3.3.0

## ◆ SetFromPage()

void wxPrintDialogData::SetFromPage | ( | int | page | ) |

Sets the from page number.

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

Note
  If SetPageRanges() was used to specify multiple ranges, this function cannot be used as there is no single "from" page to set.

## ◆ SetMaxPage()

void wxPrintDialogData::SetMaxPage | ( | int | page | ) |

Sets the maximum page number.

## ◆ SetMaxPageRanges()

void wxPrintDialogData::SetMaxPageRanges | ( | int | 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.

Since
  3.3.0

## ◆ SetMinPage()

void wxPrintDialogData::SetMinPage | ( | int | page | ) |

Sets the minimum page number.

## ◆ SetNoCopies()

void wxPrintDialogData::SetNoCopies | ( | int | n | ) |

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

## ◆ SetPageRanges()

void wxPrintDialogData::SetPageRanges | ( | const std::vector< wxPrintPageRange > & | pageRanges | ) |

Sets the ranges of pages to print.

Each element of the vector represents a range of pages to print. All ranges should be disjoint and be specified in increasing order.

Currently only wxMSW supports the full functionality of this function, all other ports only allow specifying a single range.

Passing an empty vector is equivalent to printing all pages.

Since
  3.3.0

## ◆ SetPrintData()

void wxPrintDialogData::SetPrintData | ( | const wxPrintData & | printData | ) |

Sets the internal wxPrintData.

## ◆ SetPrintToFile()

void wxPrintDialogData::SetPrintToFile | ( | bool | flag | ) |

Sets the "Print to file" checkbox to true or false.

## ◆ SetSelection()

void wxPrintDialogData::SetSelection | ( | bool | 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 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 GetSpecifiedPages()).

## ◆ SetSetupDialog()

void wxPrintDialogData::SetSetupDialog | ( | bool | flag | ) |

Deprecated:
  This function has been deprecated since version 2.5.4.

Determines whether the dialog to be shown will be the Print dialog (pass false) or Print Setup dialog (pass true).

## ◆ SetToPage()

void wxPrintDialogData::SetToPage | ( | int | page | ) |

Sets the "print to" page number.

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

Note
  If SetPageRanges() was used to specify multiple ranges, this function cannot be used as there is no single "to" page to set.