]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cmndata.h
constraints for notebook pages work (again)
[wxWidgets.git] / include / wx / cmndata.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cmndata.h
3 // Purpose: Common GDI data classes
4 // Author: Julian Smart and others
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __CMNDATAH_BASE__
13 #define __CMNDATAH_BASE__
14
15 #ifdef __GNUG__
16 #pragma interface "cmndata.h"
17 #endif
18
19 class WXDLLEXPORT wxColourData: public wxObject
20 {
21 DECLARE_DYNAMIC_CLASS(wxColourData)
22 public:
23 wxColour dataColour;
24 wxColour custColours[16];
25 bool chooseFull;
26
27 wxColourData(void);
28 ~wxColourData(void);
29
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; }
34
35 // Array of 16 custom colours
36 void SetCustomColour(int i, wxColour& colour);
37 wxColour GetCustomColour(int i);
38
39 void operator=(const wxColourData& data);
40 };
41
42 class WXDLLEXPORT wxFontData: public wxObject
43 {
44 DECLARE_DYNAMIC_CLASS(wxFontData)
45 public:
46 wxColour fontColour;
47 bool showHelp;
48 bool allowSymbols;
49 bool enableEffects;
50 wxFont initialFont;
51 wxFont chosenFont;
52 int minSize;
53 int maxSize;
54
55 wxFontData(void);
56 ~wxFontData(void);
57
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; }
71
72 void operator=(const wxFontData& data);
73 };
74
75 /*
76 * wxPrintData
77 * Encapsulates information displayed and edited in the printer dialog box.
78 */
79
80 class WXDLLEXPORT wxPrintData: public wxObject
81 {
82 DECLARE_DYNAMIC_CLASS(wxPrintData)
83
84 public:
85 #ifdef __WXMSW__
86 void *printData;
87 #endif
88 int printFromPage;
89 int printToPage;
90 int printMinPage;
91 int printMaxPage;
92 int printNoCopies;
93 int printOrientation;
94 bool printAllPages;
95 bool printCollate;
96 bool printToFile;
97 bool printEnableSelection;
98 bool printEnablePageNumbers;
99 bool printEnableHelp;
100 bool printEnablePrintToFile;
101 bool printSetupDialog;
102
103 wxPrintData(void);
104 ~wxPrintData(void);
105
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; };
116
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; };
127
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; };
132
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; };
137
138 void operator=(const wxPrintData& data);
139
140 #ifdef __WXMSW__
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; }
146 #endif
147 };
148
149 /*
150 * This is the data used (and returned) by the wxPageSetupDialog.
151 */
152
153 class WXDLLEXPORT wxPageSetupData: public wxObject
154 {
155 DECLARE_DYNAMIC_CLASS(wxPageSetupData)
156
157 public:
158 #if defined(__WIN95__)
159 void* m_pageSetupData;
160 #endif
161 wxPoint m_paperSize;
162 wxPoint m_minMarginTopLeft;
163 wxPoint m_minMarginBottomRight;
164 wxPoint m_marginTopLeft;
165 wxPoint m_marginBottomRight;
166 int m_orientation;
167
168 // Flags
169 bool m_defaultMinMargins;
170 bool m_enableMargins;
171 bool m_enableOrientation;
172 bool m_enablePaper;
173 bool m_enablePrinter;
174 bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
175 bool m_enableHelp;
176
177 wxPageSetupData(void);
178 ~wxPageSetupData(void);
179
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; };
186
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; };
194
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; };
203
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; };
209
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; }
216 #endif
217
218 void operator=(const wxPageSetupData& data);
219 };
220
221
222 #endif
223 // __CMNDATAH_BASE__