]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: src/richtext/richtextsizepage.cpp | |
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 | #include "wx/richtext/richtextsizepage.h" | |
13 | ||
14 | ////@begin XPM images | |
15 | ////@end XPM images | |
16 | ||
17 | ||
18 | /*! | |
19 | * wxRichTextSizePage type definition | |
20 | */ | |
21 | ||
22 | IMPLEMENT_DYNAMIC_CLASS( wxRichTextSizePage, wxRichTextDialogPage ) | |
23 | ||
24 | ||
25 | /*! | |
26 | * wxRichTextSizePage event table definition | |
27 | */ | |
28 | ||
29 | BEGIN_EVENT_TABLE( wxRichTextSizePage, wxRichTextDialogPage ) | |
30 | ||
31 | ////@begin wxRichTextSizePage event table entries | |
32 | EVT_UPDATE_UI( ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX, wxRichTextSizePage::OnRichtextVerticalAlignmentComboboxUpdate ) | |
33 | EVT_UPDATE_UI( ID_RICHTEXT_WIDTH, wxRichTextSizePage::OnRichtextWidthUpdate ) | |
34 | EVT_UPDATE_UI( ID_RICHTEXT_UNITS_W, wxRichTextSizePage::OnRichtextWidthUnitsUpdate ) | |
35 | EVT_UPDATE_UI( ID_RICHTEXT_HEIGHT, wxRichTextSizePage::OnRichtextHeightUpdate ) | |
36 | EVT_UPDATE_UI( ID_RICHTEXT_UNITS_H, wxRichTextSizePage::OnRichtextHeightUnitsUpdate ) | |
37 | EVT_UPDATE_UI( ID_RICHTEXT_MIN_WIDTH, wxRichTextSizePage::OnRichtextMinWidthUpdate ) | |
38 | EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MIN_W, wxRichTextSizePage::OnRichtextMinWidthUpdate ) | |
39 | EVT_UPDATE_UI( ID_RICHTEXT_MIN_HEIGHT, wxRichTextSizePage::OnRichtextMinHeightUpdate ) | |
40 | EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MIN_H, wxRichTextSizePage::OnRichtextMinHeightUpdate ) | |
41 | EVT_UPDATE_UI( ID_RICHTEXT_MAX_WIDTH, wxRichTextSizePage::OnRichtextMaxWidthUpdate ) | |
42 | EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MAX_W, wxRichTextSizePage::OnRichtextMaxWidthUpdate ) | |
43 | EVT_UPDATE_UI( ID_RICHTEXT_MAX_HEIGHT, wxRichTextSizePage::OnRichtextMaxHeightUpdate ) | |
44 | EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MAX_H, wxRichTextSizePage::OnRichtextMaxHeightUpdate ) | |
45 | EVT_UPDATE_UI( ID_RICHTEXT_LEFT, wxRichTextSizePage::OnRichtextLeftUpdate ) | |
46 | EVT_UPDATE_UI( ID_RICHTEXT_LEFT_UNITS, wxRichTextSizePage::OnRichtextLeftUnitsUpdate ) | |
47 | EVT_UPDATE_UI( ID_RICHTEXT_TOP, wxRichTextSizePage::OnRichtextTopUpdate ) | |
48 | EVT_UPDATE_UI( ID_RICHTEXT_TOP_UNITS, wxRichTextSizePage::OnRichtextTopUnitsUpdate ) | |
49 | EVT_UPDATE_UI( ID_RICHTEXT_RIGHT, wxRichTextSizePage::OnRichtextRightUpdate ) | |
50 | EVT_UPDATE_UI( ID_RICHTEXT_RIGHT_UNITS, wxRichTextSizePage::OnRichtextRightUnitsUpdate ) | |
51 | EVT_UPDATE_UI( ID_RICHTEXT_BOTTOM, wxRichTextSizePage::OnRichtextBottomUpdate ) | |
52 | EVT_UPDATE_UI( ID_RICHTEXT_BOTTOM_UNITS, wxRichTextSizePage::OnRichtextBottomUnitsUpdate ) | |
53 | EVT_BUTTON( ID_RICHTEXT_PARA_UP, wxRichTextSizePage::OnRichtextParaUpClick ) | |
54 | EVT_BUTTON( ID_RICHTEXT_PARA_DOWN, wxRichTextSizePage::OnRichtextParaDownClick ) | |
55 | ////@end wxRichTextSizePage event table entries | |
56 | ||
57 | END_EVENT_TABLE() | |
58 | ||
59 | IMPLEMENT_HELP_PROVISION(wxRichTextSizePage) | |
60 | ||
61 | bool wxRichTextSizePage::sm_showFloatingControls = true; | |
62 | bool wxRichTextSizePage::sm_showMinMaxSizeControls = true; | |
63 | bool wxRichTextSizePage::sm_showPositionControls = true; | |
64 | bool wxRichTextSizePage::sm_showPositionModeControls = true; | |
65 | bool wxRichTextSizePage::sm_showRightBottomPositionControls = true; | |
66 | bool wxRichTextSizePage::sm_showAlignmentControls = true; | |
67 | bool wxRichTextSizePage::sm_showFloatingAndAlignmentControls = true; | |
68 | bool wxRichTextSizePage::sm_enablePositionAndSizeUnits = true; | |
69 | bool wxRichTextSizePage::sm_enablePositionAndSizeCheckboxes = true; | |
70 | ||
71 | /*! | |
72 | * wxRichTextSizePage constructors | |
73 | */ | |
74 | ||
75 | wxRichTextSizePage::wxRichTextSizePage() | |
76 | { | |
77 | Init(); | |
78 | } | |
79 | ||
80 | wxRichTextSizePage::wxRichTextSizePage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) | |
81 | { | |
82 | Init(); | |
83 | Create(parent, id, pos, size, style); | |
84 | } | |
85 | ||
86 | ||
87 | /*! | |
88 | * wxRichTextSizePage creator | |
89 | */ | |
90 | ||
91 | bool wxRichTextSizePage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) | |
92 | { | |
93 | ////@begin wxRichTextSizePage creation | |
94 | wxRichTextDialogPage::Create( parent, id, pos, size, style ); | |
95 | ||
96 | CreateControls(); | |
97 | if (GetSizer()) | |
98 | { | |
99 | GetSizer()->SetSizeHints(this); | |
100 | } | |
101 | Centre(); | |
102 | ////@end wxRichTextSizePage creation | |
103 | return true; | |
104 | } | |
105 | ||
106 | ||
107 | /*! | |
108 | * wxRichTextSizePage destructor | |
109 | */ | |
110 | ||
111 | wxRichTextSizePage::~wxRichTextSizePage() | |
112 | { | |
113 | sm_showFloatingControls = true; | |
114 | sm_showPositionControls = true; | |
115 | sm_showPositionModeControls = true; | |
116 | sm_showRightBottomPositionControls = true; | |
117 | sm_showAlignmentControls = true; | |
118 | sm_showFloatingAndAlignmentControls = true; | |
119 | sm_showMinMaxSizeControls = true; | |
120 | sm_showMinMaxSizeControls = true; | |
121 | sm_enablePositionAndSizeCheckboxes = true; | |
122 | ||
123 | ////@begin wxRichTextSizePage destruction | |
124 | ////@end wxRichTextSizePage destruction | |
125 | } | |
126 | ||
127 | ||
128 | /*! | |
129 | * Member initialisation | |
130 | */ | |
131 | ||
132 | void wxRichTextSizePage::Init() | |
133 | { | |
134 | ////@begin wxRichTextSizePage member initialisation | |
135 | m_positionMode = 0; | |
136 | m_parentSizer = NULL; | |
137 | m_floatingAlignmentSizer = NULL; | |
138 | m_floatingSizer = NULL; | |
139 | m_float = NULL; | |
140 | m_alignmentSizer = NULL; | |
141 | m_verticalAlignmentCheckbox = NULL; | |
142 | m_verticalAlignmentComboBox = NULL; | |
143 | m_sizeSizer = NULL; | |
144 | m_widthSizer = NULL; | |
145 | m_widthCheckbox = NULL; | |
146 | m_widthLabel = NULL; | |
147 | m_width = NULL; | |
148 | m_unitsW = NULL; | |
149 | m_heightSizer = NULL; | |
150 | m_heightCheckbox = NULL; | |
151 | m_heightLabel = NULL; | |
152 | m_height = NULL; | |
153 | m_unitsH = NULL; | |
154 | m_minWidthCheckbox = NULL; | |
155 | m_minWidthSizer = NULL; | |
156 | m_minWidth = NULL; | |
157 | m_unitsMinW = NULL; | |
158 | m_minHeightCheckbox = NULL; | |
159 | m_minHeightSizer = NULL; | |
160 | m_minHeight = NULL; | |
161 | m_unitsMinH = NULL; | |
162 | m_maxWidthCheckbox = NULL; | |
163 | m_maxWidthSizer = NULL; | |
164 | m_maxWidth = NULL; | |
165 | m_unitsMaxW = NULL; | |
166 | m_maxHeightCheckbox = NULL; | |
167 | m_maxHeightSizer = NULL; | |
168 | m_maxHeight = NULL; | |
169 | m_unitsMaxH = NULL; | |
170 | m_positionControls = NULL; | |
171 | m_moveObjectParentSizer = NULL; | |
172 | m_positionModeSizer = NULL; | |
173 | m_positionModeCtrl = NULL; | |
174 | m_positionGridSizer = NULL; | |
175 | m_leftSizer = NULL; | |
176 | m_positionLeftCheckbox = NULL; | |
177 | m_leftLabel = NULL; | |
178 | m_left = NULL; | |
179 | m_unitsLeft = NULL; | |
180 | m_topSizer = NULL; | |
181 | m_positionTopCheckbox = NULL; | |
182 | m_topLabel = NULL; | |
183 | m_top = NULL; | |
184 | m_unitsTop = NULL; | |
185 | m_rightSizer = NULL; | |
186 | m_positionRightCheckbox = NULL; | |
187 | m_rightLabel = NULL; | |
188 | m_rightPositionSizer = NULL; | |
189 | m_right = NULL; | |
190 | m_unitsRight = NULL; | |
191 | m_bottomSizer = NULL; | |
192 | m_positionBottomCheckbox = NULL; | |
193 | m_bottomLabel = NULL; | |
194 | m_bottomPositionSizer = NULL; | |
195 | m_bottom = NULL; | |
196 | m_unitsBottom = NULL; | |
197 | m_moveObjectSizer = NULL; | |
198 | ////@end wxRichTextSizePage member initialisation | |
199 | } | |
200 | ||
201 | ||
202 | /*! | |
203 | * Control creation for wxRichTextSizePage | |
204 | */ | |
205 | ||
206 | void wxRichTextSizePage::CreateControls() | |
207 | { | |
208 | ////@begin wxRichTextSizePage content construction | |
209 | wxRichTextSizePage* itemRichTextDialogPage1 = this; | |
210 | ||
211 | wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); | |
212 | itemRichTextDialogPage1->SetSizer(itemBoxSizer2); | |
213 | ||
214 | m_parentSizer = new wxBoxSizer(wxVERTICAL); | |
215 | itemBoxSizer2->Add(m_parentSizer, 0, wxGROW|wxALL, 5); | |
216 | ||
217 | m_floatingAlignmentSizer = new wxBoxSizer(wxHORIZONTAL); | |
218 | m_parentSizer->Add(m_floatingAlignmentSizer, 0, wxGROW, 5); | |
219 | ||
220 | m_floatingSizer = new wxBoxSizer(wxHORIZONTAL); | |
221 | m_floatingAlignmentSizer->Add(m_floatingSizer, 1, wxALIGN_CENTER_VERTICAL, 5); | |
222 | ||
223 | wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); | |
224 | m_floatingSizer->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL, 5); | |
225 | ||
226 | wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL); | |
227 | itemBoxSizer6->Add(itemBoxSizer7, 0, wxGROW, 5); | |
228 | ||
229 | wxStaticText* itemStaticText8 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Floating"), wxDefaultPosition, wxDefaultSize, 0 ); | |
230 | itemStaticText8->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); | |
231 | itemBoxSizer7->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
232 | ||
233 | wxStaticLine* itemStaticLine9 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); | |
234 | itemBoxSizer7->Add(itemStaticLine9, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
235 | ||
236 | wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL); | |
237 | itemBoxSizer6->Add(itemBoxSizer10, 0, wxGROW, 5); | |
238 | ||
239 | itemBoxSizer10->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
240 | ||
241 | wxFlexGridSizer* itemFlexGridSizer12 = new wxFlexGridSizer(0, 2, 0, 0); | |
242 | itemBoxSizer10->Add(itemFlexGridSizer12, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5); | |
243 | ||
244 | wxStaticText* itemStaticText13 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Floating mode:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
245 | itemFlexGridSizer12->Add(itemStaticText13, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
246 | ||
247 | wxArrayString m_floatStrings; | |
248 | m_floatStrings.Add(_("None")); | |
249 | m_floatStrings.Add(_("Left")); | |
250 | m_floatStrings.Add(_("Right")); | |
251 | m_float = new wxChoice( itemRichTextDialogPage1, ID_RICHTEXT_FLOATING_MODE, wxDefaultPosition, wxSize(80, -1), m_floatStrings, 0 ); | |
252 | m_float->SetStringSelection(_("None")); | |
253 | m_float->SetHelpText(_("How the object will float relative to the text.")); | |
254 | if (wxRichTextSizePage::ShowToolTips()) | |
255 | m_float->SetToolTip(_("How the object will float relative to the text.")); | |
256 | itemFlexGridSizer12->Add(m_float, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
257 | ||
258 | m_floatingSizer->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL, 5); | |
259 | ||
260 | m_alignmentSizer = new wxBoxSizer(wxVERTICAL); | |
261 | m_floatingAlignmentSizer->Add(m_alignmentSizer, 0, wxALIGN_CENTER_VERTICAL, 5); | |
262 | ||
263 | wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxHORIZONTAL); | |
264 | m_alignmentSizer->Add(itemBoxSizer17, 0, wxGROW, 5); | |
265 | ||
266 | wxStaticText* itemStaticText18 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Alignment"), wxDefaultPosition, wxDefaultSize, 0 ); | |
267 | itemStaticText18->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); | |
268 | itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
269 | ||
270 | wxStaticLine* itemStaticLine19 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); | |
271 | itemBoxSizer17->Add(itemStaticLine19, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
272 | ||
273 | wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); | |
274 | m_alignmentSizer->Add(itemBoxSizer20, 0, wxGROW, 5); | |
275 | ||
276 | itemBoxSizer20->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
277 | ||
278 | m_verticalAlignmentCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX, _("&Vertical alignment:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
279 | m_verticalAlignmentCheckbox->SetValue(false); | |
280 | m_verticalAlignmentCheckbox->SetHelpText(_("Enable vertical alignment.")); | |
281 | if (wxRichTextSizePage::ShowToolTips()) | |
282 | m_verticalAlignmentCheckbox->SetToolTip(_("Enable vertical alignment.")); | |
283 | itemBoxSizer20->Add(m_verticalAlignmentCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
284 | ||
285 | wxArrayString m_verticalAlignmentComboBoxStrings; | |
286 | m_verticalAlignmentComboBoxStrings.Add(_("Top")); | |
287 | m_verticalAlignmentComboBoxStrings.Add(_("Centred")); | |
288 | m_verticalAlignmentComboBoxStrings.Add(_("Bottom")); | |
289 | m_verticalAlignmentComboBox = new wxChoice( itemRichTextDialogPage1, ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX, wxDefaultPosition, wxDefaultSize, m_verticalAlignmentComboBoxStrings, 0 ); | |
290 | m_verticalAlignmentComboBox->SetStringSelection(_("Top")); | |
291 | m_verticalAlignmentComboBox->SetHelpText(_("Vertical alignment.")); | |
292 | if (wxRichTextSizePage::ShowToolTips()) | |
293 | m_verticalAlignmentComboBox->SetToolTip(_("Vertical alignment.")); | |
294 | itemBoxSizer20->Add(m_verticalAlignmentComboBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
295 | ||
296 | wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); | |
297 | m_parentSizer->Add(itemBoxSizer24, 0, wxGROW, 5); | |
298 | ||
299 | wxStaticText* itemStaticText25 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Size"), wxDefaultPosition, wxDefaultSize, 0 ); | |
300 | itemStaticText25->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); | |
301 | itemBoxSizer24->Add(itemStaticText25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
302 | ||
303 | wxStaticLine* itemStaticLine26 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); | |
304 | itemBoxSizer24->Add(itemStaticLine26, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
305 | ||
306 | wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); | |
307 | m_parentSizer->Add(itemBoxSizer27, 0, wxGROW, 5); | |
308 | ||
309 | itemBoxSizer27->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
310 | ||
311 | m_sizeSizer = new wxFlexGridSizer(0, 4, 0, 0); | |
312 | itemBoxSizer27->Add(m_sizeSizer, 0, wxALIGN_CENTER_VERTICAL, 5); | |
313 | ||
314 | m_widthSizer = new wxBoxSizer(wxHORIZONTAL); | |
315 | m_sizeSizer->Add(m_widthSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
316 | ||
317 | m_widthCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_WIDTH_CHECKBOX, _("&Width:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
318 | m_widthCheckbox->SetValue(false); | |
319 | m_widthCheckbox->SetHelpText(_("Enable the width value.")); | |
320 | if (wxRichTextSizePage::ShowToolTips()) | |
321 | m_widthCheckbox->SetToolTip(_("Enable the width value.")); | |
322 | m_widthSizer->Add(m_widthCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
323 | ||
324 | m_widthLabel = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Width:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
325 | m_widthLabel->Show(false); | |
326 | m_widthSizer->Add(m_widthLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
327 | ||
328 | wxBoxSizer* itemBoxSizer33 = new wxBoxSizer(wxHORIZONTAL); | |
329 | m_sizeSizer->Add(itemBoxSizer33, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
330 | ||
331 | m_width = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); | |
332 | m_width->SetHelpText(_("The object width.")); | |
333 | if (wxRichTextSizePage::ShowToolTips()) | |
334 | m_width->SetToolTip(_("The object width.")); | |
335 | itemBoxSizer33->Add(m_width, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
336 | ||
337 | wxArrayString m_unitsWStrings; | |
338 | m_unitsWStrings.Add(_("px")); | |
339 | m_unitsWStrings.Add(_("cm")); | |
340 | m_unitsWStrings.Add(_("percent")); | |
341 | m_unitsW = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_W, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsWStrings, wxCB_READONLY ); | |
342 | m_unitsW->SetStringSelection(_("px")); | |
343 | m_unitsW->SetHelpText(_("Units for the object width.")); | |
344 | if (wxRichTextSizePage::ShowToolTips()) | |
345 | m_unitsW->SetToolTip(_("Units for the object width.")); | |
346 | itemBoxSizer33->Add(m_unitsW, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
347 | ||
348 | m_heightSizer = new wxBoxSizer(wxHORIZONTAL); | |
349 | m_sizeSizer->Add(m_heightSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
350 | ||
351 | m_heightCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_HEIGHT_CHECKBOX, _("&Height:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
352 | m_heightCheckbox->SetValue(false); | |
353 | m_heightCheckbox->SetHelpText(_("Enable the height value.")); | |
354 | if (wxRichTextSizePage::ShowToolTips()) | |
355 | m_heightCheckbox->SetToolTip(_("Enable the height value.")); | |
356 | m_heightSizer->Add(m_heightCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
357 | ||
358 | m_heightLabel = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Height:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
359 | m_heightLabel->Show(false); | |
360 | m_heightSizer->Add(m_heightLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
361 | ||
362 | wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL); | |
363 | m_sizeSizer->Add(itemBoxSizer39, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
364 | ||
365 | m_height = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); | |
366 | m_height->SetHelpText(_("The object height.")); | |
367 | if (wxRichTextSizePage::ShowToolTips()) | |
368 | m_height->SetToolTip(_("The object height.")); | |
369 | itemBoxSizer39->Add(m_height, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
370 | ||
371 | wxArrayString m_unitsHStrings; | |
372 | m_unitsHStrings.Add(_("px")); | |
373 | m_unitsHStrings.Add(_("cm")); | |
374 | m_unitsHStrings.Add(_("percent")); | |
375 | m_unitsH = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_H, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsHStrings, wxCB_READONLY ); | |
376 | m_unitsH->SetStringSelection(_("px")); | |
377 | m_unitsH->SetHelpText(_("Units for the object height.")); | |
378 | if (wxRichTextSizePage::ShowToolTips()) | |
379 | m_unitsH->SetToolTip(_("Units for the object height.")); | |
380 | itemBoxSizer39->Add(m_unitsH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
381 | ||
382 | m_minWidthCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MIN_WIDTH_CHECKBOX, _("Min width:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
383 | m_minWidthCheckbox->SetValue(false); | |
384 | m_minWidthCheckbox->SetHelpText(_("Enable the minimum width value.")); | |
385 | if (wxRichTextSizePage::ShowToolTips()) | |
386 | m_minWidthCheckbox->SetToolTip(_("Enable the minimum width value.")); | |
387 | m_sizeSizer->Add(m_minWidthCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
388 | ||
389 | m_minWidthSizer = new wxBoxSizer(wxHORIZONTAL); | |
390 | m_sizeSizer->Add(m_minWidthSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
391 | ||
392 | m_minWidth = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MIN_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); | |
393 | m_minWidth->SetHelpText(_("The object minimum width.")); | |
394 | if (wxRichTextSizePage::ShowToolTips()) | |
395 | m_minWidth->SetToolTip(_("The object minimum width.")); | |
396 | m_minWidthSizer->Add(m_minWidth, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
397 | ||
398 | wxArrayString m_unitsMinWStrings; | |
399 | m_unitsMinWStrings.Add(_("px")); | |
400 | m_unitsMinWStrings.Add(_("cm")); | |
401 | m_unitsMinWStrings.Add(_("percent")); | |
402 | m_unitsMinW = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MIN_W, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMinWStrings, wxCB_READONLY ); | |
403 | m_unitsMinW->SetStringSelection(_("px")); | |
404 | m_unitsMinW->SetHelpText(_("Units for the minimum object width.")); | |
405 | if (wxRichTextSizePage::ShowToolTips()) | |
406 | m_unitsMinW->SetToolTip(_("Units for the minimum object width.")); | |
407 | m_minWidthSizer->Add(m_unitsMinW, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
408 | ||
409 | m_minHeightCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MIN_HEIGHT_CHECKBOX, _("Min height:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
410 | m_minHeightCheckbox->SetValue(false); | |
411 | m_minHeightCheckbox->SetHelpText(_("Enable the minimum height value.")); | |
412 | if (wxRichTextSizePage::ShowToolTips()) | |
413 | m_minHeightCheckbox->SetToolTip(_("Enable the minimum height value.")); | |
414 | m_sizeSizer->Add(m_minHeightCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
415 | ||
416 | m_minHeightSizer = new wxBoxSizer(wxHORIZONTAL); | |
417 | m_sizeSizer->Add(m_minHeightSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
418 | ||
419 | m_minHeight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MIN_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); | |
420 | m_minHeight->SetHelpText(_("The object minimum height.")); | |
421 | if (wxRichTextSizePage::ShowToolTips()) | |
422 | m_minHeight->SetToolTip(_("The object minimum height.")); | |
423 | m_minHeightSizer->Add(m_minHeight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
424 | ||
425 | wxArrayString m_unitsMinHStrings; | |
426 | m_unitsMinHStrings.Add(_("px")); | |
427 | m_unitsMinHStrings.Add(_("cm")); | |
428 | m_unitsMinHStrings.Add(_("percent")); | |
429 | m_unitsMinH = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MIN_H, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMinHStrings, wxCB_READONLY ); | |
430 | m_unitsMinH->SetStringSelection(_("px")); | |
431 | m_unitsMinH->SetHelpText(_("Units for the minimum object height.")); | |
432 | if (wxRichTextSizePage::ShowToolTips()) | |
433 | m_unitsMinH->SetToolTip(_("Units for the minimum object height.")); | |
434 | m_minHeightSizer->Add(m_unitsMinH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
435 | ||
436 | m_maxWidthCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MAX_WIDTH_CHECKBOX, _("Max width:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
437 | m_maxWidthCheckbox->SetValue(false); | |
438 | m_maxWidthCheckbox->SetHelpText(_("Enable the maximum width value.")); | |
439 | if (wxRichTextSizePage::ShowToolTips()) | |
440 | m_maxWidthCheckbox->SetToolTip(_("Enable the maximum width value.")); | |
441 | m_sizeSizer->Add(m_maxWidthCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
442 | ||
443 | m_maxWidthSizer = new wxBoxSizer(wxHORIZONTAL); | |
444 | m_sizeSizer->Add(m_maxWidthSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
445 | ||
446 | m_maxWidth = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MAX_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); | |
447 | m_maxWidth->SetHelpText(_("The object maximum width.")); | |
448 | if (wxRichTextSizePage::ShowToolTips()) | |
449 | m_maxWidth->SetToolTip(_("The object maximum width.")); | |
450 | m_maxWidthSizer->Add(m_maxWidth, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
451 | ||
452 | wxArrayString m_unitsMaxWStrings; | |
453 | m_unitsMaxWStrings.Add(_("px")); | |
454 | m_unitsMaxWStrings.Add(_("cm")); | |
455 | m_unitsMaxWStrings.Add(_("percent")); | |
456 | m_unitsMaxW = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MAX_W, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMaxWStrings, wxCB_READONLY ); | |
457 | m_unitsMaxW->SetStringSelection(_("px")); | |
458 | m_unitsMaxW->SetHelpText(_("Units for the maximum object width.")); | |
459 | if (wxRichTextSizePage::ShowToolTips()) | |
460 | m_unitsMaxW->SetToolTip(_("Units for the maximum object width.")); | |
461 | m_maxWidthSizer->Add(m_unitsMaxW, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
462 | ||
463 | m_maxHeightCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MAX_HEIGHT_CHECKBOX, _("Max height:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
464 | m_maxHeightCheckbox->SetValue(false); | |
465 | m_maxHeightCheckbox->SetHelpText(_("Enable the height value.")); | |
466 | if (wxRichTextSizePage::ShowToolTips()) | |
467 | m_maxHeightCheckbox->SetToolTip(_("Enable the height value.")); | |
468 | m_sizeSizer->Add(m_maxHeightCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
469 | ||
470 | m_maxHeightSizer = new wxBoxSizer(wxHORIZONTAL); | |
471 | m_sizeSizer->Add(m_maxHeightSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
472 | ||
473 | m_maxHeight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MAX_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); | |
474 | m_maxHeight->SetHelpText(_("The object maximum height.")); | |
475 | if (wxRichTextSizePage::ShowToolTips()) | |
476 | m_maxHeight->SetToolTip(_("The object maximum height.")); | |
477 | m_maxHeightSizer->Add(m_maxHeight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
478 | ||
479 | wxArrayString m_unitsMaxHStrings; | |
480 | m_unitsMaxHStrings.Add(_("px")); | |
481 | m_unitsMaxHStrings.Add(_("cm")); | |
482 | m_unitsMaxHStrings.Add(_("percent")); | |
483 | m_unitsMaxH = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MAX_H, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMaxHStrings, wxCB_READONLY ); | |
484 | m_unitsMaxH->SetStringSelection(_("px")); | |
485 | m_unitsMaxH->SetHelpText(_("Units for the maximum object height.")); | |
486 | if (wxRichTextSizePage::ShowToolTips()) | |
487 | m_unitsMaxH->SetToolTip(_("Units for the maximum object height.")); | |
488 | m_maxHeightSizer->Add(m_unitsMaxH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
489 | ||
490 | m_positionControls = new wxBoxSizer(wxVERTICAL); | |
491 | m_parentSizer->Add(m_positionControls, 0, wxGROW, 5); | |
492 | ||
493 | wxBoxSizer* itemBoxSizer59 = new wxBoxSizer(wxHORIZONTAL); | |
494 | m_positionControls->Add(itemBoxSizer59, 0, wxGROW, 5); | |
495 | ||
496 | wxStaticText* itemStaticText60 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Position"), wxDefaultPosition, wxDefaultSize, 0 ); | |
497 | itemStaticText60->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); | |
498 | itemBoxSizer59->Add(itemStaticText60, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
499 | ||
500 | wxStaticLine* itemStaticLine61 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); | |
501 | itemBoxSizer59->Add(itemStaticLine61, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
502 | ||
503 | wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxHORIZONTAL); | |
504 | m_positionControls->Add(itemBoxSizer62, 0, wxGROW, 5); | |
505 | ||
506 | itemBoxSizer62->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
507 | ||
508 | m_moveObjectParentSizer = new wxBoxSizer(wxVERTICAL); | |
509 | itemBoxSizer62->Add(m_moveObjectParentSizer, 0, wxALIGN_TOP, 5); | |
510 | ||
511 | m_positionModeSizer = new wxBoxSizer(wxHORIZONTAL); | |
512 | m_moveObjectParentSizer->Add(m_positionModeSizer, 0, wxALIGN_LEFT, 5); | |
513 | ||
514 | wxStaticText* itemStaticText66 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Position mode:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
515 | m_positionModeSizer->Add(itemStaticText66, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
516 | ||
517 | wxArrayString m_positionModeCtrlStrings; | |
518 | m_positionModeCtrlStrings.Add(_("Static")); | |
519 | m_positionModeCtrlStrings.Add(_("Relative")); | |
520 | m_positionModeCtrlStrings.Add(_("Absolute")); | |
521 | m_positionModeCtrlStrings.Add(_("Fixed")); | |
522 | m_positionModeCtrl = new wxChoice( itemRichTextDialogPage1, ID_RICHTEXT_POSITION_MODE, wxDefaultPosition, wxDefaultSize, m_positionModeCtrlStrings, 0 ); | |
523 | m_positionModeCtrl->SetStringSelection(_("Static")); | |
524 | m_positionModeSizer->Add(m_positionModeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
525 | ||
526 | m_positionGridSizer = new wxFlexGridSizer(0, 4, 0, 0); | |
527 | m_moveObjectParentSizer->Add(m_positionGridSizer, 0, wxGROW, 5); | |
528 | ||
529 | m_leftSizer = new wxBoxSizer(wxHORIZONTAL); | |
530 | m_positionGridSizer->Add(m_leftSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
531 | ||
532 | m_positionLeftCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_CHECKBOX, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
533 | m_positionLeftCheckbox->SetValue(false); | |
534 | m_positionLeftCheckbox->SetHelpText(_("The left position.")); | |
535 | if (wxRichTextSizePage::ShowToolTips()) | |
536 | m_positionLeftCheckbox->SetToolTip(_("The left position.")); | |
537 | m_leftSizer->Add(m_positionLeftCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
538 | ||
539 | m_leftLabel = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
540 | m_leftLabel->Show(false); | |
541 | m_leftSizer->Add(m_leftLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
542 | ||
543 | wxBoxSizer* itemBoxSizer72 = new wxBoxSizer(wxHORIZONTAL); | |
544 | m_positionGridSizer->Add(itemBoxSizer72, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); | |
545 | ||
546 | m_left = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_LEFT, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); | |
547 | m_left->SetMaxLength(10); | |
548 | m_left->SetHelpText(_("The left position.")); | |
549 | if (wxRichTextSizePage::ShowToolTips()) | |
550 | m_left->SetToolTip(_("The left position.")); | |
551 | itemBoxSizer72->Add(m_left, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
552 | ||
553 | wxArrayString m_unitsLeftStrings; | |
554 | m_unitsLeftStrings.Add(_("px")); | |
555 | m_unitsLeftStrings.Add(_("cm")); | |
556 | m_unitsLeftStrings.Add(_("percent")); | |
557 | m_unitsLeft = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsLeftStrings, wxCB_READONLY ); | |
558 | m_unitsLeft->SetStringSelection(_("px")); | |
559 | m_unitsLeft->SetHelpText(_("Units for the left position.")); | |
560 | if (wxRichTextSizePage::ShowToolTips()) | |
561 | m_unitsLeft->SetToolTip(_("Units for the left position.")); | |
562 | itemBoxSizer72->Add(m_unitsLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
563 | ||
564 | m_topSizer = new wxBoxSizer(wxHORIZONTAL); | |
565 | m_positionGridSizer->Add(m_topSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
566 | ||
567 | m_positionTopCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_CHECKBOX, _("&Top:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
568 | m_positionTopCheckbox->SetValue(false); | |
569 | m_positionTopCheckbox->SetHelpText(_("The top position.")); | |
570 | if (wxRichTextSizePage::ShowToolTips()) | |
571 | m_positionTopCheckbox->SetToolTip(_("The top position.")); | |
572 | m_topSizer->Add(m_positionTopCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
573 | ||
574 | m_topLabel = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Top:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
575 | m_topLabel->Show(false); | |
576 | m_topSizer->Add(m_topLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
577 | ||
578 | wxBoxSizer* itemBoxSizer78 = new wxBoxSizer(wxHORIZONTAL); | |
579 | m_positionGridSizer->Add(itemBoxSizer78, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); | |
580 | ||
581 | m_top = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_TOP, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); | |
582 | m_top->SetMaxLength(10); | |
583 | m_top->SetHelpText(_("The top position.")); | |
584 | if (wxRichTextSizePage::ShowToolTips()) | |
585 | m_top->SetToolTip(_("The top position.")); | |
586 | itemBoxSizer78->Add(m_top, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
587 | ||
588 | wxArrayString m_unitsTopStrings; | |
589 | m_unitsTopStrings.Add(_("px")); | |
590 | m_unitsTopStrings.Add(_("cm")); | |
591 | m_unitsTopStrings.Add(_("percent")); | |
592 | m_unitsTop = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsTopStrings, wxCB_READONLY ); | |
593 | m_unitsTop->SetStringSelection(_("px")); | |
594 | m_unitsTop->SetHelpText(_("Units for the top position.")); | |
595 | if (wxRichTextSizePage::ShowToolTips()) | |
596 | m_unitsTop->SetToolTip(_("Units for the top position.")); | |
597 | itemBoxSizer78->Add(m_unitsTop, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
598 | ||
599 | m_rightSizer = new wxBoxSizer(wxHORIZONTAL); | |
600 | m_positionGridSizer->Add(m_rightSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
601 | ||
602 | m_positionRightCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_CHECKBOX, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
603 | m_positionRightCheckbox->SetValue(false); | |
604 | m_positionRightCheckbox->SetHelpText(_("The right position.")); | |
605 | if (wxRichTextSizePage::ShowToolTips()) | |
606 | m_positionRightCheckbox->SetToolTip(_("The right position.")); | |
607 | m_rightSizer->Add(m_positionRightCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
608 | ||
609 | m_rightLabel = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
610 | m_rightLabel->Show(false); | |
611 | m_rightSizer->Add(m_rightLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
612 | ||
613 | m_rightPositionSizer = new wxBoxSizer(wxHORIZONTAL); | |
614 | m_positionGridSizer->Add(m_rightPositionSizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); | |
615 | ||
616 | m_right = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); | |
617 | m_right->SetMaxLength(10); | |
618 | m_right->SetHelpText(_("The right position.")); | |
619 | if (wxRichTextSizePage::ShowToolTips()) | |
620 | m_right->SetToolTip(_("The right position.")); | |
621 | m_rightPositionSizer->Add(m_right, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
622 | ||
623 | wxArrayString m_unitsRightStrings; | |
624 | m_unitsRightStrings.Add(_("px")); | |
625 | m_unitsRightStrings.Add(_("cm")); | |
626 | m_unitsRightStrings.Add(_("percent")); | |
627 | m_unitsRight = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsRightStrings, wxCB_READONLY ); | |
628 | m_unitsRight->SetStringSelection(_("px")); | |
629 | m_unitsRight->SetHelpText(_("Units for the right position.")); | |
630 | if (wxRichTextSizePage::ShowToolTips()) | |
631 | m_unitsRight->SetToolTip(_("Units for the right position.")); | |
632 | m_rightPositionSizer->Add(m_unitsRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
633 | ||
634 | m_bottomSizer = new wxBoxSizer(wxHORIZONTAL); | |
635 | m_positionGridSizer->Add(m_bottomSizer, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); | |
636 | ||
637 | m_positionBottomCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_CHECKBOX, _("&Bottom:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
638 | m_positionBottomCheckbox->SetValue(false); | |
639 | m_positionBottomCheckbox->SetHelpText(_("The bottom position.")); | |
640 | if (wxRichTextSizePage::ShowToolTips()) | |
641 | m_positionBottomCheckbox->SetToolTip(_("The bottom position.")); | |
642 | m_bottomSizer->Add(m_positionBottomCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
643 | ||
644 | m_bottomLabel = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Bottom:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
645 | m_bottomLabel->Show(false); | |
646 | m_bottomSizer->Add(m_bottomLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
647 | ||
648 | m_bottomPositionSizer = new wxBoxSizer(wxHORIZONTAL); | |
649 | m_positionGridSizer->Add(m_bottomPositionSizer, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); | |
650 | ||
651 | m_bottom = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); | |
652 | m_bottom->SetMaxLength(10); | |
653 | m_bottom->SetHelpText(_("The bottom position.")); | |
654 | if (wxRichTextSizePage::ShowToolTips()) | |
655 | m_bottom->SetToolTip(_("The bottom position.")); | |
656 | m_bottomPositionSizer->Add(m_bottom, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); | |
657 | ||
658 | wxArrayString m_unitsBottomStrings; | |
659 | m_unitsBottomStrings.Add(_("px")); | |
660 | m_unitsBottomStrings.Add(_("cm")); | |
661 | m_unitsBottomStrings.Add(_("percent")); | |
662 | m_unitsBottom = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsBottomStrings, wxCB_READONLY ); | |
663 | m_unitsBottom->SetStringSelection(_("px")); | |
664 | m_unitsBottom->SetHelpText(_("Units for the bottom position.")); | |
665 | if (wxRichTextSizePage::ShowToolTips()) | |
666 | m_unitsBottom->SetToolTip(_("Units for the bottom position.")); | |
667 | m_bottomPositionSizer->Add(m_unitsBottom, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
668 | ||
669 | m_moveObjectSizer = new wxBoxSizer(wxHORIZONTAL); | |
670 | m_moveObjectParentSizer->Add(m_moveObjectSizer, 0, wxGROW, 5); | |
671 | ||
672 | wxStaticText* itemStaticText94 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Move the object to:"), wxDefaultPosition, wxDefaultSize, 0 ); | |
673 | m_moveObjectSizer->Add(itemStaticText94, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
674 | ||
675 | wxButton* itemButton95 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXT_PARA_UP, _("&Previous Paragraph"), wxDefaultPosition, wxDefaultSize, 0 ); | |
676 | itemButton95->SetHelpText(_("Moves the object to the previous paragraph.")); | |
677 | if (wxRichTextSizePage::ShowToolTips()) | |
678 | itemButton95->SetToolTip(_("Moves the object to the previous paragraph.")); | |
679 | m_moveObjectSizer->Add(itemButton95, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); | |
680 | ||
681 | wxButton* itemButton96 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXT_PARA_DOWN, _("&Next Paragraph"), wxDefaultPosition, wxDefaultSize, 0 ); | |
682 | itemButton96->SetHelpText(_("Moves the object to the next paragraph.")); | |
683 | if (wxRichTextSizePage::ShowToolTips()) | |
684 | itemButton96->SetToolTip(_("Moves the object to the next paragraph.")); | |
685 | m_moveObjectSizer->Add(itemButton96, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); | |
686 | ||
687 | // Set validators | |
688 | m_positionModeCtrl->SetValidator( wxGenericValidator(& m_positionMode) ); | |
689 | ////@end wxRichTextSizePage content construction | |
690 | ||
691 | if (!sm_enablePositionAndSizeCheckboxes) | |
692 | { | |
693 | m_widthSizer->Show(m_widthCheckbox, false); | |
694 | m_widthSizer->Show(m_widthLabel, true); | |
695 | m_heightSizer->Show(m_heightCheckbox, false); | |
696 | m_heightSizer->Show(m_heightLabel, true); | |
697 | ||
698 | m_leftSizer->Show(m_positionLeftCheckbox, false); | |
699 | m_leftSizer->Show(m_leftLabel, true); | |
700 | m_topSizer->Show(m_positionTopCheckbox, false); | |
701 | m_topSizer->Show(m_topLabel, true); | |
702 | ||
703 | if (sm_showRightBottomPositionControls) | |
704 | { | |
705 | m_rightSizer->Show(m_positionRightCheckbox, false); | |
706 | m_rightSizer->Show(m_rightLabel, true); | |
707 | m_bottomSizer->Show(m_positionBottomCheckbox, false); | |
708 | m_bottomSizer->Show(m_bottomLabel, true); | |
709 | } | |
710 | } | |
711 | ||
712 | if (!sm_showFloatingAndAlignmentControls) | |
713 | m_parentSizer->Show(m_floatingAlignmentSizer, false); | |
714 | ||
715 | if (!sm_showFloatingControls) | |
716 | m_floatingAlignmentSizer->Show(m_floatingSizer, false); | |
717 | ||
718 | if (!sm_showAlignmentControls) | |
719 | m_floatingAlignmentSizer->Show(m_alignmentSizer, false); | |
720 | ||
721 | if (!sm_showPositionControls) | |
722 | m_parentSizer->Show(m_positionControls, false); | |
723 | ||
724 | if (!sm_showMinMaxSizeControls) | |
725 | { | |
726 | m_sizeSizer->Show(m_minWidthCheckbox, false); | |
727 | m_sizeSizer->Show(m_minWidthSizer, false); | |
728 | m_sizeSizer->Show(m_minHeightCheckbox, false); | |
729 | m_sizeSizer->Show(m_minHeightSizer, false); | |
730 | m_sizeSizer->Show(m_maxWidthCheckbox, false); | |
731 | m_sizeSizer->Show(m_maxWidthSizer, false); | |
732 | m_sizeSizer->Show(m_maxHeightCheckbox, false); | |
733 | m_sizeSizer->Show(m_maxHeightSizer, false); | |
734 | } | |
735 | ||
736 | if (!sm_showRightBottomPositionControls) | |
737 | { | |
738 | m_positionGridSizer->Show(m_rightSizer, false); | |
739 | m_positionGridSizer->Show(m_rightPositionSizer, false); | |
740 | m_positionGridSizer->Show(m_bottomSizer, false); | |
741 | m_positionGridSizer->Show(m_bottomPositionSizer, false); | |
742 | } | |
743 | ||
744 | if (!sm_showPositionModeControls) | |
745 | m_moveObjectParentSizer->Show(m_positionModeSizer, false); | |
746 | } | |
747 | ||
748 | wxRichTextAttr* wxRichTextSizePage::GetAttributes() | |
749 | { | |
750 | return wxRichTextFormattingDialog::GetDialogAttributes(this); | |
751 | } | |
752 | ||
753 | /*! | |
754 | * Should we show tooltips? | |
755 | */ | |
756 | ||
757 | bool wxRichTextSizePage::ShowToolTips() | |
758 | { | |
759 | return true; | |
760 | } | |
761 | ||
762 | bool wxRichTextSizePage::TransferDataToWindow() | |
763 | { | |
764 | m_float->SetSelection(GetAttributes()->GetTextBoxAttr().GetFloatMode()); | |
765 | m_verticalAlignmentCheckbox->SetValue(GetAttributes()->GetTextBoxAttr().HasVerticalAlignment()); | |
766 | if (GetAttributes()->GetTextBoxAttr().HasVerticalAlignment()) | |
767 | { | |
768 | if ((int) GetAttributes()->GetTextBoxAttr().GetVerticalAlignment() > 0 && | |
769 | (int) GetAttributes()->GetTextBoxAttr().GetVerticalAlignment() < 4) | |
770 | { | |
771 | m_verticalAlignmentComboBox->SetSelection(((int) GetAttributes()->GetTextBoxAttr().GetVerticalAlignment() - 1)); | |
772 | } | |
773 | else | |
774 | m_verticalAlignmentComboBox->SetSelection(0); | |
775 | } | |
776 | ||
777 | wxRichTextFormattingDialog* dialog = wxRichTextFormattingDialog::GetDialog(this); | |
778 | ||
779 | if (dialog) | |
780 | { | |
781 | // Only show the Move Object controls if there's an object. | |
782 | if (!dialog->GetObject()) | |
783 | { | |
784 | m_moveObjectParentSizer->Show(m_moveObjectSizer, false); | |
785 | GetSizer()->Layout(); | |
786 | } | |
787 | } | |
788 | ||
789 | wxRichTextImage* imageObj = NULL; | |
790 | if (dialog) | |
791 | imageObj = wxDynamicCast(dialog->GetObject(), wxRichTextImage); | |
792 | ||
793 | // For an image, show the original width and height if the size is not explicitly specified. | |
794 | if (imageObj && !GetAttributes()->GetTextBoxAttr().GetWidth().IsValid() && !GetAttributes()->GetTextBoxAttr().GetHeight().IsValid() && | |
795 | imageObj->GetOriginalImageSize() != wxSize(-1, -1)) | |
796 | { | |
797 | m_widthCheckbox->SetValue(false); | |
798 | m_heightCheckbox->SetValue(false); | |
799 | m_unitsW->SetSelection(0); | |
800 | m_unitsH->SetSelection(0); | |
801 | m_width->SetValue(wxString::Format(wxT("%d"), (int) imageObj->GetOriginalImageSize().GetWidth())); | |
802 | m_height->SetValue(wxString::Format(wxT("%d"), (int) imageObj->GetOriginalImageSize().GetHeight())); | |
803 | } | |
804 | else | |
805 | { | |
806 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetWidth(), m_width, m_unitsW, m_widthCheckbox); | |
807 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetHeight(), m_height, m_unitsH, m_heightCheckbox); | |
808 | } | |
809 | ||
810 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetWidth(), m_minWidth, m_unitsMinW, m_minWidthCheckbox); | |
811 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetHeight(), m_minHeight, m_unitsMinH, m_minHeightCheckbox); | |
812 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetWidth(), m_maxWidth, m_unitsMaxW, m_maxWidthCheckbox); | |
813 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetHeight(), m_maxHeight, m_unitsMaxH, m_maxHeightCheckbox); | |
814 | ||
815 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetLeft(), m_left, m_unitsLeft, m_positionLeftCheckbox); | |
816 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetTop(), m_top, m_unitsTop, m_positionTopCheckbox); | |
817 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetRight(), m_right, m_unitsRight, m_positionRightCheckbox); | |
818 | wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetBottom(), m_bottom, m_unitsBottom, m_positionBottomCheckbox); | |
819 | ||
820 | if ((GetAttributes()->GetTextBoxAttr().GetLeft().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED) || | |
821 | (GetAttributes()->GetTextBoxAttr().GetRight().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED) || | |
822 | (GetAttributes()->GetTextBoxAttr().GetTop().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED) || | |
823 | (GetAttributes()->GetTextBoxAttr().GetBottom().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED)) | |
824 | { | |
825 | m_positionMode = 3; | |
826 | } | |
827 | else | |
828 | if ((GetAttributes()->GetTextBoxAttr().GetLeft().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE) || | |
829 | (GetAttributes()->GetTextBoxAttr().GetRight().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE) || | |
830 | (GetAttributes()->GetTextBoxAttr().GetTop().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE) || | |
831 | (GetAttributes()->GetTextBoxAttr().GetBottom().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE)) | |
832 | { | |
833 | m_positionMode = 2; | |
834 | } | |
835 | else | |
836 | if ((GetAttributes()->GetTextBoxAttr().GetLeft().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE) || | |
837 | (GetAttributes()->GetTextBoxAttr().GetRight().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE) || | |
838 | (GetAttributes()->GetTextBoxAttr().GetTop().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE) || | |
839 | (GetAttributes()->GetTextBoxAttr().GetBottom().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE)) | |
840 | { | |
841 | m_positionMode = 1; | |
842 | } | |
843 | else | |
844 | m_positionMode = 0; | |
845 | ||
846 | return wxPanel::TransferDataToWindow(); | |
847 | } | |
848 | ||
849 | bool wxRichTextSizePage::TransferDataFromWindow() | |
850 | { | |
851 | wxPanel::TransferDataFromWindow(); | |
852 | ||
853 | GetAttributes()->GetTextBoxAttr().SetFloatMode((wxTextBoxAttrFloatStyle) m_float->GetSelection()); | |
854 | if (m_float->GetSelection() == 0) | |
855 | GetAttributes()->GetTextBoxAttr().RemoveFlag(wxTEXT_BOX_ATTR_FLOAT); | |
856 | ||
857 | if (m_verticalAlignmentCheckbox->GetValue()) | |
858 | GetAttributes()->GetTextBoxAttr().SetVerticalAlignment((wxTextBoxAttrVerticalAlignment) (m_verticalAlignmentComboBox->GetSelection() + 1)); | |
859 | else | |
860 | { | |
861 | GetAttributes()->GetTextBoxAttr().SetVerticalAlignment(wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_NONE); | |
862 | GetAttributes()->GetTextBoxAttr().RemoveFlag(wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT); | |
863 | } | |
864 | ||
865 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetWidth(), m_width, m_unitsW, m_widthCheckbox); | |
866 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetHeight(), m_height, m_unitsH, m_heightCheckbox); | |
867 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetWidth(), m_minWidth, m_unitsMinW, m_minWidthCheckbox); | |
868 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetHeight(), m_minHeight, m_unitsMinH, m_minHeightCheckbox); | |
869 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetWidth(), m_maxWidth, m_unitsMaxW, m_maxWidthCheckbox); | |
870 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetHeight(), m_maxHeight, m_unitsMaxH, m_maxHeightCheckbox); | |
871 | ||
872 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetLeft(), m_left, m_unitsLeft, m_positionLeftCheckbox); | |
873 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetTop(), m_top, m_unitsTop, m_positionTopCheckbox); | |
874 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetRight(), m_right, m_unitsRight, m_positionRightCheckbox); | |
875 | wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetBottom(), m_bottom, m_unitsBottom, m_positionBottomCheckbox); | |
876 | ||
877 | wxTextBoxAttrPosition flags; | |
878 | if (m_positionMode == 3) | |
879 | flags = wxTEXT_BOX_ATTR_POSITION_FIXED; | |
880 | else if (m_positionMode == 2) | |
881 | flags = wxTEXT_BOX_ATTR_POSITION_ABSOLUTE; | |
882 | else if (m_positionMode == 1) | |
883 | flags = wxTEXT_BOX_ATTR_POSITION_RELATIVE; | |
884 | else | |
885 | flags = wxTEXT_BOX_ATTR_POSITION_STATIC; | |
886 | ||
887 | if (GetAttributes()->GetTextBoxAttr().GetLeft().IsValid()) | |
888 | GetAttributes()->GetTextBoxAttr().GetLeft().SetPosition(flags); | |
889 | if (GetAttributes()->GetTextBoxAttr().GetTop().IsValid()) | |
890 | GetAttributes()->GetTextBoxAttr().GetTop().SetPosition(flags); | |
891 | if (GetAttributes()->GetTextBoxAttr().GetRight().IsValid()) | |
892 | GetAttributes()->GetTextBoxAttr().GetRight().SetPosition(flags); | |
893 | if (GetAttributes()->GetTextBoxAttr().GetBottom().IsValid()) | |
894 | GetAttributes()->GetTextBoxAttr().GetBottom().SetPosition(flags); | |
895 | ||
896 | return true; | |
897 | } | |
898 | ||
899 | /*! | |
900 | * Get bitmap resources | |
901 | */ | |
902 | ||
903 | wxBitmap wxRichTextSizePage::GetBitmapResource( const wxString& name ) | |
904 | { | |
905 | // Bitmap retrieval | |
906 | ////@begin wxRichTextSizePage bitmap retrieval | |
907 | wxUnusedVar(name); | |
908 | return wxNullBitmap; | |
909 | ////@end wxRichTextSizePage bitmap retrieval | |
910 | } | |
911 | ||
912 | /*! | |
913 | * Get icon resources | |
914 | */ | |
915 | ||
916 | wxIcon wxRichTextSizePage::GetIconResource( const wxString& name ) | |
917 | { | |
918 | // Icon retrieval | |
919 | ////@begin wxRichTextSizePage icon retrieval | |
920 | wxUnusedVar(name); | |
921 | return wxNullIcon; | |
922 | ////@end wxRichTextSizePage icon retrieval | |
923 | } | |
924 | ||
925 | ||
926 | /*! | |
927 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH | |
928 | */ | |
929 | ||
930 | void wxRichTextSizePage::OnRichtextWidthUpdate( wxUpdateUIEvent& event ) | |
931 | { | |
932 | event.Enable(m_widthCheckbox->GetValue()); | |
933 | } | |
934 | ||
935 | /*! | |
936 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT | |
937 | */ | |
938 | ||
939 | void wxRichTextSizePage::OnRichtextHeightUpdate( wxUpdateUIEvent& event ) | |
940 | { | |
941 | event.Enable(m_heightCheckbox->GetValue()); | |
942 | } | |
943 | ||
944 | /*! | |
945 | * wxEVT_BUTTON event handler for ID_RICHTEXT_PARA_UP | |
946 | */ | |
947 | ||
948 | void wxRichTextSizePage::OnRichtextParaUpClick( wxCommandEvent& WXUNUSED(event) ) | |
949 | { | |
950 | wxRichTextFormattingDialog* dialog = wxRichTextFormattingDialog::GetDialog(this); | |
951 | if (!dialog || !dialog->GetObject()) | |
952 | return; | |
953 | ||
954 | // Make sure object attributes are up-to-date | |
955 | dialog->TransferDataFromWindow(); | |
956 | ||
957 | wxRichTextBuffer* buffer = dialog->GetObject()->GetBuffer(); | |
958 | wxRichTextParagraphLayoutBox* container = dialog->GetObject()->GetParentContainer(); | |
959 | wxRichTextObject* parent = dialog->GetObject()->GetParent(); | |
960 | if (!container || !parent || !buffer) | |
961 | return; | |
962 | ||
963 | wxRichTextRange range = dialog->GetObject()->GetRange(); | |
964 | wxRichTextObjectList::compatibility_iterator iter = container->GetChildren().GetFirst(); | |
965 | if (!iter) | |
966 | return; | |
967 | ||
968 | while (iter) | |
969 | { | |
970 | if (iter->GetData() == parent) | |
971 | break; | |
972 | iter = iter->GetNext(); | |
973 | } | |
974 | if (!iter) | |
975 | return; | |
976 | iter = iter->GetPrevious(); | |
977 | if (!iter) | |
978 | return; | |
979 | ||
980 | wxRichTextObject *obj = iter->GetData(); | |
981 | wxRichTextRange rg = obj->GetRange(); | |
982 | // tempObj will be deleted along with the undo object, and a clone of it will be | |
983 | // returned by InsertObjectWithUndo | |
984 | wxRichTextObject* tempObj = dialog->GetObject()->Clone(); | |
985 | ||
986 | container->DeleteRangeWithUndo(range, buffer->GetRichTextCtrl(), buffer); | |
987 | ||
988 | wxRichTextObject* obj2 = container->InsertObjectWithUndo(buffer, rg.GetStart(), tempObj, buffer->GetRichTextCtrl(), 0); | |
989 | dialog->SetObject(obj2); | |
990 | } | |
991 | ||
992 | /*! | |
993 | * wxEVT_BUTTON event handler for ID_RICHTEXT_DOWN | |
994 | */ | |
995 | ||
996 | void wxRichTextSizePage::OnRichtextParaDownClick( wxCommandEvent& WXUNUSED(event) ) | |
997 | { | |
998 | wxRichTextFormattingDialog* dialog = wxRichTextFormattingDialog::GetDialog(this); | |
999 | if (!dialog || !dialog->GetObject()) | |
1000 | return; | |
1001 | ||
1002 | // Make sure object attributes are up-to-date | |
1003 | dialog->TransferDataFromWindow(); | |
1004 | ||
1005 | wxRichTextBuffer* buffer = dialog->GetObject()->GetBuffer(); | |
1006 | wxRichTextParagraphLayoutBox* container = dialog->GetObject()->GetParentContainer(); | |
1007 | wxRichTextObject* parent = dialog->GetObject()->GetParent(); | |
1008 | if (!container || !parent || !buffer) | |
1009 | return; | |
1010 | ||
1011 | wxRichTextRange range = dialog->GetObject()->GetRange(); | |
1012 | ||
1013 | wxRichTextObjectList::compatibility_iterator iter = buffer->GetChildren().GetFirst(); | |
1014 | if (!iter) | |
1015 | return; | |
1016 | ||
1017 | while (iter) | |
1018 | { | |
1019 | if (iter->GetData() == parent) | |
1020 | break; | |
1021 | iter = iter->GetNext(); | |
1022 | } | |
1023 | ||
1024 | iter = iter->GetNext(); | |
1025 | if (!iter) | |
1026 | return; | |
1027 | ||
1028 | wxRichTextObject *obj = iter->GetData(); | |
1029 | wxRichTextRange rg = obj->GetRange(); | |
1030 | // tempObj will be deleted along with the undo object, and a clone of it will be | |
1031 | // returned by InsertObjectWithUndo | |
1032 | wxRichTextObject* tempObj = dialog->GetObject()->Clone(); | |
1033 | ||
1034 | container->DeleteRangeWithUndo(range, buffer->GetRichTextCtrl(), buffer); | |
1035 | ||
1036 | // Minus one because we deleted an object | |
1037 | wxRichTextObject* obj2 = container->InsertObjectWithUndo(buffer, rg.GetStart()-1, tempObj, buffer->GetRichTextCtrl(), 0); | |
1038 | dialog->SetObject(obj2); | |
1039 | } | |
1040 | ||
1041 | /*! | |
1042 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX | |
1043 | */ | |
1044 | ||
1045 | void wxRichTextSizePage::OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event ) | |
1046 | { | |
1047 | event.Enable(m_verticalAlignmentCheckbox->GetValue()); | |
1048 | } | |
1049 | ||
1050 | /*! | |
1051 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH | |
1052 | */ | |
1053 | ||
1054 | void wxRichTextSizePage::OnRichtextMinWidthUpdate( wxUpdateUIEvent& event ) | |
1055 | { | |
1056 | event.Enable(m_minWidthCheckbox->GetValue()); | |
1057 | } | |
1058 | ||
1059 | /*! | |
1060 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT | |
1061 | */ | |
1062 | ||
1063 | void wxRichTextSizePage::OnRichtextMinHeightUpdate( wxUpdateUIEvent& event ) | |
1064 | { | |
1065 | event.Enable(m_minHeightCheckbox->GetValue()); | |
1066 | } | |
1067 | ||
1068 | /*! | |
1069 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH | |
1070 | */ | |
1071 | ||
1072 | void wxRichTextSizePage::OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event ) | |
1073 | { | |
1074 | event.Enable(m_maxWidthCheckbox->GetValue()); | |
1075 | } | |
1076 | ||
1077 | /*! | |
1078 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT | |
1079 | */ | |
1080 | ||
1081 | void wxRichTextSizePage::OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event ) | |
1082 | { | |
1083 | event.Enable(m_maxHeightCheckbox->GetValue()); | |
1084 | } | |
1085 | ||
1086 | /*! | |
1087 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT | |
1088 | */ | |
1089 | ||
1090 | void wxRichTextSizePage::OnRichtextLeftUpdate( wxUpdateUIEvent& event ) | |
1091 | { | |
1092 | event.Enable(m_positionLeftCheckbox->GetValue()); | |
1093 | } | |
1094 | ||
1095 | /*! | |
1096 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT | |
1097 | */ | |
1098 | ||
1099 | void wxRichTextSizePage::OnRichtextRightUpdate( wxUpdateUIEvent& event ) | |
1100 | { | |
1101 | event.Enable(m_positionRightCheckbox->GetValue()); | |
1102 | } | |
1103 | ||
1104 | /*! | |
1105 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP | |
1106 | */ | |
1107 | ||
1108 | void wxRichTextSizePage::OnRichtextTopUpdate( wxUpdateUIEvent& event ) | |
1109 | { | |
1110 | event.Enable(m_positionTopCheckbox->GetValue()); | |
1111 | } | |
1112 | ||
1113 | /*! | |
1114 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM | |
1115 | */ | |
1116 | ||
1117 | void wxRichTextSizePage::OnRichtextBottomUpdate( wxUpdateUIEvent& event ) | |
1118 | { | |
1119 | event.Enable(m_positionBottomCheckbox->GetValue()); | |
1120 | } | |
1121 | ||
1122 | /*! | |
1123 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH_UNITS | |
1124 | */ | |
1125 | ||
1126 | void wxRichTextSizePage::OnRichtextWidthUnitsUpdate( wxUpdateUIEvent& event ) | |
1127 | { | |
1128 | event.Enable(m_widthCheckbox->GetValue() && sm_enablePositionAndSizeUnits); | |
1129 | } | |
1130 | ||
1131 | /*! | |
1132 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT_UNITS | |
1133 | */ | |
1134 | ||
1135 | void wxRichTextSizePage::OnRichtextHeightUnitsUpdate( wxUpdateUIEvent& event ) | |
1136 | { | |
1137 | event.Enable(m_heightCheckbox->GetValue() && sm_enablePositionAndSizeUnits); | |
1138 | } | |
1139 | ||
1140 | /*! | |
1141 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS | |
1142 | */ | |
1143 | ||
1144 | void wxRichTextSizePage::OnRichtextLeftUnitsUpdate( wxUpdateUIEvent& event ) | |
1145 | { | |
1146 | event.Enable(m_positionLeftCheckbox->GetValue() && sm_enablePositionAndSizeUnits); | |
1147 | } | |
1148 | ||
1149 | /*! | |
1150 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS | |
1151 | */ | |
1152 | ||
1153 | void wxRichTextSizePage::OnRichtextRightUnitsUpdate( wxUpdateUIEvent& event ) | |
1154 | { | |
1155 | event.Enable(m_positionRightCheckbox->GetValue() && sm_enablePositionAndSizeUnits); | |
1156 | } | |
1157 | ||
1158 | /*! | |
1159 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS | |
1160 | */ | |
1161 | ||
1162 | void wxRichTextSizePage::OnRichtextTopUnitsUpdate( wxUpdateUIEvent& event ) | |
1163 | { | |
1164 | event.Enable(m_positionTopCheckbox->GetValue() && sm_enablePositionAndSizeUnits); | |
1165 | } | |
1166 | ||
1167 | /*! | |
1168 | * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS | |
1169 | */ | |
1170 | ||
1171 | void wxRichTextSizePage::OnRichtextBottomUnitsUpdate( wxUpdateUIEvent& event ) | |
1172 | { | |
1173 | event.Enable(m_positionBottomCheckbox->GetValue() && sm_enablePositionAndSizeUnits); | |
1174 | } |