]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextsizepage.h
Applied #15226 wxRichTextCtrl: Implement setting properties with undo for objects...
[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 #include "wx/stattext.h"
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
80 /// Show/hide position controls
81 static void ShowPositionControls(bool show) { sm_showPositionControls = show; }
82
83 /// Show/hide minimum and maximum size controls
84 static void ShowMinMaxSizeControls(bool show) { sm_showMinMaxSizeControls = show; }
85
86 /// Show/hide position mode controls
87 static void ShowPositionModeControls(bool show) { sm_showPositionModeControls = show; }
88
89 /// Show/hide right/bottom position controls
90 static void ShowRightBottomPositionControls(bool show) { sm_showRightBottomPositionControls = show; }
91
92 /// Show/hide floating and alignment controls
93 static void ShowFloatingAndAlignmentControls(bool show) { sm_showFloatingAndAlignmentControls = show; }
94
95 /// Show/hide floating controls
96 static void ShowFloatingControls(bool show) { sm_showFloatingControls = show; }
97
98 /// Show/hide alignment controls
99 static void ShowAlignmentControls(bool show) { sm_showAlignmentControls = show; }
100
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
107 ////@begin wxRichTextSizePage event handler declarations
108
109 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
110 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event );
111
112 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
113 void OnRichtextWidthUpdate( wxUpdateUIEvent& event );
114
115 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_W
116 void OnRichtextWidthUnitsUpdate( wxUpdateUIEvent& event );
117
118 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
119 void OnRichtextHeightUpdate( wxUpdateUIEvent& event );
120
121 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_H
122 void OnRichtextHeightUnitsUpdate( wxUpdateUIEvent& event );
123
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
136 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
137 void OnRichtextLeftUpdate( wxUpdateUIEvent& event );
138
139 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
140 void OnRichtextLeftUnitsUpdate( wxUpdateUIEvent& event );
141
142 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP
143 void OnRichtextTopUpdate( wxUpdateUIEvent& event );
144
145 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS
146 void OnRichtextTopUnitsUpdate( wxUpdateUIEvent& event );
147
148 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
149 void OnRichtextRightUpdate( wxUpdateUIEvent& event );
150
151 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS
152 void OnRichtextRightUnitsUpdate( wxUpdateUIEvent& event );
153
154 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
155 void OnRichtextBottomUpdate( wxUpdateUIEvent& event );
156
157 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS
158 void OnRichtextBottomUnitsUpdate( wxUpdateUIEvent& event );
159
160 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
161 void OnRichtextParaUpClick( wxCommandEvent& event );
162
163 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
164 void OnRichtextParaDownClick( wxCommandEvent& event );
165
166 ////@end wxRichTextSizePage event handler declarations
167
168 ////@begin wxRichTextSizePage member function declarations
169
170 int GetPositionMode() const { return m_positionMode ; }
171 void SetPositionMode(int value) { m_positionMode = value ; }
172
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;
185 wxBoxSizer* m_floatingAlignmentSizer;
186 wxBoxSizer* m_floatingSizer;
187 wxChoice* m_float;
188 wxBoxSizer* m_alignmentSizer;
189 wxCheckBox* m_verticalAlignmentCheckbox;
190 wxChoice* m_verticalAlignmentComboBox;
191 wxFlexGridSizer* m_sizeSizer;
192 wxBoxSizer* m_widthSizer;
193 wxCheckBox* m_widthCheckbox;
194 wxStaticText* m_widthLabel;
195 wxTextCtrl* m_width;
196 wxComboBox* m_unitsW;
197 wxBoxSizer* m_heightSizer;
198 wxCheckBox* m_heightCheckbox;
199 wxStaticText* m_heightLabel;
200 wxTextCtrl* m_height;
201 wxComboBox* m_unitsH;
202 wxCheckBox* m_minWidthCheckbox;
203 wxBoxSizer* m_minWidthSizer;
204 wxTextCtrl* m_minWidth;
205 wxComboBox* m_unitsMinW;
206 wxCheckBox* m_minHeightCheckbox;
207 wxBoxSizer* m_minHeightSizer;
208 wxTextCtrl* m_minHeight;
209 wxComboBox* m_unitsMinH;
210 wxCheckBox* m_maxWidthCheckbox;
211 wxBoxSizer* m_maxWidthSizer;
212 wxTextCtrl* m_maxWidth;
213 wxComboBox* m_unitsMaxW;
214 wxCheckBox* m_maxHeightCheckbox;
215 wxBoxSizer* m_maxHeightSizer;
216 wxTextCtrl* m_maxHeight;
217 wxComboBox* m_unitsMaxH;
218 wxBoxSizer* m_positionControls;
219 wxBoxSizer* m_moveObjectParentSizer;
220 wxBoxSizer* m_positionModeSizer;
221 wxChoice* m_positionModeCtrl;
222 wxFlexGridSizer* m_positionGridSizer;
223 wxBoxSizer* m_leftSizer;
224 wxCheckBox* m_positionLeftCheckbox;
225 wxStaticText* m_leftLabel;
226 wxTextCtrl* m_left;
227 wxComboBox* m_unitsLeft;
228 wxBoxSizer* m_topSizer;
229 wxCheckBox* m_positionTopCheckbox;
230 wxStaticText* m_topLabel;
231 wxTextCtrl* m_top;
232 wxComboBox* m_unitsTop;
233 wxBoxSizer* m_rightSizer;
234 wxCheckBox* m_positionRightCheckbox;
235 wxStaticText* m_rightLabel;
236 wxBoxSizer* m_rightPositionSizer;
237 wxTextCtrl* m_right;
238 wxComboBox* m_unitsRight;
239 wxBoxSizer* m_bottomSizer;
240 wxCheckBox* m_positionBottomCheckbox;
241 wxStaticText* m_bottomLabel;
242 wxBoxSizer* m_bottomPositionSizer;
243 wxTextCtrl* m_bottom;
244 wxComboBox* m_unitsBottom;
245 wxBoxSizer* m_moveObjectSizer;
246 int m_positionMode;
247 /// Control identifiers
248 enum {
249 ID_WXRICHTEXTSIZEPAGE = 10700,
250 ID_RICHTEXT_FLOATING_MODE = 10701,
251 ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX = 10708,
252 ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX = 10709,
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,
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,
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,
284 ID_RICHTEXT_PARA_UP = 10713,
285 ID_RICHTEXT_PARA_DOWN = 10714
286 };
287 ////@end wxRichTextSizePage member variables
288
289 static bool sm_showFloatingControls;
290 static bool sm_showPositionControls;
291 static bool sm_showMinMaxSizeControls;
292 static bool sm_showPositionModeControls;
293 static bool sm_showRightBottomPositionControls;
294 static bool sm_showAlignmentControls;
295 static bool sm_showFloatingAndAlignmentControls;
296 static bool sm_enablePositionAndSizeUnits;
297 static bool sm_enablePositionAndSizeCheckboxes;
298 };
299
300 #endif
301 // _RICHTEXTSIZEPAGE_H_