]> git.saurik.com Git - wxWidgets.git/blob - include/wx/richtext/richtextsizepage.h
d35967755d9d4479fbcd72633f53b5755562dab8
[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 position mode controls
83 static void ShowPositionModeControls(bool show) { sm_showPositionModeControls = show; }
84
85 /// Show/hide right/bottom position controls
86 static void ShowRightBottomPositionControls(bool show) { sm_showRightBottomPositionControls = show; }
87
88 /// Show/hide floating and alignment controls
89 static void ShowFloatingAndAlignmentControls(bool show) { sm_showFloatingAndAlignmentControls = show; }
90
91 /// Show/hide floating controls
92 static void ShowFloatingControls(bool show) { sm_showFloatingControls = show; }
93
94 /// Show/hide alignment controls
95 static void ShowAlignmentControls(bool show) { sm_showAlignmentControls = show; }
96
97 ////@begin wxRichTextSizePage event handler declarations
98
99 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
100 void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event );
101
102 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
103 void OnRichtextWidthUpdate( wxUpdateUIEvent& event );
104
105 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
106 void OnRichtextHeightUpdate( wxUpdateUIEvent& event );
107
108 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
109 void OnRichtextMinWidthUpdate( wxUpdateUIEvent& event );
110
111 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
112 void OnRichtextMinHeightUpdate( wxUpdateUIEvent& event );
113
114 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
115 void OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event );
116
117 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
118 void OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event );
119
120 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
121 void OnRichtextLeftUpdate( wxUpdateUIEvent& event );
122
123 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
124 void OnRichtextTopUpdate( wxUpdateUIEvent& event );
125
126 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
127 void OnRichtextRightUpdate( wxUpdateUIEvent& event );
128
129 /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
130 void OnRichtextBottomUpdate( wxUpdateUIEvent& event );
131
132 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
133 void OnRichtextParaUpClick( wxCommandEvent& event );
134
135 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_DOWN
136 void OnRichtextParaDownClick( wxCommandEvent& event );
137
138 ////@end wxRichTextSizePage event handler declarations
139
140 ////@begin wxRichTextSizePage member function declarations
141
142 int GetPositionMode() const { return m_positionMode ; }
143 void SetPositionMode(int value) { m_positionMode = value ; }
144
145 /// Retrieves bitmap resources
146 wxBitmap GetBitmapResource( const wxString& name );
147
148 /// Retrieves icon resources
149 wxIcon GetIconResource( const wxString& name );
150 ////@end wxRichTextSizePage member function declarations
151
152 /// Should we show tooltips?
153 static bool ShowToolTips();
154
155 ////@begin wxRichTextSizePage member variables
156 wxBoxSizer* m_parentSizer;
157 wxBoxSizer* m_floatingAlignmentSizer;
158 wxBoxSizer* m_floatingSizer;
159 wxChoice* m_float;
160 wxBoxSizer* m_alignmentSizer;
161 wxCheckBox* m_verticalAlignmentCheckbox;
162 wxChoice* m_verticalAlignmentComboBox;
163 wxCheckBox* m_widthCheckbox;
164 wxTextCtrl* m_width;
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;
187 wxTextCtrl* m_left;
188 wxComboBox* m_unitsLeft;
189 wxCheckBox* m_positionTopCheckbox;
190 wxTextCtrl* m_top;
191 wxComboBox* m_unitsTop;
192 wxCheckBox* m_positionRightCheckbox;
193 wxBoxSizer* m_rightPositionSizer;
194 wxTextCtrl* m_right;
195 wxComboBox* m_unitsRight;
196 wxCheckBox* m_positionBottomCheckbox;
197 wxBoxSizer* m_bottomPositionSizer;
198 wxTextCtrl* m_bottom;
199 wxComboBox* m_unitsBottom;
200 wxBoxSizer* m_moveObjectSizer;
201 int m_positionMode;
202 /// Control identifiers
203 enum {
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
241 };
242 ////@end wxRichTextSizePage member variables
243
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;
250 };
251
252 #endif
253 // _RICHTEXTSIZEPAGE_H_