]>
Commit | Line | Data |
---|---|---|
603f702b | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/richtext/richtextsizepage.h |
603f702b JS |
3 | // Purpose: |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 20/10/2010 10:23:24 | |
7 | // RCS-ID: | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _RICHTEXTSIZEPAGE_H_ | |
13 | #define _RICHTEXTSIZEPAGE_H_ | |
14 | ||
15 | /*! | |
16 | * Includes | |
17 | */ | |
18 | ||
19 | #include "wx/richtext/richtextdialogpage.h" | |
20 | #include "wx/sizer.h" | |
21 | ||
22 | ////@begin includes | |
23 | #include "wx/statline.h" | |
d87098c0 | 24 | #include "wx/valgen.h" |
603f702b | 25 | ////@end includes |
7f4f8a78 | 26 | #include "wx/stattext.h" |
603f702b JS |
27 | |
28 | /*! | |
29 | * Forward declarations | |
30 | */ | |
31 | ||
32 | ||
33 | /*! | |
34 | * Control identifiers | |
35 | */ | |
36 | ||
37 | ////@begin control identifiers | |
38 | #define SYMBOL_WXRICHTEXTSIZEPAGE_STYLE wxTAB_TRAVERSAL | |
39 | #define SYMBOL_WXRICHTEXTSIZEPAGE_TITLE wxEmptyString | |
40 | #define SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME ID_WXRICHTEXTSIZEPAGE | |
41 | #define SYMBOL_WXRICHTEXTSIZEPAGE_SIZE wxSize(400, 300) | |
42 | #define SYMBOL_WXRICHTEXTSIZEPAGE_POSITION wxDefaultPosition | |
43 | ////@end control identifiers | |
44 | ||
45 | ||
46 | /*! | |
47 | * wxRichTextSizePage class declaration | |
48 | */ | |
49 | ||
50 | class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage: public wxRichTextDialogPage | |
51 | { | |
52 | DECLARE_DYNAMIC_CLASS( wxRichTextSizePage ) | |
53 | DECLARE_EVENT_TABLE() | |
54 | DECLARE_HELP_PROVISION() | |
55 | ||
56 | public: | |
57 | /// Constructors | |
58 | wxRichTextSizePage(); | |
59 | wxRichTextSizePage( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTSIZEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSIZEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSIZEPAGE_STYLE ); | |
60 | ||
61 | /// Creation | |
62 | bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WXRICHTEXTSIZEPAGE_IDNAME, const wxPoint& pos = SYMBOL_WXRICHTEXTSIZEPAGE_POSITION, const wxSize& size = SYMBOL_WXRICHTEXTSIZEPAGE_SIZE, long style = SYMBOL_WXRICHTEXTSIZEPAGE_STYLE ); | |
63 | ||
64 | /// Destructor | |
65 | ~wxRichTextSizePage(); | |
66 | ||
67 | /// Initialises member variables | |
68 | void Init(); | |
69 | ||
70 | /// Creates the controls and sizers | |
71 | void CreateControls(); | |
72 | ||
73 | /// Gets the attributes from the formatting dialog | |
74 | wxRichTextAttr* GetAttributes(); | |
75 | ||
76 | /// Data transfer | |
77 | virtual bool TransferDataToWindow(); | |
78 | virtual bool TransferDataFromWindow(); | |
79 | ||
17e0cd88 JS |
80 | /// Show/hide position controls |
81 | static void ShowPositionControls(bool show) { sm_showPositionControls = show; } | |
603f702b | 82 | |
507a6cd6 JS |
83 | /// Show/hide minimum and maximum size controls |
84 | static void ShowMinMaxSizeControls(bool show) { sm_showMinMaxSizeControls = show; } | |
85 | ||
404b319a | 86 | /// Show/hide position mode controls |
17e0cd88 | 87 | static void ShowPositionModeControls(bool show) { sm_showPositionModeControls = show; } |
404b319a JS |
88 | |
89 | /// Show/hide right/bottom position controls | |
17e0cd88 | 90 | static void ShowRightBottomPositionControls(bool show) { sm_showRightBottomPositionControls = show; } |
404b319a JS |
91 | |
92 | /// Show/hide floating and alignment controls | |
17e0cd88 | 93 | static void ShowFloatingAndAlignmentControls(bool show) { sm_showFloatingAndAlignmentControls = show; } |
404b319a | 94 | |
603f702b | 95 | /// Show/hide floating controls |
17e0cd88 | 96 | static void ShowFloatingControls(bool show) { sm_showFloatingControls = show; } |
603f702b | 97 | |
404b319a | 98 | /// Show/hide alignment controls |
17e0cd88 | 99 | static void ShowAlignmentControls(bool show) { sm_showAlignmentControls = show; } |
404b319a | 100 | |
507a6cd6 JS |
101 | /// Enable the position and size units |
102 | static void EnablePositionAndSizeUnits(bool enable) { sm_enablePositionAndSizeUnits = enable; } | |
103 | ||
104 | /// Enable the checkboxes for position and size | |
105 | static void EnablePositionAndSizeCheckboxes(bool enable) { sm_enablePositionAndSizeCheckboxes = enable; } | |
106 | ||
603f702b JS |
107 | ////@begin wxRichTextSizePage event handler declarations |
108 | ||
d87098c0 JS |
109 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX |
110 | void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event ); | |
111 | ||
603f702b JS |
112 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH |
113 | void OnRichtextWidthUpdate( wxUpdateUIEvent& event ); | |
114 | ||
507a6cd6 JS |
115 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_W |
116 | void OnRichtextWidthUnitsUpdate( wxUpdateUIEvent& event ); | |
117 | ||
603f702b JS |
118 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT |
119 | void OnRichtextHeightUpdate( wxUpdateUIEvent& event ); | |
120 | ||
507a6cd6 JS |
121 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_H |
122 | void OnRichtextHeightUnitsUpdate( wxUpdateUIEvent& event ); | |
123 | ||
303f0be7 JS |
124 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH |
125 | void OnRichtextMinWidthUpdate( wxUpdateUIEvent& event ); | |
126 | ||
127 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT | |
128 | void OnRichtextMinHeightUpdate( wxUpdateUIEvent& event ); | |
129 | ||
130 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH | |
131 | void OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event ); | |
132 | ||
133 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT | |
134 | void OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event ); | |
135 | ||
d87098c0 JS |
136 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT |
137 | void OnRichtextLeftUpdate( wxUpdateUIEvent& event ); | |
603f702b | 138 | |
d87098c0 | 139 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS |
507a6cd6 JS |
140 | void OnRichtextLeftUnitsUpdate( wxUpdateUIEvent& event ); |
141 | ||
142 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP | |
d87098c0 JS |
143 | void OnRichtextTopUpdate( wxUpdateUIEvent& event ); |
144 | ||
507a6cd6 JS |
145 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS |
146 | void OnRichtextTopUnitsUpdate( wxUpdateUIEvent& event ); | |
147 | ||
d87098c0 JS |
148 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT |
149 | void OnRichtextRightUpdate( wxUpdateUIEvent& event ); | |
150 | ||
507a6cd6 JS |
151 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS |
152 | void OnRichtextRightUnitsUpdate( wxUpdateUIEvent& event ); | |
153 | ||
d87098c0 JS |
154 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM |
155 | void OnRichtextBottomUpdate( wxUpdateUIEvent& event ); | |
603f702b | 156 | |
507a6cd6 JS |
157 | /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS |
158 | void OnRichtextBottomUnitsUpdate( wxUpdateUIEvent& event ); | |
159 | ||
ce7fe42e | 160 | /// wxEVT_BUTTON event handler for ID_RICHTEXT_PARA_UP |
603f702b JS |
161 | void OnRichtextParaUpClick( wxCommandEvent& event ); |
162 | ||
ce7fe42e | 163 | /// wxEVT_BUTTON event handler for ID_RICHTEXT_PARA_DOWN |
603f702b JS |
164 | void OnRichtextParaDownClick( wxCommandEvent& event ); |
165 | ||
166 | ////@end wxRichTextSizePage event handler declarations | |
167 | ||
168 | ////@begin wxRichTextSizePage member function declarations | |
169 | ||
d87098c0 JS |
170 | int GetPositionMode() const { return m_positionMode ; } |
171 | void SetPositionMode(int value) { m_positionMode = value ; } | |
172 | ||
603f702b JS |
173 | /// Retrieves bitmap resources |
174 | wxBitmap GetBitmapResource( const wxString& name ); | |
175 | ||
176 | /// Retrieves icon resources | |
177 | wxIcon GetIconResource( const wxString& name ); | |
178 | ////@end wxRichTextSizePage member function declarations | |
179 | ||
180 | /// Should we show tooltips? | |
181 | static bool ShowToolTips(); | |
182 | ||
183 | ////@begin wxRichTextSizePage member variables | |
184 | wxBoxSizer* m_parentSizer; | |
404b319a JS |
185 | wxBoxSizer* m_floatingAlignmentSizer; |
186 | wxBoxSizer* m_floatingSizer; | |
17e0cd88 | 187 | wxChoice* m_float; |
404b319a | 188 | wxBoxSizer* m_alignmentSizer; |
d87098c0 | 189 | wxCheckBox* m_verticalAlignmentCheckbox; |
17e0cd88 | 190 | wxChoice* m_verticalAlignmentComboBox; |
507a6cd6 JS |
191 | wxFlexGridSizer* m_sizeSizer; |
192 | wxBoxSizer* m_widthSizer; | |
603f702b | 193 | wxCheckBox* m_widthCheckbox; |
507a6cd6 | 194 | wxStaticText* m_widthLabel; |
603f702b JS |
195 | wxTextCtrl* m_width; |
196 | wxComboBox* m_unitsW; | |
507a6cd6 | 197 | wxBoxSizer* m_heightSizer; |
603f702b | 198 | wxCheckBox* m_heightCheckbox; |
507a6cd6 | 199 | wxStaticText* m_heightLabel; |
603f702b JS |
200 | wxTextCtrl* m_height; |
201 | wxComboBox* m_unitsH; | |
303f0be7 | 202 | wxCheckBox* m_minWidthCheckbox; |
507a6cd6 | 203 | wxBoxSizer* m_minWidthSizer; |
303f0be7 JS |
204 | wxTextCtrl* m_minWidth; |
205 | wxComboBox* m_unitsMinW; | |
206 | wxCheckBox* m_minHeightCheckbox; | |
507a6cd6 | 207 | wxBoxSizer* m_minHeightSizer; |
303f0be7 JS |
208 | wxTextCtrl* m_minHeight; |
209 | wxComboBox* m_unitsMinH; | |
210 | wxCheckBox* m_maxWidthCheckbox; | |
507a6cd6 | 211 | wxBoxSizer* m_maxWidthSizer; |
303f0be7 JS |
212 | wxTextCtrl* m_maxWidth; |
213 | wxComboBox* m_unitsMaxW; | |
214 | wxCheckBox* m_maxHeightCheckbox; | |
507a6cd6 | 215 | wxBoxSizer* m_maxHeightSizer; |
303f0be7 JS |
216 | wxTextCtrl* m_maxHeight; |
217 | wxComboBox* m_unitsMaxH; | |
603f702b JS |
218 | wxBoxSizer* m_positionControls; |
219 | wxBoxSizer* m_moveObjectParentSizer; | |
404b319a | 220 | wxBoxSizer* m_positionModeSizer; |
507a6cd6 | 221 | wxChoice* m_positionModeCtrl; |
404b319a | 222 | wxFlexGridSizer* m_positionGridSizer; |
507a6cd6 | 223 | wxBoxSizer* m_leftSizer; |
d87098c0 | 224 | wxCheckBox* m_positionLeftCheckbox; |
507a6cd6 | 225 | wxStaticText* m_leftLabel; |
d87098c0 JS |
226 | wxTextCtrl* m_left; |
227 | wxComboBox* m_unitsLeft; | |
507a6cd6 | 228 | wxBoxSizer* m_topSizer; |
d87098c0 | 229 | wxCheckBox* m_positionTopCheckbox; |
507a6cd6 | 230 | wxStaticText* m_topLabel; |
d87098c0 JS |
231 | wxTextCtrl* m_top; |
232 | wxComboBox* m_unitsTop; | |
507a6cd6 | 233 | wxBoxSizer* m_rightSizer; |
d87098c0 | 234 | wxCheckBox* m_positionRightCheckbox; |
507a6cd6 | 235 | wxStaticText* m_rightLabel; |
404b319a | 236 | wxBoxSizer* m_rightPositionSizer; |
d87098c0 JS |
237 | wxTextCtrl* m_right; |
238 | wxComboBox* m_unitsRight; | |
507a6cd6 | 239 | wxBoxSizer* m_bottomSizer; |
d87098c0 | 240 | wxCheckBox* m_positionBottomCheckbox; |
507a6cd6 | 241 | wxStaticText* m_bottomLabel; |
404b319a | 242 | wxBoxSizer* m_bottomPositionSizer; |
d87098c0 JS |
243 | wxTextCtrl* m_bottom; |
244 | wxComboBox* m_unitsBottom; | |
603f702b | 245 | wxBoxSizer* m_moveObjectSizer; |
d87098c0 | 246 | int m_positionMode; |
603f702b JS |
247 | /// Control identifiers |
248 | enum { | |
249 | ID_WXRICHTEXTSIZEPAGE = 10700, | |
250 | ID_RICHTEXT_FLOATING_MODE = 10701, | |
d87098c0 JS |
251 | ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX = 10708, |
252 | ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX = 10709, | |
603f702b JS |
253 | ID_RICHTEXT_WIDTH_CHECKBOX = 10702, |
254 | ID_RICHTEXT_WIDTH = 10703, | |
255 | ID_RICHTEXT_UNITS_W = 10704, | |
256 | ID_RICHTEXT_HEIGHT_CHECKBOX = 10705, | |
257 | ID_RICHTEXT_HEIGHT = 10706, | |
258 | ID_RICHTEXT_UNITS_H = 10707, | |
303f0be7 JS |
259 | ID_RICHTEXT_MIN_WIDTH_CHECKBOX = 10715, |
260 | ID_RICHTEXT_MIN_WIDTH = 10716, | |
261 | ID_RICHTEXT_UNITS_MIN_W = 10717, | |
262 | ID_RICHTEXT_MIN_HEIGHT_CHECKBOX = 10718, | |
263 | ID_RICHTEXT_MIN_HEIGHT = 10719, | |
264 | ID_RICHTEXT_UNITS_MIN_H = 10720, | |
265 | ID_RICHTEXT_MAX_WIDTH_CHECKBOX = 10721, | |
266 | ID_RICHTEXT_MAX_WIDTH = 10722, | |
267 | ID_RICHTEXT_UNITS_MAX_W = 10723, | |
268 | ID_RICHTEXT_MAX_HEIGHT_CHECKBOX = 10724, | |
269 | ID_RICHTEXT_MAX_HEIGHT = 10725, | |
270 | ID_RICHTEXT_UNITS_MAX_H = 10726, | |
d87098c0 JS |
271 | ID_RICHTEXT_POSITION_MODE = 10735, |
272 | ID_RICHTEXT_LEFT_CHECKBOX = 10710, | |
273 | ID_RICHTEXT_LEFT = 10711, | |
274 | ID_RICHTEXT_LEFT_UNITS = 10712, | |
275 | ID_RICHTEXT_TOP_CHECKBOX = 10710, | |
276 | ID_RICHTEXT_TOP = 10728, | |
277 | ID_RICHTEXT_TOP_UNITS = 10729, | |
278 | ID_RICHTEXT_RIGHT_CHECKBOX = 10727, | |
279 | ID_RICHTEXT_RIGHT = 10730, | |
280 | ID_RICHTEXT_RIGHT_UNITS = 10731, | |
281 | ID_RICHTEXT_BOTTOM_CHECKBOX = 10732, | |
282 | ID_RICHTEXT_BOTTOM = 10733, | |
283 | ID_RICHTEXT_BOTTOM_UNITS = 10734, | |
603f702b JS |
284 | ID_RICHTEXT_PARA_UP = 10713, |
285 | ID_RICHTEXT_PARA_DOWN = 10714 | |
286 | }; | |
287 | ////@end wxRichTextSizePage member variables | |
17e0cd88 JS |
288 | |
289 | static bool sm_showFloatingControls; | |
290 | static bool sm_showPositionControls; | |
507a6cd6 | 291 | static bool sm_showMinMaxSizeControls; |
17e0cd88 JS |
292 | static bool sm_showPositionModeControls; |
293 | static bool sm_showRightBottomPositionControls; | |
294 | static bool sm_showAlignmentControls; | |
295 | static bool sm_showFloatingAndAlignmentControls; | |
507a6cd6 JS |
296 | static bool sm_enablePositionAndSizeUnits; |
297 | static bool sm_enablePositionAndSizeCheckboxes; | |
603f702b JS |
298 | }; |
299 | ||
300 | #endif | |
301 | // _RICHTEXTSIZEPAGE_H_ |