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