1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/richtext/richtextsizepage.h
4 // Author: Julian Smart
6 // Created: 20/10/2010 10:23:24
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _RICHTEXTSIZEPAGE_H_
13 #define _RICHTEXTSIZEPAGE_H_
19 #include "wx/richtext/richtextdialogpage.h"
23 #include "wx/statline.h"
24 #include "wx/valgen.h"
26 #include "wx/stattext.h"
29 * Forward declarations
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
47 * wxRichTextSizePage class declaration
50 class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage
: public wxRichTextDialogPage
52 DECLARE_DYNAMIC_CLASS( wxRichTextSizePage
)
54 DECLARE_HELP_PROVISION()
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
);
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
);
65 ~wxRichTextSizePage();
67 /// Initialises member variables
70 /// Creates the controls and sizers
71 void CreateControls();
73 /// Gets the attributes from the formatting dialog
74 wxRichTextAttr
* GetAttributes();
77 virtual bool TransferDataToWindow();
78 virtual bool TransferDataFromWindow();
80 /// Show/hide position controls
81 static void ShowPositionControls(bool show
) { sm_showPositionControls
= show
; }
83 /// Show/hide minimum and maximum size controls
84 static void ShowMinMaxSizeControls(bool show
) { sm_showMinMaxSizeControls
= show
; }
86 /// Show/hide position mode controls
87 static void ShowPositionModeControls(bool show
) { sm_showPositionModeControls
= show
; }
89 /// Show/hide right/bottom position controls
90 static void ShowRightBottomPositionControls(bool show
) { sm_showRightBottomPositionControls
= show
; }
92 /// Show/hide floating and alignment controls
93 static void ShowFloatingAndAlignmentControls(bool show
) { sm_showFloatingAndAlignmentControls
= show
; }
95 /// Show/hide floating controls
96 static void ShowFloatingControls(bool show
) { sm_showFloatingControls
= show
; }
98 /// Show/hide alignment controls
99 static void ShowAlignmentControls(bool show
) { sm_showAlignmentControls
= show
; }
101 /// Enable the position and size units
102 static void EnablePositionAndSizeUnits(bool enable
) { sm_enablePositionAndSizeUnits
= enable
; }
104 /// Enable the checkboxes for position and size
105 static void EnablePositionAndSizeCheckboxes(bool enable
) { sm_enablePositionAndSizeCheckboxes
= enable
; }
107 ////@begin wxRichTextSizePage event handler declarations
109 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
110 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent
& event
);
112 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
113 void OnRichtextWidthUpdate( wxUpdateUIEvent
& event
);
115 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_W
116 void OnRichtextWidthUnitsUpdate( wxUpdateUIEvent
& event
);
118 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
119 void OnRichtextHeightUpdate( wxUpdateUIEvent
& event
);
121 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_H
122 void OnRichtextHeightUnitsUpdate( wxUpdateUIEvent
& event
);
124 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
125 void OnRichtextMinWidthUpdate( wxUpdateUIEvent
& event
);
127 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
128 void OnRichtextMinHeightUpdate( wxUpdateUIEvent
& event
);
130 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
131 void OnRichtextMaxWidthUpdate( wxUpdateUIEvent
& event
);
133 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
134 void OnRichtextMaxHeightUpdate( wxUpdateUIEvent
& event
);
136 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
137 void OnRichtextLeftUpdate( wxUpdateUIEvent
& event
);
139 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
140 void OnRichtextLeftUnitsUpdate( wxUpdateUIEvent
& event
);
142 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP
143 void OnRichtextTopUpdate( wxUpdateUIEvent
& event
);
145 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS
146 void OnRichtextTopUnitsUpdate( wxUpdateUIEvent
& event
);
148 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
149 void OnRichtextRightUpdate( wxUpdateUIEvent
& event
);
151 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS
152 void OnRichtextRightUnitsUpdate( wxUpdateUIEvent
& event
);
154 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
155 void OnRichtextBottomUpdate( wxUpdateUIEvent
& event
);
157 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS
158 void OnRichtextBottomUnitsUpdate( wxUpdateUIEvent
& event
);
160 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
161 void OnRichtextParaUpClick( wxCommandEvent
& event
);
163 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
164 void OnRichtextParaDownClick( wxCommandEvent
& event
);
166 ////@end wxRichTextSizePage event handler declarations
168 ////@begin wxRichTextSizePage member function declarations
170 int GetPositionMode() const { return m_positionMode
; }
171 void SetPositionMode(int value
) { m_positionMode
= value
; }
173 /// Retrieves bitmap resources
174 wxBitmap
GetBitmapResource( const wxString
& name
);
176 /// Retrieves icon resources
177 wxIcon
GetIconResource( const wxString
& name
);
178 ////@end wxRichTextSizePage member function declarations
180 /// Should we show tooltips?
181 static bool ShowToolTips();
183 ////@begin wxRichTextSizePage member variables
184 wxBoxSizer
* m_parentSizer
;
185 wxBoxSizer
* m_floatingAlignmentSizer
;
186 wxBoxSizer
* m_floatingSizer
;
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
;
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
;
227 wxComboBox
* m_unitsLeft
;
228 wxBoxSizer
* m_topSizer
;
229 wxCheckBox
* m_positionTopCheckbox
;
230 wxStaticText
* m_topLabel
;
232 wxComboBox
* m_unitsTop
;
233 wxBoxSizer
* m_rightSizer
;
234 wxCheckBox
* m_positionRightCheckbox
;
235 wxStaticText
* m_rightLabel
;
236 wxBoxSizer
* m_rightPositionSizer
;
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
;
247 /// Control identifiers
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
287 ////@end wxRichTextSizePage member variables
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
;
301 // _RICHTEXTSIZEPAGE_H_