1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common GDI data classes
4 // Author: Julian Smart and others
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __CMNDATAH_BASE__
13 #define __CMNDATAH_BASE__
16 #pragma interface "cmndata.h"
19 class WXDLLEXPORT wxColourData
: public wxObject
21 DECLARE_DYNAMIC_CLASS(wxColourData
)
24 wxColour custColours
[16];
30 inline void SetChooseFull(bool flag
) { chooseFull
= flag
; }
31 inline bool GetChooseFull(void) { return chooseFull
; }
32 inline void SetColour(wxColour
& colour
) { dataColour
= colour
; }
33 inline wxColour
&GetColour(void) { return dataColour
; }
35 // Array of 16 custom colours
36 void SetCustomColour(int i
, wxColour
& colour
);
37 wxColour
GetCustomColour(int i
);
39 void operator=(const wxColourData
& data
);
42 class WXDLLEXPORT wxFontData
: public wxObject
44 DECLARE_DYNAMIC_CLASS(wxFontData
)
58 inline void SetAllowSymbols(bool flag
) { allowSymbols
= flag
; }
59 inline bool GetAllowSymbols(void) { return allowSymbols
; }
60 inline void SetColour(const wxColour
& colour
) { fontColour
= colour
; }
61 inline wxColour
&GetColour(void) { return fontColour
; }
62 inline void SetShowHelp(bool flag
) { showHelp
= flag
; }
63 inline bool GetShowHelp(void) { return showHelp
; }
64 inline void EnableEffects(bool flag
) { enableEffects
= flag
; }
65 inline bool GetEnableEffects(void) { return enableEffects
; }
66 inline void SetInitialFont(const wxFont
& font
) { initialFont
= font
; }
67 inline wxFont
GetInitialFont(void) { return initialFont
; }
68 inline void SetChosenFont(const wxFont
& font
) { chosenFont
= font
; }
69 inline wxFont
GetChosenFont(void) { return chosenFont
; }
70 inline void SetRange(int minRange
, int maxRange
) { minSize
= minRange
; maxSize
= maxRange
; }
72 void operator=(const wxFontData
& data
);
77 * Encapsulates information displayed and edited in the printer dialog box.
80 class WXDLLEXPORT wxPrintData
: public wxObject
82 DECLARE_DYNAMIC_CLASS(wxPrintData
)
97 bool printEnableSelection
;
98 bool printEnablePageNumbers
;
100 bool printEnablePrintToFile
;
101 bool printSetupDialog
;
106 inline int GetFromPage(void) { return printFromPage
; };
107 inline int GetToPage(void) { return printToPage
; };
108 inline int GetMinPage(void) { return printMinPage
; };
109 inline int GetMaxPage(void) { return printMaxPage
; };
110 inline int GetNoCopies(void) { return printNoCopies
; };
111 inline bool GetAllPages(void) { return printAllPages
; };
112 inline bool GetCollate(void) { return printCollate
; };
113 inline bool GetPrintToFile(void) { return printToFile
; };
114 inline bool GetSetupDialog(void) { return printSetupDialog
; };
115 inline int GetOrientation(void) { return printOrientation
; };
117 inline void SetFromPage(int v
) { printFromPage
= v
; };
118 inline void SetToPage(int v
) { printToPage
= v
; };
119 inline void SetMinPage(int v
) { printMinPage
= v
; };
120 inline void SetMaxPage(int v
) { printMaxPage
= v
; };
121 inline void SetNoCopies(int v
) { printNoCopies
= v
; };
122 inline void SetAllPages(bool flag
) { printAllPages
= flag
; };
123 inline void SetCollate(bool flag
) { printCollate
= flag
; };
124 inline void SetPrintToFile(bool flag
) { printToFile
= flag
; };
125 inline void SetSetupDialog(bool flag
) { printSetupDialog
= flag
; };
126 inline void SetOrientation(int orient
) { printOrientation
= orient
; };
128 inline void EnablePrintToFile(bool flag
) { printEnablePrintToFile
= flag
; };
129 inline void EnableSelection(bool flag
) { printEnableSelection
= flag
; };
130 inline void EnablePageNumbers(bool flag
) { printEnablePageNumbers
= flag
; };
131 inline void EnableHelp(bool flag
) { printEnableHelp
= flag
; };
133 inline bool GetEnablePrintToFile(void) { return printEnablePrintToFile
; };
134 inline bool GetEnableSelection(void) { return printEnableSelection
; };
135 inline bool GetEnablePageNumbers(void) { return printEnablePageNumbers
; };
136 inline bool GetEnableHelp(void) { return printEnableHelp
; };
138 void operator=(const wxPrintData
& data
);
141 // Convert to/from the PRINTDLG structure
142 void ConvertToNative(void);
143 void ConvertFromNative(void);
144 void SetOwnerWindow(wxWindow
* win
);
145 inline void* GetNativeData(void) { return printData
; }
150 * This is the data used (and returned) by the wxPageSetupDialog.
153 class WXDLLEXPORT wxPageSetupData
: public wxObject
155 DECLARE_DYNAMIC_CLASS(wxPageSetupData
)
158 #if defined(__WIN95__)
159 void* m_pageSetupData
;
162 wxPoint m_minMarginTopLeft
;
163 wxPoint m_minMarginBottomRight
;
164 wxPoint m_marginTopLeft
;
165 wxPoint m_marginBottomRight
;
169 bool m_defaultMinMargins
;
170 bool m_enableMargins
;
171 bool m_enableOrientation
;
173 bool m_enablePrinter
;
174 bool m_getDefaultInfo
; // Equiv. to PSD_RETURNDEFAULT
177 wxPageSetupData(void);
178 ~wxPageSetupData(void);
180 inline wxPoint
GetPaperSize(void) { return m_paperSize
; };
181 inline wxPoint
GetMinMarginTopLeft(void) { return m_minMarginTopLeft
; };
182 inline wxPoint
GetMinMarginBottomRight(void) { return m_minMarginBottomRight
; };
183 inline wxPoint
GetMarginTopLeft(void) { return m_marginTopLeft
; };
184 inline wxPoint
GetMarginBottomRight(void) { return m_marginBottomRight
; };
185 inline int GetOrientation(void) { return m_orientation
; };
187 inline bool GetDefaultMinMargins(void) { return m_defaultMinMargins
; };
188 inline bool GetEnableMargins(void) { return m_enableMargins
; };
189 inline bool GetEnableOrientation(void) { return m_enableOrientation
; };
190 inline bool GetEnablePaper(void) { return m_enablePaper
; };
191 inline bool GetEnablePrinter(void) { return m_enablePrinter
; };
192 inline bool GetDefaultInfo(void) { return m_getDefaultInfo
; };
193 inline bool GetEnableHelp(void) { return m_enableHelp
; };
195 inline void SetPaperSize(const wxPoint
& pt
) { m_paperSize
= pt
; };
196 inline void SetMinMarginTopLeft(const wxPoint
& pt
) { m_minMarginTopLeft
= pt
; };
197 inline void SetMinMarginBottomRight(const wxPoint
& pt
) { m_minMarginBottomRight
= pt
; };
198 inline void SetMarginTopLeft(const wxPoint
& pt
) { m_marginTopLeft
= pt
; };
199 inline void SetMarginBottomRight(const wxPoint
& pt
) { m_marginBottomRight
= pt
; };
200 inline void SetOrientation(int orient
) { m_orientation
= orient
; };
201 inline void SetDefaultMinMargins(bool flag
) { m_defaultMinMargins
= flag
; };
202 inline void SetDefaultInfo(bool flag
) { m_getDefaultInfo
= flag
; };
204 inline void EnableMargins(bool flag
) { m_enableMargins
= flag
; };
205 inline void EnableOrientation(bool flag
) { m_enableOrientation
= flag
; };
206 inline void EnablePaper(bool flag
) { m_enablePaper
= flag
; };
207 inline void EnablePrinter(bool flag
) { m_enablePrinter
= flag
; };
208 inline void EnableHelp(bool flag
) { m_enableHelp
= flag
; };
210 #if defined(__WIN95__)
211 // Convert to/from the PAGESETUPDLG structure
212 void ConvertToNative(void);
213 void ConvertFromNative(void);
214 void SetOwnerWindow(wxWindow
* win
);
215 inline void* GetNativeData(void) { return m_pageSetupData
; }
218 void operator=(const wxPageSetupData
& data
);