1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/richtext/richtextsizepage.cpp
4 // Author: Julian Smart
6 // Created: 20/10/2010 10:23:24
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/richtext/richtextsizepage.h"
19 * wxRichTextSizePage type definition
22 IMPLEMENT_DYNAMIC_CLASS( wxRichTextSizePage
, wxRichTextDialogPage
)
26 * wxRichTextSizePage event table definition
29 BEGIN_EVENT_TABLE( wxRichTextSizePage
, wxRichTextDialogPage
)
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
59 IMPLEMENT_HELP_PROVISION(wxRichTextSizePage
)
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;
72 * wxRichTextSizePage constructors
75 wxRichTextSizePage::wxRichTextSizePage()
80 wxRichTextSizePage::wxRichTextSizePage( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
83 Create(parent
, id
, pos
, size
, style
);
88 * wxRichTextSizePage creator
91 bool wxRichTextSizePage::Create( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
93 ////@begin wxRichTextSizePage creation
94 wxRichTextDialogPage::Create( parent
, id
, pos
, size
, style
);
99 GetSizer()->SetSizeHints(this);
102 ////@end wxRichTextSizePage creation
108 * wxRichTextSizePage destructor
111 wxRichTextSizePage::~wxRichTextSizePage()
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;
123 ////@begin wxRichTextSizePage destruction
124 ////@end wxRichTextSizePage destruction
129 * Member initialisation
132 void wxRichTextSizePage::Init()
134 ////@begin wxRichTextSizePage member initialisation
136 m_parentSizer
= NULL
;
137 m_floatingAlignmentSizer
= NULL
;
138 m_floatingSizer
= NULL
;
140 m_alignmentSizer
= NULL
;
141 m_verticalAlignmentCheckbox
= NULL
;
142 m_verticalAlignmentComboBox
= NULL
;
145 m_widthCheckbox
= NULL
;
149 m_heightSizer
= NULL
;
150 m_heightCheckbox
= NULL
;
151 m_heightLabel
= NULL
;
154 m_minWidthCheckbox
= NULL
;
155 m_minWidthSizer
= NULL
;
158 m_minHeightCheckbox
= NULL
;
159 m_minHeightSizer
= NULL
;
162 m_maxWidthCheckbox
= NULL
;
163 m_maxWidthSizer
= NULL
;
166 m_maxHeightCheckbox
= NULL
;
167 m_maxHeightSizer
= NULL
;
170 m_positionControls
= NULL
;
171 m_moveObjectParentSizer
= NULL
;
172 m_positionModeSizer
= NULL
;
173 m_positionModeCtrl
= NULL
;
174 m_positionGridSizer
= NULL
;
176 m_positionLeftCheckbox
= NULL
;
181 m_positionTopCheckbox
= NULL
;
186 m_positionRightCheckbox
= NULL
;
188 m_rightPositionSizer
= NULL
;
191 m_bottomSizer
= NULL
;
192 m_positionBottomCheckbox
= NULL
;
193 m_bottomLabel
= NULL
;
194 m_bottomPositionSizer
= NULL
;
196 m_unitsBottom
= NULL
;
197 m_moveObjectSizer
= NULL
;
198 ////@end wxRichTextSizePage member initialisation
203 * Control creation for wxRichTextSizePage
206 void wxRichTextSizePage::CreateControls()
208 ////@begin wxRichTextSizePage content construction
209 wxRichTextSizePage
* itemRichTextDialogPage1
= this;
211 wxBoxSizer
* itemBoxSizer2
= new wxBoxSizer(wxVERTICAL
);
212 itemRichTextDialogPage1
->SetSizer(itemBoxSizer2
);
214 m_parentSizer
= new wxBoxSizer(wxVERTICAL
);
215 itemBoxSizer2
->Add(m_parentSizer
, 0, wxGROW
|wxALL
, 5);
217 m_floatingAlignmentSizer
= new wxBoxSizer(wxHORIZONTAL
);
218 m_parentSizer
->Add(m_floatingAlignmentSizer
, 0, wxGROW
, 5);
220 m_floatingSizer
= new wxBoxSizer(wxVERTICAL
);
221 m_floatingAlignmentSizer
->Add(m_floatingSizer
, 0, wxALIGN_CENTER_VERTICAL
, 5);
223 wxBoxSizer
* itemBoxSizer6
= new wxBoxSizer(wxHORIZONTAL
);
224 m_floatingSizer
->Add(itemBoxSizer6
, 0, wxGROW
, 5);
226 wxStaticText
* itemStaticText7
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Floating"), wxDefaultPosition
, wxDefaultSize
, 0 );
227 itemStaticText7
->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("")));
228 itemBoxSizer6
->Add(itemStaticText7
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
230 wxStaticLine
* itemStaticLine8
= new wxStaticLine( itemRichTextDialogPage1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_HORIZONTAL
);
231 itemBoxSizer6
->Add(itemStaticLine8
, 1, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
233 wxBoxSizer
* itemBoxSizer9
= new wxBoxSizer(wxHORIZONTAL
);
234 m_floatingSizer
->Add(itemBoxSizer9
, 0, wxGROW
, 5);
236 itemBoxSizer9
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
238 wxFlexGridSizer
* itemFlexGridSizer11
= new wxFlexGridSizer(0, 2, 0, 0);
239 itemBoxSizer9
->Add(itemFlexGridSizer11
, 0, wxALIGN_CENTER_VERTICAL
|wxRIGHT
, 5);
241 wxStaticText
* itemStaticText12
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Floating mode:"), wxDefaultPosition
, wxDefaultSize
, 0 );
242 itemFlexGridSizer11
->Add(itemStaticText12
, 0, wxALIGN_RIGHT
|wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
244 wxArrayString m_floatStrings
;
245 m_floatStrings
.Add(_("None"));
246 m_floatStrings
.Add(_("Left"));
247 m_floatStrings
.Add(_("Right"));
248 m_float
= new wxChoice( itemRichTextDialogPage1
, ID_RICHTEXT_FLOATING_MODE
, wxDefaultPosition
, wxSize(80, -1), m_floatStrings
, 0 );
249 m_float
->SetStringSelection(_("None"));
250 m_float
->SetHelpText(_("How the object will float relative to the text."));
251 if (wxRichTextSizePage::ShowToolTips())
252 m_float
->SetToolTip(_("How the object will float relative to the text."));
253 itemFlexGridSizer11
->Add(m_float
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
255 m_floatingAlignmentSizer
->Add(0, 0, 1, wxALIGN_CENTER_VERTICAL
, 5);
257 m_alignmentSizer
= new wxBoxSizer(wxVERTICAL
);
258 m_floatingAlignmentSizer
->Add(m_alignmentSizer
, 0, wxALIGN_CENTER_VERTICAL
, 5);
260 wxBoxSizer
* itemBoxSizer16
= new wxBoxSizer(wxHORIZONTAL
);
261 m_alignmentSizer
->Add(itemBoxSizer16
, 0, wxGROW
, 5);
263 wxStaticText
* itemStaticText17
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Alignment"), wxDefaultPosition
, wxDefaultSize
, 0 );
264 itemStaticText17
->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("")));
265 itemBoxSizer16
->Add(itemStaticText17
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
267 wxStaticLine
* itemStaticLine18
= new wxStaticLine( itemRichTextDialogPage1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_HORIZONTAL
);
268 itemBoxSizer16
->Add(itemStaticLine18
, 1, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
270 wxBoxSizer
* itemBoxSizer19
= new wxBoxSizer(wxHORIZONTAL
);
271 m_alignmentSizer
->Add(itemBoxSizer19
, 0, wxGROW
, 5);
273 itemBoxSizer19
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
275 m_verticalAlignmentCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX
, _("&Vertical alignment:"), wxDefaultPosition
, wxDefaultSize
, 0 );
276 m_verticalAlignmentCheckbox
->SetValue(false);
277 m_verticalAlignmentCheckbox
->SetHelpText(_("Enable vertical alignment."));
278 if (wxRichTextSizePage::ShowToolTips())
279 m_verticalAlignmentCheckbox
->SetToolTip(_("Enable vertical alignment."));
280 itemBoxSizer19
->Add(m_verticalAlignmentCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
282 wxArrayString m_verticalAlignmentComboBoxStrings
;
283 m_verticalAlignmentComboBoxStrings
.Add(_("Top"));
284 m_verticalAlignmentComboBoxStrings
.Add(_("Centred"));
285 m_verticalAlignmentComboBoxStrings
.Add(_("Bottom"));
286 m_verticalAlignmentComboBox
= new wxChoice( itemRichTextDialogPage1
, ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
, wxDefaultPosition
, wxDefaultSize
, m_verticalAlignmentComboBoxStrings
, 0 );
287 m_verticalAlignmentComboBox
->SetStringSelection(_("Top"));
288 m_verticalAlignmentComboBox
->SetHelpText(_("Vertical alignment."));
289 if (wxRichTextSizePage::ShowToolTips())
290 m_verticalAlignmentComboBox
->SetToolTip(_("Vertical alignment."));
291 itemBoxSizer19
->Add(m_verticalAlignmentComboBox
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
293 wxBoxSizer
* itemBoxSizer23
= new wxBoxSizer(wxHORIZONTAL
);
294 m_parentSizer
->Add(itemBoxSizer23
, 0, wxGROW
, 5);
296 wxStaticText
* itemStaticText24
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Size"), wxDefaultPosition
, wxDefaultSize
, 0 );
297 itemStaticText24
->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("")));
298 itemBoxSizer23
->Add(itemStaticText24
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
300 wxStaticLine
* itemStaticLine25
= new wxStaticLine( itemRichTextDialogPage1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_HORIZONTAL
);
301 itemBoxSizer23
->Add(itemStaticLine25
, 1, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
303 wxBoxSizer
* itemBoxSizer26
= new wxBoxSizer(wxHORIZONTAL
);
304 m_parentSizer
->Add(itemBoxSizer26
, 0, wxGROW
, 5);
306 itemBoxSizer26
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
308 m_sizeSizer
= new wxFlexGridSizer(0, 4, 0, 0);
309 itemBoxSizer26
->Add(m_sizeSizer
, 0, wxALIGN_CENTER_VERTICAL
, 5);
311 m_widthSizer
= new wxBoxSizer(wxHORIZONTAL
);
312 m_sizeSizer
->Add(m_widthSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
314 m_widthCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_WIDTH_CHECKBOX
, _("&Width:"), wxDefaultPosition
, wxDefaultSize
, 0 );
315 m_widthCheckbox
->SetValue(false);
316 m_widthCheckbox
->SetHelpText(_("Enable the width value."));
317 if (wxRichTextSizePage::ShowToolTips())
318 m_widthCheckbox
->SetToolTip(_("Enable the width value."));
319 m_widthSizer
->Add(m_widthCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
321 m_widthLabel
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Width:"), wxDefaultPosition
, wxDefaultSize
, 0 );
322 m_widthLabel
->Show(false);
323 m_widthSizer
->Add(m_widthLabel
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
325 wxBoxSizer
* itemBoxSizer32
= new wxBoxSizer(wxHORIZONTAL
);
326 m_sizeSizer
->Add(itemBoxSizer32
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
328 m_width
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_WIDTH
, wxEmptyString
, wxDefaultPosition
, wxSize(60, -1), 0 );
329 m_width
->SetHelpText(_("The object width."));
330 if (wxRichTextSizePage::ShowToolTips())
331 m_width
->SetToolTip(_("The object width."));
332 itemBoxSizer32
->Add(m_width
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
334 wxArrayString m_unitsWStrings
;
335 m_unitsWStrings
.Add(_("px"));
336 m_unitsWStrings
.Add(_("cm"));
337 m_unitsWStrings
.Add(_("percent"));
338 m_unitsW
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_UNITS_W
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsWStrings
, wxCB_READONLY
);
339 m_unitsW
->SetStringSelection(_("px"));
340 m_unitsW
->SetHelpText(_("Units for the object width."));
341 if (wxRichTextSizePage::ShowToolTips())
342 m_unitsW
->SetToolTip(_("Units for the object width."));
343 itemBoxSizer32
->Add(m_unitsW
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
345 m_heightSizer
= new wxBoxSizer(wxHORIZONTAL
);
346 m_sizeSizer
->Add(m_heightSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
348 m_heightCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_HEIGHT_CHECKBOX
, _("&Height:"), wxDefaultPosition
, wxDefaultSize
, 0 );
349 m_heightCheckbox
->SetValue(false);
350 m_heightCheckbox
->SetHelpText(_("Enable the height value."));
351 if (wxRichTextSizePage::ShowToolTips())
352 m_heightCheckbox
->SetToolTip(_("Enable the height value."));
353 m_heightSizer
->Add(m_heightCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
355 m_heightLabel
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Height:"), wxDefaultPosition
, wxDefaultSize
, 0 );
356 m_heightLabel
->Show(false);
357 m_heightSizer
->Add(m_heightLabel
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
359 wxBoxSizer
* itemBoxSizer38
= new wxBoxSizer(wxHORIZONTAL
);
360 m_sizeSizer
->Add(itemBoxSizer38
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
362 m_height
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_HEIGHT
, wxEmptyString
, wxDefaultPosition
, wxSize(60, -1), 0 );
363 m_height
->SetHelpText(_("The object height."));
364 if (wxRichTextSizePage::ShowToolTips())
365 m_height
->SetToolTip(_("The object height."));
366 itemBoxSizer38
->Add(m_height
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
368 wxArrayString m_unitsHStrings
;
369 m_unitsHStrings
.Add(_("px"));
370 m_unitsHStrings
.Add(_("cm"));
371 m_unitsHStrings
.Add(_("percent"));
372 m_unitsH
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_UNITS_H
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsHStrings
, wxCB_READONLY
);
373 m_unitsH
->SetStringSelection(_("px"));
374 m_unitsH
->SetHelpText(_("Units for the object height."));
375 if (wxRichTextSizePage::ShowToolTips())
376 m_unitsH
->SetToolTip(_("Units for the object height."));
377 itemBoxSizer38
->Add(m_unitsH
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
379 m_minWidthCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_MIN_WIDTH_CHECKBOX
, _("Min width:"), wxDefaultPosition
, wxDefaultSize
, 0 );
380 m_minWidthCheckbox
->SetValue(false);
381 m_minWidthCheckbox
->SetHelpText(_("Enable the minimum width value."));
382 if (wxRichTextSizePage::ShowToolTips())
383 m_minWidthCheckbox
->SetToolTip(_("Enable the minimum width value."));
384 m_sizeSizer
->Add(m_minWidthCheckbox
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
386 m_minWidthSizer
= new wxBoxSizer(wxHORIZONTAL
);
387 m_sizeSizer
->Add(m_minWidthSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
389 m_minWidth
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_MIN_WIDTH
, wxEmptyString
, wxDefaultPosition
, wxSize(60, -1), 0 );
390 m_minWidth
->SetHelpText(_("The object minimum width."));
391 if (wxRichTextSizePage::ShowToolTips())
392 m_minWidth
->SetToolTip(_("The object minimum width."));
393 m_minWidthSizer
->Add(m_minWidth
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
395 wxArrayString m_unitsMinWStrings
;
396 m_unitsMinWStrings
.Add(_("px"));
397 m_unitsMinWStrings
.Add(_("cm"));
398 m_unitsMinWStrings
.Add(_("percent"));
399 m_unitsMinW
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_UNITS_MIN_W
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsMinWStrings
, wxCB_READONLY
);
400 m_unitsMinW
->SetStringSelection(_("px"));
401 m_unitsMinW
->SetHelpText(_("Units for the minimum object width."));
402 if (wxRichTextSizePage::ShowToolTips())
403 m_unitsMinW
->SetToolTip(_("Units for the minimum object width."));
404 m_minWidthSizer
->Add(m_unitsMinW
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
406 m_minHeightCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_MIN_HEIGHT_CHECKBOX
, _("Min height:"), wxDefaultPosition
, wxDefaultSize
, 0 );
407 m_minHeightCheckbox
->SetValue(false);
408 m_minHeightCheckbox
->SetHelpText(_("Enable the minimum height value."));
409 if (wxRichTextSizePage::ShowToolTips())
410 m_minHeightCheckbox
->SetToolTip(_("Enable the minimum height value."));
411 m_sizeSizer
->Add(m_minHeightCheckbox
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
413 m_minHeightSizer
= new wxBoxSizer(wxHORIZONTAL
);
414 m_sizeSizer
->Add(m_minHeightSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
416 m_minHeight
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_MIN_HEIGHT
, wxEmptyString
, wxDefaultPosition
, wxSize(60, -1), 0 );
417 m_minHeight
->SetHelpText(_("The object minimum height."));
418 if (wxRichTextSizePage::ShowToolTips())
419 m_minHeight
->SetToolTip(_("The object minimum height."));
420 m_minHeightSizer
->Add(m_minHeight
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
422 wxArrayString m_unitsMinHStrings
;
423 m_unitsMinHStrings
.Add(_("px"));
424 m_unitsMinHStrings
.Add(_("cm"));
425 m_unitsMinHStrings
.Add(_("percent"));
426 m_unitsMinH
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_UNITS_MIN_H
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsMinHStrings
, wxCB_READONLY
);
427 m_unitsMinH
->SetStringSelection(_("px"));
428 m_unitsMinH
->SetHelpText(_("Units for the minimum object height."));
429 if (wxRichTextSizePage::ShowToolTips())
430 m_unitsMinH
->SetToolTip(_("Units for the minimum object height."));
431 m_minHeightSizer
->Add(m_unitsMinH
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
433 m_maxWidthCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_MAX_WIDTH_CHECKBOX
, _("Max width:"), wxDefaultPosition
, wxDefaultSize
, 0 );
434 m_maxWidthCheckbox
->SetValue(false);
435 m_maxWidthCheckbox
->SetHelpText(_("Enable the maximum width value."));
436 if (wxRichTextSizePage::ShowToolTips())
437 m_maxWidthCheckbox
->SetToolTip(_("Enable the maximum width value."));
438 m_sizeSizer
->Add(m_maxWidthCheckbox
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
440 m_maxWidthSizer
= new wxBoxSizer(wxHORIZONTAL
);
441 m_sizeSizer
->Add(m_maxWidthSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
443 m_maxWidth
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_MAX_WIDTH
, wxEmptyString
, wxDefaultPosition
, wxSize(60, -1), 0 );
444 m_maxWidth
->SetHelpText(_("The object maximum width."));
445 if (wxRichTextSizePage::ShowToolTips())
446 m_maxWidth
->SetToolTip(_("The object maximum width."));
447 m_maxWidthSizer
->Add(m_maxWidth
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
449 wxArrayString m_unitsMaxWStrings
;
450 m_unitsMaxWStrings
.Add(_("px"));
451 m_unitsMaxWStrings
.Add(_("cm"));
452 m_unitsMaxWStrings
.Add(_("percent"));
453 m_unitsMaxW
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_UNITS_MAX_W
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsMaxWStrings
, wxCB_READONLY
);
454 m_unitsMaxW
->SetStringSelection(_("px"));
455 m_unitsMaxW
->SetHelpText(_("Units for the maximum object width."));
456 if (wxRichTextSizePage::ShowToolTips())
457 m_unitsMaxW
->SetToolTip(_("Units for the maximum object width."));
458 m_maxWidthSizer
->Add(m_unitsMaxW
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
460 m_maxHeightCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_MAX_HEIGHT_CHECKBOX
, _("Max height:"), wxDefaultPosition
, wxDefaultSize
, 0 );
461 m_maxHeightCheckbox
->SetValue(false);
462 m_maxHeightCheckbox
->SetHelpText(_("Enable the height value."));
463 if (wxRichTextSizePage::ShowToolTips())
464 m_maxHeightCheckbox
->SetToolTip(_("Enable the height value."));
465 m_sizeSizer
->Add(m_maxHeightCheckbox
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
467 m_maxHeightSizer
= new wxBoxSizer(wxHORIZONTAL
);
468 m_sizeSizer
->Add(m_maxHeightSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
470 m_maxHeight
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_MAX_HEIGHT
, wxEmptyString
, wxDefaultPosition
, wxSize(60, -1), 0 );
471 m_maxHeight
->SetHelpText(_("The object maximum height."));
472 if (wxRichTextSizePage::ShowToolTips())
473 m_maxHeight
->SetToolTip(_("The object maximum height."));
474 m_maxHeightSizer
->Add(m_maxHeight
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
476 wxArrayString m_unitsMaxHStrings
;
477 m_unitsMaxHStrings
.Add(_("px"));
478 m_unitsMaxHStrings
.Add(_("cm"));
479 m_unitsMaxHStrings
.Add(_("percent"));
480 m_unitsMaxH
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_UNITS_MAX_H
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsMaxHStrings
, wxCB_READONLY
);
481 m_unitsMaxH
->SetStringSelection(_("px"));
482 m_unitsMaxH
->SetHelpText(_("Units for the maximum object height."));
483 if (wxRichTextSizePage::ShowToolTips())
484 m_unitsMaxH
->SetToolTip(_("Units for the maximum object height."));
485 m_maxHeightSizer
->Add(m_unitsMaxH
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
487 m_positionControls
= new wxBoxSizer(wxVERTICAL
);
488 m_parentSizer
->Add(m_positionControls
, 0, wxGROW
, 5);
490 wxBoxSizer
* itemBoxSizer58
= new wxBoxSizer(wxHORIZONTAL
);
491 m_positionControls
->Add(itemBoxSizer58
, 0, wxGROW
, 5);
493 wxStaticText
* itemStaticText59
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("Position"), wxDefaultPosition
, wxDefaultSize
, 0 );
494 itemStaticText59
->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("")));
495 itemBoxSizer58
->Add(itemStaticText59
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
497 wxStaticLine
* itemStaticLine60
= new wxStaticLine( itemRichTextDialogPage1
, wxID_STATIC
, wxDefaultPosition
, wxDefaultSize
, wxLI_HORIZONTAL
);
498 itemBoxSizer58
->Add(itemStaticLine60
, 1, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
500 wxBoxSizer
* itemBoxSizer61
= new wxBoxSizer(wxHORIZONTAL
);
501 m_positionControls
->Add(itemBoxSizer61
, 0, wxGROW
, 5);
503 itemBoxSizer61
->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
505 m_moveObjectParentSizer
= new wxBoxSizer(wxVERTICAL
);
506 itemBoxSizer61
->Add(m_moveObjectParentSizer
, 0, wxALIGN_TOP
, 5);
508 m_positionModeSizer
= new wxBoxSizer(wxHORIZONTAL
);
509 m_moveObjectParentSizer
->Add(m_positionModeSizer
, 0, wxALIGN_LEFT
, 5);
511 wxStaticText
* itemStaticText65
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Position mode:"), wxDefaultPosition
, wxDefaultSize
, 0 );
512 m_positionModeSizer
->Add(itemStaticText65
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
514 wxArrayString m_positionModeCtrlStrings
;
515 m_positionModeCtrlStrings
.Add(_("Static"));
516 m_positionModeCtrlStrings
.Add(_("Relative"));
517 m_positionModeCtrlStrings
.Add(_("Absolute"));
518 m_positionModeCtrlStrings
.Add(_("Fixed"));
519 m_positionModeCtrl
= new wxChoice( itemRichTextDialogPage1
, ID_RICHTEXT_POSITION_MODE
, wxDefaultPosition
, wxDefaultSize
, m_positionModeCtrlStrings
, 0 );
520 m_positionModeCtrl
->SetStringSelection(_("Static"));
521 m_positionModeSizer
->Add(m_positionModeCtrl
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
523 m_positionGridSizer
= new wxFlexGridSizer(0, 4, 0, 0);
524 m_moveObjectParentSizer
->Add(m_positionGridSizer
, 0, wxGROW
, 5);
526 m_leftSizer
= new wxBoxSizer(wxHORIZONTAL
);
527 m_positionGridSizer
->Add(m_leftSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
529 m_positionLeftCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_LEFT_CHECKBOX
, _("&Left:"), wxDefaultPosition
, wxDefaultSize
, 0 );
530 m_positionLeftCheckbox
->SetValue(false);
531 m_positionLeftCheckbox
->SetHelpText(_("The left position."));
532 if (wxRichTextSizePage::ShowToolTips())
533 m_positionLeftCheckbox
->SetToolTip(_("The left position."));
534 m_leftSizer
->Add(m_positionLeftCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
536 m_leftLabel
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Left:"), wxDefaultPosition
, wxDefaultSize
, 0 );
537 m_leftLabel
->Show(false);
538 m_leftSizer
->Add(m_leftLabel
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
540 wxBoxSizer
* itemBoxSizer71
= new wxBoxSizer(wxHORIZONTAL
);
541 m_positionGridSizer
->Add(itemBoxSizer71
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
, 5);
543 m_left
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_LEFT
, wxEmptyString
, wxDefaultPosition
, wxSize(65, -1), 0 );
544 m_left
->SetMaxLength(10);
545 m_left
->SetHelpText(_("The left position."));
546 if (wxRichTextSizePage::ShowToolTips())
547 m_left
->SetToolTip(_("The left position."));
548 itemBoxSizer71
->Add(m_left
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
550 wxArrayString m_unitsLeftStrings
;
551 m_unitsLeftStrings
.Add(_("px"));
552 m_unitsLeftStrings
.Add(_("cm"));
553 m_unitsLeftStrings
.Add(_("percent"));
554 m_unitsLeft
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_LEFT_UNITS
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsLeftStrings
, wxCB_READONLY
);
555 m_unitsLeft
->SetStringSelection(_("px"));
556 m_unitsLeft
->SetHelpText(_("Units for the left position."));
557 if (wxRichTextSizePage::ShowToolTips())
558 m_unitsLeft
->SetToolTip(_("Units for the left position."));
559 itemBoxSizer71
->Add(m_unitsLeft
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
561 m_topSizer
= new wxBoxSizer(wxHORIZONTAL
);
562 m_positionGridSizer
->Add(m_topSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
564 m_positionTopCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_TOP_CHECKBOX
, _("&Top:"), wxDefaultPosition
, wxDefaultSize
, 0 );
565 m_positionTopCheckbox
->SetValue(false);
566 m_positionTopCheckbox
->SetHelpText(_("The top position."));
567 if (wxRichTextSizePage::ShowToolTips())
568 m_positionTopCheckbox
->SetToolTip(_("The top position."));
569 m_topSizer
->Add(m_positionTopCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
571 m_topLabel
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Top:"), wxDefaultPosition
, wxDefaultSize
, 0 );
572 m_topLabel
->Show(false);
573 m_topSizer
->Add(m_topLabel
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
575 wxBoxSizer
* itemBoxSizer77
= new wxBoxSizer(wxHORIZONTAL
);
576 m_positionGridSizer
->Add(itemBoxSizer77
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
, 5);
578 m_top
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_TOP
, wxEmptyString
, wxDefaultPosition
, wxSize(65, -1), 0 );
579 m_top
->SetMaxLength(10);
580 m_top
->SetHelpText(_("The top position."));
581 if (wxRichTextSizePage::ShowToolTips())
582 m_top
->SetToolTip(_("The top position."));
583 itemBoxSizer77
->Add(m_top
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
585 wxArrayString m_unitsTopStrings
;
586 m_unitsTopStrings
.Add(_("px"));
587 m_unitsTopStrings
.Add(_("cm"));
588 m_unitsTopStrings
.Add(_("percent"));
589 m_unitsTop
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_TOP_UNITS
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsTopStrings
, wxCB_READONLY
);
590 m_unitsTop
->SetStringSelection(_("px"));
591 m_unitsTop
->SetHelpText(_("Units for the top position."));
592 if (wxRichTextSizePage::ShowToolTips())
593 m_unitsTop
->SetToolTip(_("Units for the top position."));
594 itemBoxSizer77
->Add(m_unitsTop
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
596 m_rightSizer
= new wxBoxSizer(wxHORIZONTAL
);
597 m_positionGridSizer
->Add(m_rightSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
599 m_positionRightCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_RIGHT_CHECKBOX
, _("&Right:"), wxDefaultPosition
, wxDefaultSize
, 0 );
600 m_positionRightCheckbox
->SetValue(false);
601 m_positionRightCheckbox
->SetHelpText(_("The right position."));
602 if (wxRichTextSizePage::ShowToolTips())
603 m_positionRightCheckbox
->SetToolTip(_("The right position."));
604 m_rightSizer
->Add(m_positionRightCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
606 m_rightLabel
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Right:"), wxDefaultPosition
, wxDefaultSize
, 0 );
607 m_rightLabel
->Show(false);
608 m_rightSizer
->Add(m_rightLabel
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
610 m_rightPositionSizer
= new wxBoxSizer(wxHORIZONTAL
);
611 m_positionGridSizer
->Add(m_rightPositionSizer
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
, 5);
613 m_right
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_RIGHT
, wxEmptyString
, wxDefaultPosition
, wxSize(65, -1), 0 );
614 m_right
->SetMaxLength(10);
615 m_right
->SetHelpText(_("The right position."));
616 if (wxRichTextSizePage::ShowToolTips())
617 m_right
->SetToolTip(_("The right position."));
618 m_rightPositionSizer
->Add(m_right
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
620 wxArrayString m_unitsRightStrings
;
621 m_unitsRightStrings
.Add(_("px"));
622 m_unitsRightStrings
.Add(_("cm"));
623 m_unitsRightStrings
.Add(_("percent"));
624 m_unitsRight
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_RIGHT_UNITS
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsRightStrings
, wxCB_READONLY
);
625 m_unitsRight
->SetStringSelection(_("px"));
626 m_unitsRight
->SetHelpText(_("Units for the right position."));
627 if (wxRichTextSizePage::ShowToolTips())
628 m_unitsRight
->SetToolTip(_("Units for the right position."));
629 m_rightPositionSizer
->Add(m_unitsRight
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
631 m_bottomSizer
= new wxBoxSizer(wxHORIZONTAL
);
632 m_positionGridSizer
->Add(m_bottomSizer
, 0, wxALIGN_LEFT
|wxALIGN_CENTER_VERTICAL
, 5);
634 m_positionBottomCheckbox
= new wxCheckBox( itemRichTextDialogPage1
, ID_RICHTEXT_BOTTOM_CHECKBOX
, _("&Bottom:"), wxDefaultPosition
, wxDefaultSize
, 0 );
635 m_positionBottomCheckbox
->SetValue(false);
636 m_positionBottomCheckbox
->SetHelpText(_("The bottom position."));
637 if (wxRichTextSizePage::ShowToolTips())
638 m_positionBottomCheckbox
->SetToolTip(_("The bottom position."));
639 m_bottomSizer
->Add(m_positionBottomCheckbox
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
641 m_bottomLabel
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Bottom:"), wxDefaultPosition
, wxDefaultSize
, 0 );
642 m_bottomLabel
->Show(false);
643 m_bottomSizer
->Add(m_bottomLabel
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
645 m_bottomPositionSizer
= new wxBoxSizer(wxHORIZONTAL
);
646 m_positionGridSizer
->Add(m_bottomPositionSizer
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
, 5);
648 m_bottom
= new wxTextCtrl( itemRichTextDialogPage1
, ID_RICHTEXT_BOTTOM
, wxEmptyString
, wxDefaultPosition
, wxSize(65, -1), 0 );
649 m_bottom
->SetMaxLength(10);
650 m_bottom
->SetHelpText(_("The bottom position."));
651 if (wxRichTextSizePage::ShowToolTips())
652 m_bottom
->SetToolTip(_("The bottom position."));
653 m_bottomPositionSizer
->Add(m_bottom
, 0, wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
, 5);
655 wxArrayString m_unitsBottomStrings
;
656 m_unitsBottomStrings
.Add(_("px"));
657 m_unitsBottomStrings
.Add(_("cm"));
658 m_unitsBottomStrings
.Add(_("percent"));
659 m_unitsBottom
= new wxComboBox( itemRichTextDialogPage1
, ID_RICHTEXT_BOTTOM_UNITS
, _("px"), wxDefaultPosition
, wxSize(60, -1), m_unitsBottomStrings
, wxCB_READONLY
);
660 m_unitsBottom
->SetStringSelection(_("px"));
661 m_unitsBottom
->SetHelpText(_("Units for the bottom position."));
662 if (wxRichTextSizePage::ShowToolTips())
663 m_unitsBottom
->SetToolTip(_("Units for the bottom position."));
664 m_bottomPositionSizer
->Add(m_unitsBottom
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
666 m_moveObjectSizer
= new wxBoxSizer(wxHORIZONTAL
);
667 m_moveObjectParentSizer
->Add(m_moveObjectSizer
, 0, wxGROW
, 5);
669 wxStaticText
* itemStaticText93
= new wxStaticText( itemRichTextDialogPage1
, wxID_STATIC
, _("&Move the object to:"), wxDefaultPosition
, wxDefaultSize
, 0 );
670 m_moveObjectSizer
->Add(itemStaticText93
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
672 wxButton
* itemButton94
= new wxButton( itemRichTextDialogPage1
, ID_RICHTEXT_PARA_UP
, _("&Previous Paragraph"), wxDefaultPosition
, wxDefaultSize
, 0 );
673 itemButton94
->SetHelpText(_("Moves the object to the previous paragraph."));
674 if (wxRichTextSizePage::ShowToolTips())
675 itemButton94
->SetToolTip(_("Moves the object to the previous paragraph."));
676 m_moveObjectSizer
->Add(itemButton94
, 0, wxALIGN_CENTER_VERTICAL
|wxALL
, 5);
678 wxButton
* itemButton95
= new wxButton( itemRichTextDialogPage1
, ID_RICHTEXT_PARA_DOWN
, _("&Next Paragraph"), wxDefaultPosition
, wxDefaultSize
, 0 );
679 itemButton95
->SetHelpText(_("Moves the object to the next paragraph."));
680 if (wxRichTextSizePage::ShowToolTips())
681 itemButton95
->SetToolTip(_("Moves the object to the next paragraph."));
682 m_moveObjectSizer
->Add(itemButton95
, 0, wxALIGN_CENTER_VERTICAL
|wxRIGHT
|wxTOP
|wxBOTTOM
, 5);
685 m_positionModeCtrl
->SetValidator( wxGenericValidator(& m_positionMode
) );
686 ////@end wxRichTextSizePage content construction
688 if (!sm_enablePositionAndSizeCheckboxes
)
690 m_widthSizer
->Show(m_widthCheckbox
, false);
691 m_widthSizer
->Show(m_widthLabel
, true);
692 m_heightSizer
->Show(m_heightCheckbox
, false);
693 m_heightSizer
->Show(m_heightLabel
, true);
695 m_leftSizer
->Show(m_positionLeftCheckbox
, false);
696 m_leftSizer
->Show(m_leftLabel
, true);
697 m_topSizer
->Show(m_positionTopCheckbox
, false);
698 m_topSizer
->Show(m_topLabel
, true);
700 if (sm_showRightBottomPositionControls
)
702 m_rightSizer
->Show(m_positionRightCheckbox
, false);
703 m_rightSizer
->Show(m_rightLabel
, true);
704 m_bottomSizer
->Show(m_positionBottomCheckbox
, false);
705 m_bottomSizer
->Show(m_bottomLabel
, true);
709 if (!sm_showFloatingAndAlignmentControls
)
710 m_parentSizer
->Show(m_floatingAlignmentSizer
, false);
712 if (!sm_showFloatingControls
)
713 m_floatingAlignmentSizer
->Show(m_floatingSizer
, false);
715 if (!sm_showAlignmentControls
)
716 m_floatingAlignmentSizer
->Show(m_alignmentSizer
, false);
718 if (!sm_showPositionControls
)
719 m_parentSizer
->Show(m_positionControls
, false);
721 if (!sm_showMinMaxSizeControls
)
723 m_sizeSizer
->Show(m_minWidthCheckbox
, false);
724 m_sizeSizer
->Show(m_minWidthSizer
, false);
725 m_sizeSizer
->Show(m_minHeightCheckbox
, false);
726 m_sizeSizer
->Show(m_minHeightSizer
, false);
727 m_sizeSizer
->Show(m_maxWidthCheckbox
, false);
728 m_sizeSizer
->Show(m_maxWidthSizer
, false);
729 m_sizeSizer
->Show(m_maxHeightCheckbox
, false);
730 m_sizeSizer
->Show(m_maxHeightSizer
, false);
733 if (!sm_showRightBottomPositionControls
)
735 m_positionGridSizer
->Show(m_rightSizer
, false);
736 m_positionGridSizer
->Show(m_rightPositionSizer
, false);
737 m_positionGridSizer
->Show(m_bottomSizer
, false);
738 m_positionGridSizer
->Show(m_bottomPositionSizer
, false);
741 if (!sm_showPositionModeControls
)
742 m_moveObjectParentSizer
->Show(m_positionModeSizer
, false);
745 wxRichTextAttr
* wxRichTextSizePage::GetAttributes()
747 return wxRichTextFormattingDialog::GetDialogAttributes(this);
751 * Should we show tooltips?
754 bool wxRichTextSizePage::ShowToolTips()
759 bool wxRichTextSizePage::TransferDataToWindow()
761 m_float
->SetSelection(GetAttributes()->GetTextBoxAttr().GetFloatMode());
762 m_verticalAlignmentCheckbox
->SetValue(GetAttributes()->GetTextBoxAttr().HasVerticalAlignment());
763 if (GetAttributes()->GetTextBoxAttr().HasVerticalAlignment())
765 if ((int) GetAttributes()->GetTextBoxAttr().GetVerticalAlignment() > 0 &&
766 (int) GetAttributes()->GetTextBoxAttr().GetVerticalAlignment() < 4)
768 m_verticalAlignmentComboBox
->SetSelection(((int) GetAttributes()->GetTextBoxAttr().GetVerticalAlignment() - 1));
771 m_verticalAlignmentComboBox
->SetSelection(0);
774 wxRichTextFormattingDialog
* dialog
= wxRichTextFormattingDialog::GetDialog(this);
778 // Only show the Move Object controls if there's an object.
779 if (!dialog
->GetObject())
781 m_moveObjectParentSizer
->Show(m_moveObjectSizer
, false);
782 GetSizer()->Layout();
786 wxRichTextImage
* imageObj
= NULL
;
788 imageObj
= wxDynamicCast(dialog
->GetObject(), wxRichTextImage
);
790 // For an image, show the original width and height if the size is not explicitly specified.
791 if (imageObj
&& !GetAttributes()->GetTextBoxAttr().GetWidth().IsValid() && !GetAttributes()->GetTextBoxAttr().GetHeight().IsValid() &&
792 imageObj
->GetOriginalImageSize() != wxSize(-1, -1))
794 m_widthCheckbox
->SetValue(false);
795 m_heightCheckbox
->SetValue(false);
796 m_unitsW
->SetSelection(0);
797 m_unitsH
->SetSelection(0);
798 m_width
->SetValue(wxString::Format(wxT("%d"), (int) imageObj
->GetOriginalImageSize().GetWidth()));
799 m_height
->SetValue(wxString::Format(wxT("%d"), (int) imageObj
->GetOriginalImageSize().GetHeight()));
803 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetWidth(), m_width
, m_unitsW
, m_widthCheckbox
);
804 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetHeight(), m_height
, m_unitsH
, m_heightCheckbox
);
807 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetWidth(), m_minWidth
, m_unitsMinW
, m_minWidthCheckbox
);
808 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetHeight(), m_minHeight
, m_unitsMinH
, m_minHeightCheckbox
);
809 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetWidth(), m_maxWidth
, m_unitsMaxW
, m_maxWidthCheckbox
);
810 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetHeight(), m_maxHeight
, m_unitsMaxH
, m_maxHeightCheckbox
);
812 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetLeft(), m_left
, m_unitsLeft
, m_positionLeftCheckbox
);
813 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetTop(), m_top
, m_unitsTop
, m_positionTopCheckbox
);
814 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetRight(), m_right
, m_unitsRight
, m_positionRightCheckbox
);
815 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetBottom(), m_bottom
, m_unitsBottom
, m_positionBottomCheckbox
);
817 if ((GetAttributes()->GetTextBoxAttr().GetLeft().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED
) ||
818 (GetAttributes()->GetTextBoxAttr().GetRight().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED
) ||
819 (GetAttributes()->GetTextBoxAttr().GetTop().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED
) ||
820 (GetAttributes()->GetTextBoxAttr().GetBottom().GetPosition() & wxTEXT_BOX_ATTR_POSITION_FIXED
))
825 if ((GetAttributes()->GetTextBoxAttr().GetLeft().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE
) ||
826 (GetAttributes()->GetTextBoxAttr().GetRight().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE
) ||
827 (GetAttributes()->GetTextBoxAttr().GetTop().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE
) ||
828 (GetAttributes()->GetTextBoxAttr().GetBottom().GetPosition() & wxTEXT_BOX_ATTR_POSITION_ABSOLUTE
))
833 if ((GetAttributes()->GetTextBoxAttr().GetLeft().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE
) ||
834 (GetAttributes()->GetTextBoxAttr().GetRight().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE
) ||
835 (GetAttributes()->GetTextBoxAttr().GetTop().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE
) ||
836 (GetAttributes()->GetTextBoxAttr().GetBottom().GetPosition() & wxTEXT_BOX_ATTR_POSITION_RELATIVE
))
843 return wxPanel::TransferDataToWindow();
846 bool wxRichTextSizePage::TransferDataFromWindow()
848 wxPanel::TransferDataFromWindow();
850 GetAttributes()->GetTextBoxAttr().SetFloatMode((wxTextBoxAttrFloatStyle
) m_float
->GetSelection());
851 if (m_float
->GetSelection() == 0)
852 GetAttributes()->GetTextBoxAttr().RemoveFlag(wxTEXT_BOX_ATTR_FLOAT
);
854 if (m_verticalAlignmentCheckbox
->GetValue())
855 GetAttributes()->GetTextBoxAttr().SetVerticalAlignment((wxTextBoxAttrVerticalAlignment
) (m_verticalAlignmentComboBox
->GetSelection() + 1));
858 GetAttributes()->GetTextBoxAttr().SetVerticalAlignment(wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT_NONE
);
859 GetAttributes()->GetTextBoxAttr().RemoveFlag(wxTEXT_BOX_ATTR_VERTICAL_ALIGNMENT
);
862 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetWidth(), m_width
, m_unitsW
, m_widthCheckbox
);
863 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetHeight(), m_height
, m_unitsH
, m_heightCheckbox
);
864 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetWidth(), m_minWidth
, m_unitsMinW
, m_minWidthCheckbox
);
865 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetHeight(), m_minHeight
, m_unitsMinH
, m_minHeightCheckbox
);
866 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetWidth(), m_maxWidth
, m_unitsMaxW
, m_maxWidthCheckbox
);
867 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetHeight(), m_maxHeight
, m_unitsMaxH
, m_maxHeightCheckbox
);
869 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetLeft(), m_left
, m_unitsLeft
, m_positionLeftCheckbox
);
870 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetTop(), m_top
, m_unitsTop
, m_positionTopCheckbox
);
871 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetRight(), m_right
, m_unitsRight
, m_positionRightCheckbox
);
872 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetBottom(), m_bottom
, m_unitsBottom
, m_positionBottomCheckbox
);
874 wxTextBoxAttrPosition flags
;
875 if (m_positionMode
== 3)
876 flags
= wxTEXT_BOX_ATTR_POSITION_FIXED
;
877 else if (m_positionMode
== 2)
878 flags
= wxTEXT_BOX_ATTR_POSITION_ABSOLUTE
;
879 else if (m_positionMode
== 1)
880 flags
= wxTEXT_BOX_ATTR_POSITION_RELATIVE
;
882 flags
= wxTEXT_BOX_ATTR_POSITION_STATIC
;
884 if (GetAttributes()->GetTextBoxAttr().GetLeft().IsValid())
885 GetAttributes()->GetTextBoxAttr().GetLeft().SetPosition(flags
);
886 if (GetAttributes()->GetTextBoxAttr().GetTop().IsValid())
887 GetAttributes()->GetTextBoxAttr().GetTop().SetPosition(flags
);
888 if (GetAttributes()->GetTextBoxAttr().GetRight().IsValid())
889 GetAttributes()->GetTextBoxAttr().GetRight().SetPosition(flags
);
890 if (GetAttributes()->GetTextBoxAttr().GetBottom().IsValid())
891 GetAttributes()->GetTextBoxAttr().GetBottom().SetPosition(flags
);
897 * Get bitmap resources
900 wxBitmap
wxRichTextSizePage::GetBitmapResource( const wxString
& name
)
903 ////@begin wxRichTextSizePage bitmap retrieval
906 ////@end wxRichTextSizePage bitmap retrieval
913 wxIcon
wxRichTextSizePage::GetIconResource( const wxString
& name
)
916 ////@begin wxRichTextSizePage icon retrieval
919 ////@end wxRichTextSizePage icon retrieval
924 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH
927 void wxRichTextSizePage::OnRichtextWidthUpdate( wxUpdateUIEvent
& event
)
929 event
.Enable(m_widthCheckbox
->GetValue());
933 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT
936 void wxRichTextSizePage::OnRichtextHeightUpdate( wxUpdateUIEvent
& event
)
938 event
.Enable(m_heightCheckbox
->GetValue());
942 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_PARA_UP
945 void wxRichTextSizePage::OnRichtextParaUpClick( wxCommandEvent
& WXUNUSED(event
) )
947 wxRichTextFormattingDialog
* dialog
= wxRichTextFormattingDialog::GetDialog(this);
948 if (!dialog
|| !dialog
->GetObject())
951 // Make sure object attributes are up-to-date
952 dialog
->TransferDataFromWindow();
954 wxRichTextBuffer
* buffer
= dialog
->GetObject()->GetBuffer();
955 wxRichTextParagraphLayoutBox
* container
= dialog
->GetObject()->GetParentContainer();
956 wxRichTextObject
* parent
= dialog
->GetObject()->GetParent();
957 if (!container
|| !parent
|| !buffer
)
960 wxRichTextRange range
= dialog
->GetObject()->GetRange();
961 wxRichTextObjectList::compatibility_iterator iter
= container
->GetChildren().GetFirst();
967 if (iter
->GetData() == parent
)
969 iter
= iter
->GetNext();
973 iter
= iter
->GetPrevious();
977 wxRichTextObject
*obj
= iter
->GetData();
978 wxRichTextRange rg
= obj
->GetRange();
979 // tempObj will be deleted along with the undo object, and a clone of it will be
980 // returned by InsertObjectWithUndo
981 wxRichTextObject
* tempObj
= dialog
->GetObject()->Clone();
983 container
->DeleteRangeWithUndo(range
, buffer
->GetRichTextCtrl(), buffer
);
985 wxRichTextObject
* obj2
= container
->InsertObjectWithUndo(buffer
, rg
.GetStart(), tempObj
, buffer
->GetRichTextCtrl(), 0);
986 dialog
->SetObject(obj2
);
990 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RICHTEXT_DOWN
993 void wxRichTextSizePage::OnRichtextParaDownClick( wxCommandEvent
& WXUNUSED(event
) )
995 wxRichTextFormattingDialog
* dialog
= wxRichTextFormattingDialog::GetDialog(this);
996 if (!dialog
|| !dialog
->GetObject())
999 // Make sure object attributes are up-to-date
1000 dialog
->TransferDataFromWindow();
1002 wxRichTextBuffer
* buffer
= dialog
->GetObject()->GetBuffer();
1003 wxRichTextParagraphLayoutBox
* container
= dialog
->GetObject()->GetParentContainer();
1004 wxRichTextObject
* parent
= dialog
->GetObject()->GetParent();
1005 if (!container
|| !parent
|| !buffer
)
1008 wxRichTextRange range
= dialog
->GetObject()->GetRange();
1010 wxRichTextObjectList::compatibility_iterator iter
= buffer
->GetChildren().GetFirst();
1016 if (iter
->GetData() == parent
)
1018 iter
= iter
->GetNext();
1021 iter
= iter
->GetNext();
1025 wxRichTextObject
*obj
= iter
->GetData();
1026 wxRichTextRange rg
= obj
->GetRange();
1027 // tempObj will be deleted along with the undo object, and a clone of it will be
1028 // returned by InsertObjectWithUndo
1029 wxRichTextObject
* tempObj
= dialog
->GetObject()->Clone();
1031 container
->DeleteRangeWithUndo(range
, buffer
->GetRichTextCtrl(), buffer
);
1033 // Minus one because we deleted an object
1034 wxRichTextObject
* obj2
= container
->InsertObjectWithUndo(buffer
, rg
.GetStart()-1, tempObj
, buffer
->GetRichTextCtrl(), 0);
1035 dialog
->SetObject(obj2
);
1039 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
1042 void wxRichTextSizePage::OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent
& event
)
1044 event
.Enable(m_verticalAlignmentCheckbox
->GetValue());
1048 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH
1051 void wxRichTextSizePage::OnRichtextMinWidthUpdate( wxUpdateUIEvent
& event
)
1053 event
.Enable(m_minWidthCheckbox
->GetValue());
1057 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT
1060 void wxRichTextSizePage::OnRichtextMinHeightUpdate( wxUpdateUIEvent
& event
)
1062 event
.Enable(m_minHeightCheckbox
->GetValue());
1066 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH
1069 void wxRichTextSizePage::OnRichtextMaxWidthUpdate( wxUpdateUIEvent
& event
)
1071 event
.Enable(m_maxWidthCheckbox
->GetValue());
1075 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT
1078 void wxRichTextSizePage::OnRichtextMaxHeightUpdate( wxUpdateUIEvent
& event
)
1080 event
.Enable(m_maxHeightCheckbox
->GetValue());
1084 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT
1087 void wxRichTextSizePage::OnRichtextLeftUpdate( wxUpdateUIEvent
& event
)
1089 event
.Enable(m_positionLeftCheckbox
->GetValue());
1093 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT
1096 void wxRichTextSizePage::OnRichtextRightUpdate( wxUpdateUIEvent
& event
)
1098 event
.Enable(m_positionRightCheckbox
->GetValue());
1102 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP
1105 void wxRichTextSizePage::OnRichtextTopUpdate( wxUpdateUIEvent
& event
)
1107 event
.Enable(m_positionTopCheckbox
->GetValue());
1111 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM
1114 void wxRichTextSizePage::OnRichtextBottomUpdate( wxUpdateUIEvent
& event
)
1116 event
.Enable(m_positionBottomCheckbox
->GetValue());
1120 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_WIDTH_UNITS
1123 void wxRichTextSizePage::OnRichtextWidthUnitsUpdate( wxUpdateUIEvent
& event
)
1125 event
.Enable(m_widthCheckbox
->GetValue() && sm_enablePositionAndSizeUnits
);
1129 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT_UNITS
1132 void wxRichTextSizePage::OnRichtextHeightUnitsUpdate( wxUpdateUIEvent
& event
)
1134 event
.Enable(m_heightCheckbox
->GetValue() && sm_enablePositionAndSizeUnits
);
1138 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_UNITS
1141 void wxRichTextSizePage::OnRichtextLeftUnitsUpdate( wxUpdateUIEvent
& event
)
1143 event
.Enable(m_positionLeftCheckbox
->GetValue() && sm_enablePositionAndSizeUnits
);
1147 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_UNITS
1150 void wxRichTextSizePage::OnRichtextRightUnitsUpdate( wxUpdateUIEvent
& event
)
1152 event
.Enable(m_positionRightCheckbox
->GetValue() && sm_enablePositionAndSizeUnits
);
1156 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_UNITS
1159 void wxRichTextSizePage::OnRichtextTopUnitsUpdate( wxUpdateUIEvent
& event
)
1161 event
.Enable(m_positionTopCheckbox
->GetValue() && sm_enablePositionAndSizeUnits
);
1165 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_UNITS
1168 void wxRichTextSizePage::OnRichtextBottomUnitsUpdate( wxUpdateUIEvent
& event
)
1170 event
.Enable(m_positionBottomCheckbox
->GetValue() && sm_enablePositionAndSizeUnits
);