]> git.saurik.com Git - wxWidgets.git/blame - src/richtext/richtextmarginspage.cpp
Implement support for button mnemonics in wxOSX/Cocoa.
[wxWidgets.git] / src / richtext / richtextmarginspage.cpp
CommitLineData
603f702b 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/richtext/richtextmarginspage.cpp
603f702b
JS
3// Purpose:
4// Author: Julian Smart
5// Modified by:
6// Created: 20/10/2010 10:27:34
7// RCS-ID:
8// Copyright: (c) Julian Smart
9// Licence:
10/////////////////////////////////////////////////////////////////////////////
11
603f702b
JS
12#include "wx/richtext/richtextmarginspage.h"
13
14////@begin XPM images
15////@end XPM images
16
17
18/*!
19 * wxRichTextMarginsPage type definition
20 */
21
22IMPLEMENT_DYNAMIC_CLASS( wxRichTextMarginsPage, wxRichTextDialogPage )
23
24
25/*!
26 * wxRichTextMarginsPage event table definition
27 */
28
29BEGIN_EVENT_TABLE( wxRichTextMarginsPage, wxRichTextDialogPage )
30
31////@begin wxRichTextMarginsPage event table entries
32 EVT_UPDATE_UI( ID_RICHTEXT_LEFT_MARGIN, wxRichTextMarginsPage::OnRichtextLeftMarginUpdate )
33
34 EVT_UPDATE_UI( ID_RICHTEXT_LEFT_MARGIN_UNITS, wxRichTextMarginsPage::OnRichtextLeftMarginUpdate )
35
36 EVT_UPDATE_UI( ID_RICHTEXT_RIGHT_MARGIN, wxRichTextMarginsPage::OnRichtextRightMarginUpdate )
37
38 EVT_UPDATE_UI( ID_RICHTEXT_RIGHT_MARGIN_UNITS, wxRichTextMarginsPage::OnRichtextRightMarginUpdate )
39
40 EVT_UPDATE_UI( ID_RICHTEXT_TOP_MARGIN, wxRichTextMarginsPage::OnRichtextTopMarginUpdate )
41
42 EVT_UPDATE_UI( ID_RICHTEXT_TOP_MARGIN_UNITS, wxRichTextMarginsPage::OnRichtextTopMarginUpdate )
43
44 EVT_UPDATE_UI( ID_RICHTEXT_BOTTOM_MARGIN, wxRichTextMarginsPage::OnRichtextBottomMarginUpdate )
45
46 EVT_UPDATE_UI( ID_RICHTEXT_BOTTOM_MARGIN_UNITS, wxRichTextMarginsPage::OnRichtextBottomMarginUpdate )
47
48 EVT_UPDATE_UI( ID_RICHTEXT_LEFT_PADDING, wxRichTextMarginsPage::OnRichtextLeftPaddingUpdate )
49
50 EVT_UPDATE_UI( ID_RICHTEXT_LEFT_PADDING_UNITS, wxRichTextMarginsPage::OnRichtextLeftPaddingUpdate )
51
52 EVT_UPDATE_UI( ID_RICHTEXT_RIGHT_PADDING, wxRichTextMarginsPage::OnRichtextRightPaddingUpdate )
53
54 EVT_UPDATE_UI( ID_RICHTEXT_RIGHT_PADDING_UNITS, wxRichTextMarginsPage::OnRichtextRightPaddingUpdate )
55
56 EVT_UPDATE_UI( ID_RICHTEXT_TOP_PADDING, wxRichTextMarginsPage::OnRichtextTopPaddingUpdate )
57
58 EVT_UPDATE_UI( ID_RICHTEXT_TOP_PADDING_UNITS, wxRichTextMarginsPage::OnRichtextTopPaddingUpdate )
59
60 EVT_UPDATE_UI( ID_RICHTEXT_BOTTOM_PADDING, wxRichTextMarginsPage::OnRichtextBottomPaddingUpdate )
61
62 EVT_UPDATE_UI( ID_RICHTEXT_BOTTOM_PADDING_UNITS, wxRichTextMarginsPage::OnRichtextBottomPaddingUpdate )
63
64////@end wxRichTextMarginsPage event table entries
65
66END_EVENT_TABLE()
67
68IMPLEMENT_HELP_PROVISION(wxRichTextMarginsPage)
69
70/*!
71 * wxRichTextMarginsPage constructors
72 */
73
74wxRichTextMarginsPage::wxRichTextMarginsPage()
75{
76 Init();
77}
78
79wxRichTextMarginsPage::wxRichTextMarginsPage( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
80{
81 Init();
82 Create(parent, id, pos, size, style);
83}
84
85
86/*!
87 * wxRichTextMarginsPage creator
88 */
89
90bool wxRichTextMarginsPage::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
91{
92////@begin wxRichTextMarginsPage creation
93 wxRichTextDialogPage::Create( parent, id, pos, size, style );
94
95 CreateControls();
96 if (GetSizer())
97 {
98 GetSizer()->SetSizeHints(this);
99 }
100 Centre();
101////@end wxRichTextMarginsPage creation
102 return true;
103}
104
105
106/*!
107 * wxRichTextMarginsPage destructor
108 */
109
110wxRichTextMarginsPage::~wxRichTextMarginsPage()
111{
112////@begin wxRichTextMarginsPage destruction
113////@end wxRichTextMarginsPage destruction
114}
115
116
117/*!
118 * Member initialisation
119 */
120
121void wxRichTextMarginsPage::Init()
122{
123 m_ignoreUpdates = false;
124
125////@begin wxRichTextMarginsPage member initialisation
126 m_leftMarginCheckbox = NULL;
127 m_marginLeft = NULL;
128 m_unitsMarginLeft = NULL;
129 m_rightMarginCheckbox = NULL;
130 m_marginRight = NULL;
131 m_unitsMarginRight = NULL;
132 m_topMarginCheckbox = NULL;
133 m_marginTop = NULL;
134 m_unitsMarginTop = NULL;
135 m_bottomMarginCheckbox = NULL;
136 m_marginBottom = NULL;
137 m_unitsMarginBottom = NULL;
138 m_leftPaddingCheckbox = NULL;
139 m_paddingLeft = NULL;
140 m_unitsPaddingLeft = NULL;
141 m_rightPaddingCheckbox = NULL;
142 m_paddingRight = NULL;
143 m_unitsPaddingRight = NULL;
144 m_topPaddingCheckbox = NULL;
145 m_paddingTop = NULL;
146 m_unitsPaddingTop = NULL;
147 m_bottomPaddingCheckbox = NULL;
148 m_paddingBottom = NULL;
149 m_unitsPaddingBottom = NULL;
150////@end wxRichTextMarginsPage member initialisation
151}
152
153
154/*!
155 * Control creation for wxRichTextMarginsPage
156 */
157
158void wxRichTextMarginsPage::CreateControls()
159{
160////@begin wxRichTextMarginsPage content construction
161 wxRichTextMarginsPage* itemRichTextDialogPage1 = this;
162
163 wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
164 itemRichTextDialogPage1->SetSizer(itemBoxSizer2);
165
166 wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
167 itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);
168
169 wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
170 itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW, 5);
171
172 wxStaticText* itemStaticText5 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Margins"), wxDefaultPosition, wxDefaultSize, 0 );
173 itemStaticText5->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("")));
174 itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
175
176 wxStaticLine* itemStaticLine6 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
177 itemBoxSizer4->Add(itemStaticLine6, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
178
179 wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
180 itemBoxSizer3->Add(itemBoxSizer7, 0, wxGROW, 5);
181
182 itemBoxSizer7->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
183
184 wxFlexGridSizer* itemFlexGridSizer9 = new wxFlexGridSizer(0, 4, 0, 0);
185 itemBoxSizer7->Add(itemFlexGridSizer9, 0, wxALIGN_CENTER_VERTICAL, 5);
186
187 m_leftMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_MARGIN_CHECKBOX, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 );
188 m_leftMarginCheckbox->SetValue(false);
189 itemFlexGridSizer9->Add(m_leftMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
190
191 wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
192 itemFlexGridSizer9->Add(itemBoxSizer11, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
193
194 m_marginLeft = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
195 m_marginLeft->SetHelpText(_("The left margin size."));
196 if (wxRichTextMarginsPage::ShowToolTips())
197 m_marginLeft->SetToolTip(_("The left margin size."));
198 itemBoxSizer11->Add(m_marginLeft, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
199
200 wxArrayString m_unitsMarginLeftStrings;
201 m_unitsMarginLeftStrings.Add(_("px"));
202 m_unitsMarginLeftStrings.Add(_("cm"));
203 m_unitsMarginLeft = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginLeftStrings, wxCB_READONLY );
204 m_unitsMarginLeft->SetStringSelection(_("px"));
205 m_unitsMarginLeft->SetHelpText(_("Units for the left margin."));
206 if (wxRichTextMarginsPage::ShowToolTips())
207 m_unitsMarginLeft->SetToolTip(_("Units for the left margin."));
208 itemBoxSizer11->Add(m_unitsMarginLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
209
210 itemBoxSizer11->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
211
212 m_rightMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_MARGIN_CHECKBOX, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 );
213 m_rightMarginCheckbox->SetValue(false);
214 itemFlexGridSizer9->Add(m_rightMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
215
216 wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL);
217 itemFlexGridSizer9->Add(itemBoxSizer16, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
218
219 m_marginRight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
220 m_marginRight->SetHelpText(_("The right margin size."));
221 if (wxRichTextMarginsPage::ShowToolTips())
222 m_marginRight->SetToolTip(_("The right margin size."));
223 itemBoxSizer16->Add(m_marginRight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
224
225 wxArrayString m_unitsMarginRightStrings;
226 m_unitsMarginRightStrings.Add(_("px"));
227 m_unitsMarginRightStrings.Add(_("cm"));
228 m_unitsMarginRight = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginRightStrings, wxCB_READONLY );
229 m_unitsMarginRight->SetStringSelection(_("px"));
230 m_unitsMarginRight->SetHelpText(_("Units for the right margin."));
231 if (wxRichTextMarginsPage::ShowToolTips())
232 m_unitsMarginRight->SetToolTip(_("Units for the right margin."));
233 itemBoxSizer16->Add(m_unitsMarginRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
234
235 m_topMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_MARGIN_CHECKBOX, _("&Top:"), wxDefaultPosition, wxDefaultSize, 0 );
236 m_topMarginCheckbox->SetValue(false);
237 itemFlexGridSizer9->Add(m_topMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
238
239 wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
240 itemFlexGridSizer9->Add(itemBoxSizer20, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
241
242 m_marginTop = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_TOP_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
243 m_marginTop->SetHelpText(_("The top margin size."));
244 if (wxRichTextMarginsPage::ShowToolTips())
245 m_marginTop->SetToolTip(_("The top margin size."));
246 itemBoxSizer20->Add(m_marginTop, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
247
248 wxArrayString m_unitsMarginTopStrings;
249 m_unitsMarginTopStrings.Add(_("px"));
250 m_unitsMarginTopStrings.Add(_("cm"));
251 m_unitsMarginTop = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginTopStrings, wxCB_READONLY );
252 m_unitsMarginTop->SetStringSelection(_("px"));
253 m_unitsMarginTop->SetHelpText(_("Units for the top margin."));
254 if (wxRichTextMarginsPage::ShowToolTips())
255 m_unitsMarginTop->SetToolTip(_("Units for the top margin."));
256 itemBoxSizer20->Add(m_unitsMarginTop, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
257
258 itemBoxSizer20->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
259
260 m_bottomMarginCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_MARGIN_CHECKBOX, _("&Bottom:"), wxDefaultPosition, wxDefaultSize, 0 );
261 m_bottomMarginCheckbox->SetValue(false);
262 itemFlexGridSizer9->Add(m_bottomMarginCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
263
264 wxBoxSizer* itemBoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
265 itemFlexGridSizer9->Add(itemBoxSizer25, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
266
267 m_marginBottom = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_MARGIN, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
268 m_marginBottom->SetHelpText(_("The bottom margin size."));
269 if (wxRichTextMarginsPage::ShowToolTips())
270 m_marginBottom->SetToolTip(_("The bottom margin size."));
271 itemBoxSizer25->Add(m_marginBottom, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
272
273 wxArrayString m_unitsMarginBottomStrings;
274 m_unitsMarginBottomStrings.Add(_("px"));
275 m_unitsMarginBottomStrings.Add(_("cm"));
276 m_unitsMarginBottom = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_MARGIN_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMarginBottomStrings, wxCB_READONLY );
277 m_unitsMarginBottom->SetStringSelection(_("px"));
278 m_unitsMarginBottom->SetHelpText(_("Units for the bottom margin."));
279 if (wxRichTextMarginsPage::ShowToolTips())
280 m_unitsMarginBottom->SetToolTip(_("Units for the bottom margin."));
281 itemBoxSizer25->Add(m_unitsMarginBottom, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
282
283 wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
284 itemBoxSizer3->Add(itemBoxSizer28, 0, wxGROW, 5);
285
286 wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Padding"), wxDefaultPosition, wxDefaultSize, 0 );
287 itemStaticText29->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("")));
288 itemBoxSizer28->Add(itemStaticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
289
290 wxStaticLine* itemStaticLine30 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
291 itemBoxSizer28->Add(itemStaticLine30, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
292
293 wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxHORIZONTAL);
294 itemBoxSizer3->Add(itemBoxSizer31, 0, wxGROW, 5);
295
296 itemBoxSizer31->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
297
298 wxFlexGridSizer* itemFlexGridSizer33 = new wxFlexGridSizer(0, 4, 0, 0);
299 itemBoxSizer31->Add(itemFlexGridSizer33, 0, wxALIGN_CENTER_VERTICAL, 5);
300
301 m_leftPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_PADDING_CHECKBOX, _("&Left:"), wxDefaultPosition, wxDefaultSize, 0 );
302 m_leftPaddingCheckbox->SetValue(false);
303 itemFlexGridSizer33->Add(m_leftPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
304
305 wxBoxSizer* itemBoxSizer35 = new wxBoxSizer(wxHORIZONTAL);
306 itemFlexGridSizer33->Add(itemBoxSizer35, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
307
308 m_paddingLeft = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
309 m_paddingLeft->SetHelpText(_("The left padding size."));
310 if (wxRichTextMarginsPage::ShowToolTips())
311 m_paddingLeft->SetToolTip(_("The left padding size."));
312 itemBoxSizer35->Add(m_paddingLeft, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
313
314 wxArrayString m_unitsPaddingLeftStrings;
315 m_unitsPaddingLeftStrings.Add(_("px"));
316 m_unitsPaddingLeftStrings.Add(_("cm"));
317 m_unitsPaddingLeft = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_LEFT_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingLeftStrings, wxCB_READONLY );
318 m_unitsPaddingLeft->SetStringSelection(_("px"));
319 m_unitsPaddingLeft->SetHelpText(_("Units for the left padding."));
320 if (wxRichTextMarginsPage::ShowToolTips())
321 m_unitsPaddingLeft->SetToolTip(_("Units for the left padding."));
322 itemBoxSizer35->Add(m_unitsPaddingLeft, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
323
324 itemBoxSizer35->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
325
326 m_rightPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_PADDING_CHECKBOX, _("&Right:"), wxDefaultPosition, wxDefaultSize, 0 );
327 m_rightPaddingCheckbox->SetValue(false);
328 itemFlexGridSizer33->Add(m_rightPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
329
330 wxBoxSizer* itemBoxSizer40 = new wxBoxSizer(wxHORIZONTAL);
331 itemFlexGridSizer33->Add(itemBoxSizer40, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
332
333 m_paddingRight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
334 m_paddingRight->SetHelpText(_("The right padding size."));
335 if (wxRichTextMarginsPage::ShowToolTips())
336 m_paddingRight->SetToolTip(_("The right padding size."));
337 itemBoxSizer40->Add(m_paddingRight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
338
339 wxArrayString m_unitsPaddingRightStrings;
340 m_unitsPaddingRightStrings.Add(_("px"));
341 m_unitsPaddingRightStrings.Add(_("cm"));
342 m_unitsPaddingRight = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_RIGHT_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingRightStrings, wxCB_READONLY );
343 m_unitsPaddingRight->SetStringSelection(_("px"));
344 m_unitsPaddingRight->SetHelpText(_("Units for the right padding."));
345 if (wxRichTextMarginsPage::ShowToolTips())
346 m_unitsPaddingRight->SetToolTip(_("Units for the right padding."));
347 itemBoxSizer40->Add(m_unitsPaddingRight, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
348
349 m_topPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_PADDING_CHECKBOX, _("&Top:"), wxDefaultPosition, wxDefaultSize, 0 );
350 m_topPaddingCheckbox->SetValue(false);
351 itemFlexGridSizer33->Add(m_topPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
352
353 wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxHORIZONTAL);
354 itemFlexGridSizer33->Add(itemBoxSizer44, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
355
356 m_paddingTop = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_TOP_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
357 m_paddingTop->SetHelpText(_("The top padding size."));
358 if (wxRichTextMarginsPage::ShowToolTips())
359 m_paddingTop->SetToolTip(_("The top padding size."));
360 itemBoxSizer44->Add(m_paddingTop, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
361
362 wxArrayString m_unitsPaddingTopStrings;
363 m_unitsPaddingTopStrings.Add(_("px"));
364 m_unitsPaddingTopStrings.Add(_("cm"));
365 m_unitsPaddingTop = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_TOP_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingTopStrings, wxCB_READONLY );
366 m_unitsPaddingTop->SetStringSelection(_("px"));
367 m_unitsPaddingTop->SetHelpText(_("Units for the top padding."));
368 if (wxRichTextMarginsPage::ShowToolTips())
369 m_unitsPaddingTop->SetToolTip(_("Units for the top padding."));
370 itemBoxSizer44->Add(m_unitsPaddingTop, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
371
372 itemBoxSizer44->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
373
374 m_bottomPaddingCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_PADDING_CHECKBOX, _("&Bottom:"), wxDefaultPosition, wxDefaultSize, 0 );
375 m_bottomPaddingCheckbox->SetValue(false);
376 itemFlexGridSizer33->Add(m_bottomPaddingCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
377
378 wxBoxSizer* itemBoxSizer49 = new wxBoxSizer(wxHORIZONTAL);
379 itemFlexGridSizer33->Add(itemBoxSizer49, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
380
381 m_paddingBottom = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_PADDING, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 );
382 m_paddingBottom->SetHelpText(_("The bottom padding size."));
383 if (wxRichTextMarginsPage::ShowToolTips())
384 m_paddingBottom->SetToolTip(_("The bottom padding size."));
385 itemBoxSizer49->Add(m_paddingBottom, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
386
387 wxArrayString m_unitsPaddingBottomStrings;
388 m_unitsPaddingBottomStrings.Add(_("px"));
389 m_unitsPaddingBottomStrings.Add(_("cm"));
390 m_unitsPaddingBottom = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_BOTTOM_PADDING_UNITS, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsPaddingBottomStrings, wxCB_READONLY );
391 m_unitsPaddingBottom->SetStringSelection(_("px"));
392 m_unitsPaddingBottom->SetHelpText(_("Units for the bottom padding."));
393 if (wxRichTextMarginsPage::ShowToolTips())
394 m_unitsPaddingBottom->SetToolTip(_("Units for the bottom padding."));
395 itemBoxSizer49->Add(m_unitsPaddingBottom, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
396
397////@end wxRichTextMarginsPage content construction
398}
399
400wxRichTextAttr* wxRichTextMarginsPage::GetAttributes()
401{
402 return wxRichTextFormattingDialog::GetDialogAttributes(this);
403}
404
405/*!
406 * Should we show tooltips?
407 */
408
409bool wxRichTextMarginsPage::ShowToolTips()
410{
411 return true;
412}
413
414bool wxRichTextMarginsPage::TransferDataToWindow()
415{
416 // Margins
417 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetLeft(), m_marginLeft, m_unitsMarginLeft, m_leftMarginCheckbox);
418 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetTop(), m_marginTop, m_unitsMarginTop, m_topMarginCheckbox);
419 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetRight(), m_marginRight, m_unitsMarginRight, m_rightMarginCheckbox);
420 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetBottom(), m_marginBottom, m_unitsMarginBottom, m_bottomMarginCheckbox);
421
422 // Padding
423 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetLeft(), m_paddingLeft, m_unitsPaddingLeft, m_leftPaddingCheckbox);
424 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetTop(), m_paddingTop, m_unitsPaddingTop, m_topPaddingCheckbox);
425 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetRight(), m_paddingRight, m_unitsPaddingRight, m_rightPaddingCheckbox);
426 wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetBottom(), m_paddingBottom, m_unitsPaddingBottom, m_bottomPaddingCheckbox);
427
428 return true;
429}
430
431bool wxRichTextMarginsPage::TransferDataFromWindow()
432{
433 // Margins
434 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetLeft(), m_marginLeft, m_unitsMarginLeft, m_leftMarginCheckbox);
435 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetTop(), m_marginTop, m_unitsMarginTop, m_topMarginCheckbox);
436 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetRight(), m_marginRight, m_unitsMarginRight, m_rightMarginCheckbox);
437 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMargins().GetBottom(), m_marginBottom, m_unitsMarginBottom, m_bottomMarginCheckbox);
438
439 // Padding
440 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetLeft(), m_paddingLeft, m_unitsPaddingLeft, m_leftPaddingCheckbox);
441 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetTop(), m_paddingTop, m_unitsPaddingTop, m_topPaddingCheckbox);
442 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetRight(), m_paddingRight, m_unitsPaddingRight, m_rightPaddingCheckbox);
443 wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetPadding().GetBottom(), m_paddingBottom, m_unitsPaddingBottom, m_bottomPaddingCheckbox);
444
445 return true;
446}
447
448/*!
449 * Get bitmap resources
450 */
451
452wxBitmap wxRichTextMarginsPage::GetBitmapResource( const wxString& name )
453{
454 // Bitmap retrieval
455////@begin wxRichTextMarginsPage bitmap retrieval
456 wxUnusedVar(name);
457 return wxNullBitmap;
458////@end wxRichTextMarginsPage bitmap retrieval
459}
460
461/*!
462 * Get icon resources
463 */
464
465wxIcon wxRichTextMarginsPage::GetIconResource( const wxString& name )
466{
467 // Icon retrieval
468////@begin wxRichTextMarginsPage icon retrieval
469 wxUnusedVar(name);
470 return wxNullIcon;
471////@end wxRichTextMarginsPage icon retrieval
472}
473
474
475/*!
476 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_MARGIN
477 */
478
479void wxRichTextMarginsPage::OnRichtextLeftMarginUpdate( wxUpdateUIEvent& event )
480{
481 event.Enable(m_leftMarginCheckbox->GetValue());
482}
483
484
485/*!
486 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_MARGIN
487 */
488
489void wxRichTextMarginsPage::OnRichtextRightMarginUpdate( wxUpdateUIEvent& event )
490{
491 event.Enable(m_rightMarginCheckbox->GetValue());
492}
493
494/*!
495 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_MARGIN
496 */
497
498void wxRichTextMarginsPage::OnRichtextTopMarginUpdate( wxUpdateUIEvent& event )
499{
500 event.Enable(m_topMarginCheckbox->GetValue());
501}
502
503/*!
504 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_MARGIN
505 */
506
507void wxRichTextMarginsPage::OnRichtextBottomMarginUpdate( wxUpdateUIEvent& event )
508{
509 event.Enable(m_bottomMarginCheckbox->GetValue());
510}
511
512
513/*!
514 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_LEFT_PADDING
515 */
516
517void wxRichTextMarginsPage::OnRichtextLeftPaddingUpdate( wxUpdateUIEvent& event )
518{
519 event.Enable(m_leftPaddingCheckbox->GetValue());
520}
521
522
523/*!
524 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_RIGHT_PADDING
525 */
526
527void wxRichTextMarginsPage::OnRichtextRightPaddingUpdate( wxUpdateUIEvent& event )
528{
529 event.Enable(m_rightPaddingCheckbox->GetValue());
530}
531
532
533/*!
534 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_TOP_PADDING
535 */
536
537void wxRichTextMarginsPage::OnRichtextTopPaddingUpdate( wxUpdateUIEvent& event )
538{
539 event.Enable(m_topPaddingCheckbox->GetValue());
540}
541
542/*!
543 * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_BOTTOM_PADDING
544 */
545
546void wxRichTextMarginsPage::OnRichtextBottomPaddingUpdate( wxUpdateUIEvent& event )
547{
548 event.Enable(m_bottomPaddingCheckbox->GetValue());
549}