]>
git.saurik.com Git - wxWidgets.git/blob - interface/cmndata.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxFontData
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 @ref overview_wxfontdialogoverview "wxFontDialog overview"
15 This class holds a variety of information related to font dialogs.
20 @see Overview(), wxFont, wxFontDialog
22 class wxFontData
: public wxObject
26 Constructor. Initializes @e fontColour to black, @e showHelp to black,
27 @e allowSymbols to @true, @e enableEffects to @true,
28 @e minSize to 0 and @e maxSize to 0.
33 Enables or disables 'effects' under MS Windows or generic only. This refers to
35 controls for manipulating colour, strikeout and underline properties.
36 The default value is @true.
38 void EnableEffects(bool enable
);
41 Under MS Windows, returns a flag determining whether symbol fonts can be
43 effect on other platforms.
44 The default value is @true.
46 bool GetAllowSymbols();
49 Gets the font chosen by the user if the user pressed OK
50 (wxFontDialog::ShowModal returned wxID_OK).
52 wxFont
GetChosenFont();
55 Gets the colour associated with the font dialog.
56 The default value is black.
61 Determines whether 'effects' are enabled under Windows. This refers to the
62 controls for manipulating colour, strikeout and underline properties.
63 The default value is @true.
65 bool GetEnableEffects();
68 Gets the font that will be initially used by the font dialog. This should have
69 previously been set by the application.
71 wxFont
GetInitialFont();
74 Returns @true if the Help button will be shown (Windows only).
75 The default value is @false.
80 Under MS Windows, determines whether symbol fonts can be selected. Has no
81 effect on other platforms.
82 The default value is @true.
84 void SetAllowSymbols(bool allowSymbols
);
87 Sets the font that will be returned to the user (for internal use only).
89 void SetChosenFont(const wxFont
& font
);
92 Sets the colour that will be used for the font foreground colour.
93 The default colour is black.
95 void SetColour(const wxColour
& colour
);
98 Sets the font that will be initially used by the font dialog.
100 void SetInitialFont(const wxFont
& font
);
103 Sets the valid range for the font point size (Windows only).
104 The default is 0, 0 (unrestricted range).
106 void SetRange(int min
, int max
);
109 Determines whether the Help button will be displayed in the font dialog
111 The default value is @false.
113 void SetShowHelp(bool showHelp
);
116 Assignment operator for the font data.
118 void operator =(const wxFontData
& data
);
124 @class wxPageSetupDialogData
127 This class holds a variety of information related to wxPageSetupDialog.
129 It contains a wxPrintData member which is used to hold basic printer
130 configuration data (as opposed to the
131 user-interface configuration settings stored by wxPageSetupDialogData).
136 @see @ref overview_printingoverview "Printing framework overview",
139 class wxPageSetupDialogData
: public wxObject
144 Construct an object from a print data object.
146 wxPageSetupDialogData();
147 wxPageSetupDialogData(wxPageSetupDialogData
& data
);
148 wxPageSetupDialogData(wxPrintData
& printData
);
154 ~wxPageSetupDialogData();
157 Enables or disables the 'Help' button (Windows only).
159 void EnableHelp(bool flag
);
162 Enables or disables the margin controls (Windows only).
164 void EnableMargins(bool flag
);
167 Enables or disables the orientation control (Windows only).
169 void EnableOrientation(bool flag
);
172 Enables or disables the paper size control (Windows only).
174 void EnablePaper(bool flag
);
177 Enables or disables the @b Printer button, which invokes a printer setup dialog.
179 void EnablePrinter(bool flag
);
182 Returns @true if the dialog will simply return default printer information (such
184 instead of showing a dialog. Windows only.
186 bool GetDefaultInfo() const;
189 Returns @true if the page setup dialog will take its minimum margin values from
191 selected printer properties. Windows only.
193 bool GetDefaultMinMargins() const;
196 Returns @true if the printer setup button is enabled.
198 bool GetEnableHelp() const;
201 Returns @true if the margin controls are enabled (Windows only).
203 bool GetEnableMargins() const;
206 Returns @true if the orientation control is enabled (Windows only).
208 bool GetEnableOrientation() const;
211 Returns @true if the paper size control is enabled (Windows only).
213 bool GetEnablePaper() const;
216 Returns @true if the printer setup button is enabled.
218 bool GetEnablePrinter() const;
221 Returns the right (x) and bottom (y) margins in millimetres.
223 wxPoint
GetMarginBottomRight() const;
226 Returns the left (x) and top (y) margins in millimetres.
228 wxPoint
GetMarginTopLeft() const;
231 Returns the right (x) and bottom (y) minimum margins the user can enter
232 (Windows only). Units
235 wxPoint
GetMinMarginBottomRight() const;
238 Returns the left (x) and top (y) minimum margins the user can enter (Windows
242 wxPoint
GetMinMarginTopLeft() const;
245 Returns the paper id (stored in the internal wxPrintData object).
246 For further information, see wxPrintData::SetPaperId.
248 wxPaperSize
GetPaperId() const;
251 Returns the paper size in millimetres.
253 wxSize
GetPaperSize() const;
256 Returns a reference to the @ref overview_wxprintdata "print data" associated
259 wxPrintData
GetPrintData();
262 Returns @true if the print data associated with the dialog data is valid.
263 This can return @false on Windows if the current printer is not set, for example.
264 On all other platforms, it returns @true.
269 Pass @true if the dialog will simply return default printer information (such as
271 instead of showing a dialog. Windows only.
273 void SetDefaultInfo(bool flag
);
276 Pass @true if the page setup dialog will take its minimum margin values from the
278 selected printer properties. Windows only. Units are in millimetres
280 void SetDefaultMinMargins(bool flag
);
283 Sets the right (x) and bottom (y) margins in millimetres.
285 void SetMarginBottomRight(const wxPoint
& pt
);
288 Sets the left (x) and top (y) margins in millimetres.
290 void SetMarginTopLeft(const wxPoint
& pt
);
293 Sets the right (x) and bottom (y) minimum margins the user can enter (Windows
297 void SetMinMarginBottomRight(const wxPoint
& pt
);
300 Sets the left (x) and top (y) minimum margins the user can enter (Windows
304 void SetMinMarginTopLeft(const wxPoint
& pt
);
307 Sets the paper size id. For further information, see wxPrintData::SetPaperId.
308 Calling this function overrides the explicit paper dimensions passed in
311 void SetPaperId(wxPaperSize
& id
);
314 Sets the paper size in millimetres. If a corresponding paper id is found, it
316 internal wxPrintData object, otherwise the paper size overrides the paper id.
318 void SetPaperSize(const wxSize
& size
);
321 Sets the @ref overview_wxprintdata "print data" associated with this object.
323 void SetPrintData(const wxPrintData
& printData
);
327 Assigns page setup data to this object.
329 void operator =(const wxPrintData
& data
);
330 void operator =(const wxPageSetupDialogData
& data
);
340 This class holds a variety of information related to colour dialogs.
345 @see wxColour, wxColourDialog, @ref overview_wxcolourdialogoverview
346 "wxColourDialog overview"
348 class wxColourData
: public wxObject
352 Constructor. Initializes the custom colours to @c wxNullColour,
353 the @e data colour setting
354 to black, and the @e choose full setting to @true.
364 Under Windows, determines whether the Windows colour dialog will display the
366 with custom colour selection controls. Under PalmOS, determines whether colour
368 will display full rgb colour picker or only available palette indexer.
369 Has no meaning under other platforms.
370 The default value is @true.
372 bool GetChooseFull() const;
375 Gets the current colour associated with the colour dialog.
376 The default colour is black.
378 wxColour
GetColour() const;
381 Gets the @e ith custom colour associated with the colour dialog. @a i should
382 be an integer between 0 and 15.
383 The default custom colours are invalid colours.
385 wxColour
GetCustomColour(int i
) const;
388 Under Windows, tells the Windows colour dialog to display the full dialog
389 with custom colour selection controls. Under other platforms, has no effect.
390 The default value is @true.
392 void SetChooseFull(const bool flag
);
395 Sets the default colour for the colour dialog.
396 The default colour is black.
398 void SetColour(const wxColour
& colour
);
401 Sets the @e ith custom colour for the colour dialog. @a i should
402 be an integer between 0 and 15.
403 The default custom colours are invalid colours.
405 void SetCustomColour(int i
, const wxColour
& colour
);
408 Assignment operator for the colour data.
410 void operator =(const wxColourData
& data
);
419 This class holds a variety of information related to printers and
420 printer device contexts. This class is used to create a wxPrinterDC
421 and a wxPostScriptDC. It is also used as a data member of wxPrintDialogData
422 and wxPageSetupDialogData, as part of the mechanism for transferring data
423 between the print dialogs and the application.
428 @see @ref overview_printingoverview "Printing framework overview",
429 wxPrintDialog, wxPageSetupDialog, wxPrintDialogData, wxPageSetupDialogData, @ref overview_wxprintdialogoverview "wxPrintDialog Overview", wxPrinterDC, wxPostScriptDC
431 class wxPrintData
: public wxObject
439 wxPrintData(const wxPrintData
& data
);
448 Returns the current bin (papersource). By default, the system is left to select
449 the bin (@c wxPRINTBIN_DEFAULT is returned).
450 See SetBin() for the full list of bin values.
452 wxPrintBin
GetBin() const;
455 Returns @true if collation is on.
457 bool GetCollate() const;
460 Returns @true if colour printing is on.
462 bool GetColour() const;
465 Returns the duplex mode. One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL,
468 wxDuplexMode
GetDuplex() const;
471 Returns the number of copies requested by the user.
473 int GetNoCopies() const;
476 Gets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
478 int GetOrientation() const;
481 Returns the paper size id. For more information, see SetPaperId().
483 wxPaperSize
GetPaperId() const;
486 Returns the printer name. If the printer name is the empty string, it indicates
488 printer should be used.
490 const wxString
GetPrinterName() const;
493 Returns the current print quality. This can be a positive integer, denoting the
494 number of dots per inch, or
495 one of the following identifiers:
497 On input you should pass one of these identifiers, but on return you may get
498 back a positive integer
499 indicating the current resolution setting.
501 wxPrintQuality
GetQuality() const;
504 Returns @true if the print data is valid for using in print dialogs.
505 This can return @false on Windows if the current printer is not set, for example.
506 On all other platforms, it returns @true.
511 Sets the current bin. Possible values are:
513 void SetBin(wxPrintBin flag
);
516 Sets collation to on or off.
518 void SetCollate(bool flag
);
521 Sets colour printing on or off.
523 void SetColour(bool flag
);
526 Returns the duplex mode. One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL,
529 void SetDuplex(wxDuplexMode mode
);
532 Sets the default number of copies to be printed out.
534 void SetNoCopies(int n
);
537 Sets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
539 void SetOrientation(int orientation
);
542 Sets the paper id. This indicates the type of paper to be used. For a mapping
544 paper id, paper size and string name, see wxPrintPaperDatabase in @c paper.h
545 (not yet documented).
546 @a paperId can be one of:
548 void SetPaperId(wxPaperSize paperId
);
551 Sets the printer name. This can be the empty string to indicate that the default
552 printer should be used.
554 void SetPrinterName(const wxString
& printerName
);
557 Sets the desired print quality. This can be a positive integer, denoting the
558 number of dots per inch, or
559 one of the following identifiers:
561 On input you should pass one of these identifiers, but on return you may get
562 back a positive integer
563 indicating the current resolution setting.
565 void SetQuality(wxPrintQuality quality
);
569 Assigns print setup data to this object. wxPrintSetupData is deprecated,
570 but retained for backward compatibility.
572 void operator =(const wxPrintData
& data
);
573 void operator =(const wxPrintSetupData
& data
);
580 @class wxPrintDialogData
583 This class holds information related to the visual characteristics of
585 It contains a wxPrintData object with underlying printing settings.
590 @see @ref overview_printingoverview "Printing framework overview",
591 wxPrintDialog, @ref overview_wxprintdialogoverview "wxPrintDialog Overview"
593 class wxPrintDialogData
: public wxObject
598 Construct an object from a print dialog data object.
601 wxPrintDialogData(wxPrintDialogData
& dialogData
);
602 wxPrintDialogData(wxPrintData
& printData
);
608 ~wxPrintDialogData();
611 Enables or disables the 'Help' button.
613 void EnableHelp(bool flag
);
616 Enables or disables the 'Page numbers' controls.
618 void EnablePageNumbers(bool flag
);
621 Enables or disables the 'Print to file' checkbox.
623 void EnablePrintToFile(bool flag
);
626 Enables or disables the 'Selection' radio button.
628 void EnableSelection(bool flag
);
631 Returns @true if the user requested that all pages be printed.
633 bool GetAllPages() const;
636 Returns @true if the user requested that the document(s) be collated.
638 bool GetCollate() const;
641 Returns the @e from page number, as entered by the user.
643 int GetFromPage() const;
646 Returns the @e maximum page number.
648 int GetMaxPage() const;
651 Returns the @e minimum page number.
653 int GetMinPage() const;
656 Returns the number of copies requested by the user.
658 int GetNoCopies() const;
661 Returns a reference to the internal wxPrintData object.
663 wxPrintData
GetPrintData();
666 Returns @true if the user has selected printing to a file.
668 bool GetPrintToFile() const;
671 Returns @true if the user requested that the selection be printed (where
673 a concept specific to the application).
675 bool GetSelection() const;
678 Returns the @e to page number, as entered by the user.
680 int GetToPage() const;
683 Returns @true if the print data is valid for using in print dialogs.
684 This can return @false on Windows if the current printer is not set, for example.
685 On all other platforms, it returns @true.
690 Sets the 'Collate' checkbox to @true or @false.
692 void SetCollate(bool flag
);
695 Sets the @e from page number.
697 void SetFromPage(int page
);
700 Sets the @e maximum page number.
702 void SetMaxPage(int page
);
705 Sets the @e minimum page number.
707 void SetMinPage(int page
);
710 Sets the default number of copies the user has requested to be printed out.
712 void SetNoCopies(int n
);
715 Sets the internal wxPrintData.
717 void SetPrintData(const wxPrintData
& printData
);
720 Sets the 'Print to file' checkbox to @true or @false.
722 void SetPrintToFile(bool flag
);
725 Selects the 'Selection' radio button. The effect of printing the selection
726 depends on how the application
727 implements this command, if at all.
729 void SetSelection(bool flag
);
732 Determines whether the dialog to be shown will be the Print dialog
733 (pass @false) or Print Setup dialog (pass @true).
734 This function has been deprecated since version 2.5.4.
736 void SetSetupDialog(bool flag
);
739 Sets the @e to page number.
741 void SetToPage(int page
);
745 Assigns another print dialog data object to this object.
747 void operator =(const wxPrintData
& data
);
748 void operator =(const wxPrintDialogData
& data
);