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"
28 * Forward declarations
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
46 * wxRichTextSizePage class declaration
49 class WXDLLIMPEXP_RICHTEXT wxRichTextSizePage
: public wxRichTextDialogPage
51 DECLARE_DYNAMIC_CLASS( wxRichTextSizePage
)
53 DECLARE_HELP_PROVISION()
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
);
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
);
64 ~wxRichTextSizePage();
66 /// Initialises member variables
69 /// Creates the controls and sizers
70 void CreateControls();
72 /// Gets the attributes from the formatting dialog
73 wxRichTextAttr
* GetAttributes();
76 virtual bool TransferDataToWindow();
77 virtual bool TransferDataFromWindow();
79 /// Show/hide position controls
80 static void ShowPositionControls(bool show
) { sm_showPositionControls
= show
; }
82 /// Show/hide minimum and maximum size controls
83 static void ShowMinMaxSizeControls(bool show
) { sm_showMinMaxSizeControls
= show
; }
85 /// Show/hide position mode controls
86 static void ShowPositionModeControls(bool show
) { sm_showPositionModeControls
= show
; }
88 /// Show/hide right/bottom position controls
89 static void ShowRightBottomPositionControls(bool show
) { sm_showRightBottomPositionControls
= show
; }
91 /// Show/hide floating and alignment controls
92 static void ShowFloatingAndAlignmentControls(bool show
) { sm_showFloatingAndAlignmentControls
= show
; }
94 /// Show/hide floating controls
95 static void ShowFloatingControls(bool show
) { sm_showFloatingControls
= show
; }
97 /// Show/hide alignment controls
98 static void ShowAlignmentControls(bool show
) { sm_showAlignmentControls
= show
; }
100 /// Enable the position and size units
101 static void EnablePositionAndSizeUnits(bool enable
) { sm_enablePositionAndSizeUnits
= enable
; }
103 /// Enable the checkboxes for position and size
104 static void EnablePositionAndSizeCheckboxes(bool enable
) { sm_enablePositionAndSizeCheckboxes
= enable
; }
106 ////@begin wxRichTextSizePage event handler declarations
108 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
109 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent
& event
);
111 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
112 void OnRichtextWidthUpdate( wxUpdateUIEvent
& event
);
114 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_W
115 void OnRichtextWidthUnitsUpdate( wxUpdateUIEvent
& event
);
117 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
118 void OnRichtextHeightUpdate( wxUpdateUIEvent
& event
);
120 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_UNITS_H
121 void OnRichtextHeightUnitsUpdate( wxUpdateUIEvent
& event
);
123 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
124 void OnRichtextMinWidthUpdate( wxUpdateUIEvent
& event
);
126 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
127 void OnRichtextMinHeightUpdate( wxUpdateUIEvent
& event
);
129 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
130 void OnRichtextMaxWidthUpdate( wxUpdateUIEvent
& event
);
132 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
133 void OnRichtextMaxHeightUpdate( wxUpdateUIEvent
& event
);
135 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
136 void OnRichtextLeftUpdate( wxUpdateUIEvent
& event
);
138 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
139 void OnRichtextLeftUnitsUpdate( wxUpdateUIEvent
& event
);
141 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP
142 void OnRichtextTopUpdate( wxUpdateUIEvent
& event
);
144 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS
145 void OnRichtextTopUnitsUpdate( wxUpdateUIEvent
& event
);
147 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
148 void OnRichtextRightUpdate( wxUpdateUIEvent
& event
);
150 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS
151 void OnRichtextRightUnitsUpdate( wxUpdateUIEvent
& event
);
153 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
154 void OnRichtextBottomUpdate( wxUpdateUIEvent
& event
);
156 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS
157 void OnRichtextBottomUnitsUpdate( wxUpdateUIEvent
& event
);
159 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
160 void OnRichtextParaUpClick( wxCommandEvent
& event
);
162 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
163 void OnRichtextParaDownClick( wxCommandEvent
& event
);
165 ////@end wxRichTextSizePage event handler declarations
167 ////@begin wxRichTextSizePage member function declarations
169 int GetPositionMode() const { return m_positionMode
; }
170 void SetPositionMode(int value
) { m_positionMode
= value
; }
172 /// Retrieves bitmap resources
173 wxBitmap
GetBitmapResource( const wxString
& name
);
175 /// Retrieves icon resources
176 wxIcon
GetIconResource( const wxString
& name
);
177 ////@end wxRichTextSizePage member function declarations
179 /// Should we show tooltips?
180 static bool ShowToolTips();
182 ////@begin wxRichTextSizePage member variables
183 wxBoxSizer
* m_parentSizer
;
184 wxBoxSizer
* m_floatingAlignmentSizer
;
185 wxBoxSizer
* m_floatingSizer
;
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
;
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
;
226 wxComboBox
* m_unitsLeft
;
227 wxBoxSizer
* m_topSizer
;
228 wxCheckBox
* m_positionTopCheckbox
;
229 wxStaticText
* m_topLabel
;
231 wxComboBox
* m_unitsTop
;
232 wxBoxSizer
* m_rightSizer
;
233 wxCheckBox
* m_positionRightCheckbox
;
234 wxStaticText
* m_rightLabel
;
235 wxBoxSizer
* m_rightPositionSizer
;
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
;
246 /// Control identifiers
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
286 ////@end wxRichTextSizePage member variables
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
;
300 // _RICHTEXTSIZEPAGE_H_