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 position mode controls
83 static void ShowPositionModeControls(bool show
) { sm_showPositionModeControls
= show
; }
85 /// Show/hide right/bottom position controls
86 static void ShowRightBottomPositionControls(bool show
) { sm_showRightBottomPositionControls
= show
; }
88 /// Show/hide floating and alignment controls
89 static void ShowFloatingAndAlignmentControls(bool show
) { sm_showFloatingAndAlignmentControls
= show
; }
91 /// Show/hide floating controls
92 static void ShowFloatingControls(bool show
) { sm_showFloatingControls
= show
; }
94 /// Show/hide alignment controls
95 static void ShowAlignmentControls(bool show
) { sm_showAlignmentControls
= show
; }
97 ////@begin wxRichTextSizePage event handler declarations
99 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
100 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent
& event
);
102 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
103 void OnRichtextWidthUpdate( wxUpdateUIEvent
& event
);
105 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
106 void OnRichtextHeightUpdate( wxUpdateUIEvent
& event
);
108 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
109 void OnRichtextMinWidthUpdate( wxUpdateUIEvent
& event
);
111 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
112 void OnRichtextMinHeightUpdate( wxUpdateUIEvent
& event
);
114 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
115 void OnRichtextMaxWidthUpdate( wxUpdateUIEvent
& event
);
117 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
118 void OnRichtextMaxHeightUpdate( wxUpdateUIEvent
& event
);
120 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
121 void OnRichtextLeftUpdate( wxUpdateUIEvent
& event
);
123 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
124 void OnRichtextTopUpdate( wxUpdateUIEvent
& event
);
126 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
127 void OnRichtextRightUpdate( wxUpdateUIEvent
& event
);
129 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
130 void OnRichtextBottomUpdate( wxUpdateUIEvent
& event
);
132 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
133 void OnRichtextParaUpClick( wxCommandEvent
& event
);
135 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
136 void OnRichtextParaDownClick( wxCommandEvent
& event
);
138 ////@end wxRichTextSizePage event handler declarations
140 ////@begin wxRichTextSizePage member function declarations
142 int GetPositionMode() const { return m_positionMode
; }
143 void SetPositionMode(int value
) { m_positionMode
= value
; }
145 /// Retrieves bitmap resources
146 wxBitmap
GetBitmapResource( const wxString
& name
);
148 /// Retrieves icon resources
149 wxIcon
GetIconResource( const wxString
& name
);
150 ////@end wxRichTextSizePage member function declarations
152 /// Should we show tooltips?
153 static bool ShowToolTips();
155 ////@begin wxRichTextSizePage member variables
156 wxBoxSizer
* m_parentSizer
;
157 wxBoxSizer
* m_floatingAlignmentSizer
;
158 wxBoxSizer
* m_floatingSizer
;
160 wxBoxSizer
* m_alignmentSizer
;
161 wxCheckBox
* m_verticalAlignmentCheckbox
;
162 wxChoice
* m_verticalAlignmentComboBox
;
163 wxCheckBox
* m_widthCheckbox
;
165 wxComboBox
* m_unitsW
;
166 wxCheckBox
* m_heightCheckbox
;
167 wxTextCtrl
* m_height
;
168 wxComboBox
* m_unitsH
;
169 wxCheckBox
* m_minWidthCheckbox
;
170 wxTextCtrl
* m_minWidth
;
171 wxComboBox
* m_unitsMinW
;
172 wxCheckBox
* m_minHeightCheckbox
;
173 wxTextCtrl
* m_minHeight
;
174 wxComboBox
* m_unitsMinH
;
175 wxCheckBox
* m_maxWidthCheckbox
;
176 wxTextCtrl
* m_maxWidth
;
177 wxComboBox
* m_unitsMaxW
;
178 wxCheckBox
* m_maxHeightCheckbox
;
179 wxTextCtrl
* m_maxHeight
;
180 wxComboBox
* m_unitsMaxH
;
181 wxBoxSizer
* m_positionControls
;
182 wxBoxSizer
* m_moveObjectParentSizer
;
183 wxBoxSizer
* m_positionModeSizer
;
184 wxComboBox
* m_positionModeCtrl
;
185 wxFlexGridSizer
* m_positionGridSizer
;
186 wxCheckBox
* m_positionLeftCheckbox
;
188 wxComboBox
* m_unitsLeft
;
189 wxCheckBox
* m_positionTopCheckbox
;
191 wxComboBox
* m_unitsTop
;
192 wxCheckBox
* m_positionRightCheckbox
;
193 wxBoxSizer
* m_rightPositionSizer
;
195 wxComboBox
* m_unitsRight
;
196 wxCheckBox
* m_positionBottomCheckbox
;
197 wxBoxSizer
* m_bottomPositionSizer
;
198 wxTextCtrl
* m_bottom
;
199 wxComboBox
* m_unitsBottom
;
200 wxBoxSizer
* m_moveObjectSizer
;
202 /// Control identifiers
204 ID_WXRICHTEXTSIZEPAGE
= 10700,
205 ID_RICHTEXT_FLOATING_MODE
= 10701,
206 ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX
= 10708,
207 ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
= 10709,
208 ID_RICHTEXT_WIDTH_CHECKBOX
= 10702,
209 ID_RICHTEXT_WIDTH
= 10703,
210 ID_RICHTEXT_UNITS_W
= 10704,
211 ID_RICHTEXT_HEIGHT_CHECKBOX
= 10705,
212 ID_RICHTEXT_HEIGHT
= 10706,
213 ID_RICHTEXT_UNITS_H
= 10707,
214 ID_RICHTEXT_MIN_WIDTH_CHECKBOX
= 10715,
215 ID_RICHTEXT_MIN_WIDTH
= 10716,
216 ID_RICHTEXT_UNITS_MIN_W
= 10717,
217 ID_RICHTEXT_MIN_HEIGHT_CHECKBOX
= 10718,
218 ID_RICHTEXT_MIN_HEIGHT
= 10719,
219 ID_RICHTEXT_UNITS_MIN_H
= 10720,
220 ID_RICHTEXT_MAX_WIDTH_CHECKBOX
= 10721,
221 ID_RICHTEXT_MAX_WIDTH
= 10722,
222 ID_RICHTEXT_UNITS_MAX_W
= 10723,
223 ID_RICHTEXT_MAX_HEIGHT_CHECKBOX
= 10724,
224 ID_RICHTEXT_MAX_HEIGHT
= 10725,
225 ID_RICHTEXT_UNITS_MAX_H
= 10726,
226 ID_RICHTEXT_POSITION_MODE
= 10735,
227 ID_RICHTEXT_LEFT_CHECKBOX
= 10710,
228 ID_RICHTEXT_LEFT
= 10711,
229 ID_RICHTEXT_LEFT_UNITS
= 10712,
230 ID_RICHTEXT_TOP_CHECKBOX
= 10710,
231 ID_RICHTEXT_TOP
= 10728,
232 ID_RICHTEXT_TOP_UNITS
= 10729,
233 ID_RICHTEXT_RIGHT_CHECKBOX
= 10727,
234 ID_RICHTEXT_RIGHT
= 10730,
235 ID_RICHTEXT_RIGHT_UNITS
= 10731,
236 ID_RICHTEXT_BOTTOM_CHECKBOX
= 10732,
237 ID_RICHTEXT_BOTTOM
= 10733,
238 ID_RICHTEXT_BOTTOM_UNITS
= 10734,
239 ID_RICHTEXT_PARA_UP
= 10713,
240 ID_RICHTEXT_PARA_DOWN
= 10714
242 ////@end wxRichTextSizePage member variables
244 static bool sm_showFloatingControls
;
245 static bool sm_showPositionControls
;
246 static bool sm_showPositionModeControls
;
247 static bool sm_showRightBottomPositionControls
;
248 static bool sm_showAlignmentControls
;
249 static bool sm_showFloatingAndAlignmentControls
;
253 // _RICHTEXTSIZEPAGE_H_