1 /////////////////////////////////////////////////////////////////////////////
2 // Program: wxWidgets Widgets Sample
3 // Name: samples/widgets/widgets.cpp
4 // Purpose: Sample showing most of the simple wxWidgets widgets
5 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 Vadim Zeitlin
9 // License: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // for compilers that support precompilation, includes "wx/wx.h".
21 #include "wx/wxprec.h"
27 // for all others, include the necessary headers
34 #include "wx/button.h"
35 #include "wx/checkbox.h"
36 #include "wx/listbox.h"
37 #include "wx/statbox.h"
38 #include "wx/stattext.h"
39 #include "wx/textctrl.h"
40 #include "wx/msgdlg.h"
43 #include "wx/sysopt.h"
44 #include "wx/bookctrl.h"
45 #include "wx/treebook.h"
47 #include "wx/colordlg.h"
48 #include "wx/fontdlg.h"
49 #include "wx/textdlg.h"
50 #include "wx/imaglist.h"
51 #include "wx/wupdlock.h"
55 #include "../sample.xpm"
57 // ----------------------------------------------------------------------------
59 // ----------------------------------------------------------------------------
64 Widgets_ClearLog
= 100,
71 #endif // wxUSE_TOOLTIPS
83 Widgets_BorderDefault
,
86 Widgets_GoToPageLast
= Widgets_GoToPage
+ 100
89 const wxChar
*WidgetsCategories
[MAX_PAGES
] = {
90 #if defined(__WXUNIVERSAL__)
104 // ----------------------------------------------------------------------------
106 // ----------------------------------------------------------------------------
108 // Define a new application type, each program should derive a class from wxApp
109 class WidgetsApp
: public wxApp
112 // override base class virtuals
113 // ----------------------------
115 // this one is called on application startup and is a good place for the app
116 // initialization (doing it here and not in the ctor allows to have an error
117 // return: if OnInit() returns false, the application terminates)
118 virtual bool OnInit();
121 // Define a new frame type: this is going to be our main frame
122 class WidgetsFrame
: public wxFrame
126 WidgetsFrame(const wxString
& title
);
127 virtual ~WidgetsFrame();
132 void OnButtonClearLog(wxCommandEvent
& event
);
134 void OnExit(wxCommandEvent
& event
);
137 void OnPageChanged(WidgetsBookCtrlEvent
& event
);
138 void OnGoToPage(wxCommandEvent
& event
);
141 void OnSetTooltip(wxCommandEvent
& event
);
142 #endif // wxUSE_TOOLTIPS
143 void OnSetFgCol(wxCommandEvent
& event
);
144 void OnSetBgCol(wxCommandEvent
& event
);
145 void OnSetFont(wxCommandEvent
& event
);
146 void OnEnable(wxCommandEvent
& event
);
147 void OnSetBorder(wxCommandEvent
& event
);
148 #endif // wxUSE_MENUS
150 // initialize the book: add all pages to it
153 // finding current page assuming book inside book
154 WidgetsPage
*CurrentPage();
157 // the panel containing everything
161 // the listbox for logging messages
162 wxListBox
*m_lboxLog
;
164 // the log target we use to redirect messages to the listbox
168 // the book containing the test pages
169 WidgetsBookCtrl
*m_book
;
172 // last chosen fg/bg colours and font
176 #endif // wxUSE_MENUS
178 // any class wishing to process wxWidgets events must use this macro
179 DECLARE_EVENT_TABLE()
183 // A log target which just redirects the messages to a listbox
184 class LboxLogger
: public wxLog
187 LboxLogger(wxListBox
*lbox
, wxLog
*logOld
)
190 //m_lbox->Disable(); -- looks ugly under MSW
194 virtual ~LboxLogger()
196 wxLog::SetActiveTarget(m_logOld
);
200 // implement sink functions
201 virtual void DoLog(wxLogLevel level
, const wxChar
*szString
, time_t t
)
203 // don't put trace messages into listbox or we can get into infinite
205 if ( level
== wxLOG_Trace
)
209 // cast is needed to call protected method
210 ((LboxLogger
*)m_logOld
)->DoLog(level
, szString
, t
);
215 wxLog::DoLog(level
, szString
, t
);
219 virtual void DoLogString(const wxChar
*szString
, time_t WXUNUSED(t
))
225 #ifdef __WXUNIVERSAL__
226 m_lbox
->AppendAndEnsureVisible(msg
);
227 #else // other ports don't have this method yet
229 m_lbox
->SetFirstItem(m_lbox
->GetCount() - 1);
233 // the control we use
236 // the old log target
242 WX_DEFINE_ARRAY_PTR(WidgetsPage
*, ArrayWidgetsPage
);
244 // ----------------------------------------------------------------------------
246 // ----------------------------------------------------------------------------
248 IMPLEMENT_APP(WidgetsApp
)
250 // ----------------------------------------------------------------------------
252 // ----------------------------------------------------------------------------
254 BEGIN_EVENT_TABLE(WidgetsFrame
, wxFrame
)
256 EVT_BUTTON(Widgets_ClearLog
, WidgetsFrame::OnButtonClearLog
)
258 EVT_BUTTON(Widgets_Quit
, WidgetsFrame::OnExit
)
261 EVT_MENU(Widgets_SetTooltip
, WidgetsFrame::OnSetTooltip
)
262 #endif // wxUSE_TOOLTIPS
265 EVT_WIDGETS_PAGE_CHANGED(wxID_ANY
, WidgetsFrame::OnPageChanged
)
266 EVT_MENU_RANGE(Widgets_GoToPage
, Widgets_GoToPageLast
,
267 WidgetsFrame::OnGoToPage
)
269 EVT_MENU(Widgets_SetFgColour
, WidgetsFrame::OnSetFgCol
)
270 EVT_MENU(Widgets_SetBgColour
, WidgetsFrame::OnSetBgCol
)
271 EVT_MENU(Widgets_SetFont
, WidgetsFrame::OnSetFont
)
272 EVT_MENU(Widgets_Enable
, WidgetsFrame::OnEnable
)
274 EVT_MENU_RANGE(Widgets_BorderNone
, Widgets_BorderDefault
,
275 WidgetsFrame::OnSetBorder
)
277 EVT_MENU(wxID_EXIT
, WidgetsFrame::OnExit
)
278 #endif // wxUSE_MENUS
281 // ============================================================================
283 // ============================================================================
285 // ----------------------------------------------------------------------------
287 // ----------------------------------------------------------------------------
289 bool WidgetsApp::OnInit()
291 if ( !wxApp::OnInit() )
294 // the reason for having these ifdef's is that I often run two copies of
295 // this sample side by side and it is useful to see which one is which
297 #if defined(__WXUNIVERSAL__)
298 title
= _T("wxUniv/");
301 #if defined(__WXMSW__)
302 title
+= _T("wxMSW");
303 #elif defined(__WXGTK__)
304 title
+= _T("wxGTK");
305 #elif defined(__WXMAC__)
306 title
+= _T("wxMAC");
307 #elif defined(__WXMOTIF__)
308 title
+= _T("wxMOTIF");
310 title
+= _T("wxWidgets");
313 wxFrame
*frame
= new WidgetsFrame(title
+ _T(" widgets demo"));
316 //wxLog::AddTraceMask(_T("listbox"));
317 //wxLog::AddTraceMask(_T("scrollbar"));
318 //wxLog::AddTraceMask(_T("focus"));
323 // ----------------------------------------------------------------------------
324 // WidgetsFrame construction
325 // ----------------------------------------------------------------------------
327 WidgetsFrame::WidgetsFrame(const wxString
& title
)
328 : wxFrame(NULL
, wxID_ANY
, title
,
329 wxDefaultPosition
, wxDefaultSize
,
330 wxDEFAULT_FRAME_STYLE
|
331 wxNO_FULL_REPAINT_ON_RESIZE
|
335 // set the frame icon
336 SetIcon(wxICON(sample
));
340 m_lboxLog
= (wxListBox
*)NULL
;
341 m_logTarget
= (wxLog
*)NULL
;
343 m_book
= (WidgetsBookCtrl
*)NULL
;
346 // create the menubar
347 wxMenuBar
*mbar
= new wxMenuBar
;
348 wxMenu
*menuWidget
= new wxMenu
;
350 menuWidget
->Append(Widgets_SetTooltip
, _T("Set &tooltip...\tCtrl-T"));
351 menuWidget
->AppendSeparator();
352 #endif // wxUSE_TOOLTIPS
353 menuWidget
->Append(Widgets_SetFgColour
, _T("Set &foreground...\tCtrl-F"));
354 menuWidget
->Append(Widgets_SetBgColour
, _T("Set &background...\tCtrl-B"));
355 menuWidget
->Append(Widgets_SetFont
, _T("Set f&ont...\tCtrl-O"));
356 menuWidget
->AppendCheckItem(Widgets_Enable
, _T("&Enable/disable\tCtrl-E"));
358 wxMenu
*menuBorders
= new wxMenu
;
359 menuBorders
->AppendRadioItem(Widgets_BorderDefault
, _T("De&fault\tCtrl-Shift-9"));
360 menuBorders
->AppendRadioItem(Widgets_BorderNone
, _T("&None\tCtrl-Shift-0"));
361 menuBorders
->AppendRadioItem(Widgets_BorderSimple
, _T("&Simple\tCtrl-Shift-1"));
362 menuBorders
->AppendRadioItem(Widgets_BorderDouble
, _T("&Double\tCtrl-Shift-2"));
363 menuBorders
->AppendRadioItem(Widgets_BorderStatic
, _T("Stati&c\tCtrl-Shift-3"));
364 menuBorders
->AppendRadioItem(Widgets_BorderRaised
, _T("&Raised\tCtrl-Shift-4"));
365 menuBorders
->AppendRadioItem(Widgets_BorderSunken
, _T("S&unken\tCtrl-Shift-5"));
366 menuWidget
->AppendSubMenu(menuBorders
, _T("Set &border"));
368 menuWidget
->AppendSeparator();
369 menuWidget
->Append(wxID_EXIT
, _T("&Quit\tCtrl-Q"));
370 mbar
->Append(menuWidget
, _T("&Widget"));
373 mbar
->Check(Widgets_Enable
, true);
374 #endif // wxUSE_MENUS
377 m_panel
= new wxPanel(this, wxID_ANY
,
378 wxDefaultPosition
, wxDefaultSize
, wxCLIP_CHILDREN
);
380 wxSizer
*sizerTop
= new wxBoxSizer(wxVERTICAL
);
382 // we have 2 panes: book with pages demonstrating the controls in the
383 // upper one and the log window with some buttons in the lower
385 int style
= wxNO_FULL_REPAINT_ON_RESIZE
|wxCLIP_CHILDREN
|wxBK_DEFAULT
;
386 // Uncomment to suppress page theme (draw in solid colour)
387 //style |= wxNB_NOPAGETHEME;
389 m_book
= new WidgetsBookCtrl(m_panel
, Widgets_BookCtrl
, wxDefaultPosition
,
391 wxSize(500, wxDefaultCoord
), // under Motif, height is a function of the width...
398 #ifndef __WXHANDHELD__
399 // the lower one only has the log listbox and a button to clear it
401 wxSizer
*sizerDown
= new wxStaticBoxSizer(
402 new wxStaticBox( m_panel
, wxID_ANY
, _T("&Log window") ),
405 m_lboxLog
= new wxListBox(m_panel
, wxID_ANY
);
406 sizerDown
->Add(m_lboxLog
, 1, wxGROW
| wxALL
, 5);
407 sizerDown
->SetMinSize(100, 150);
409 wxSizer
*sizerDown
= new wxBoxSizer(wxVERTICAL
);
412 wxBoxSizer
*sizerBtns
= new wxBoxSizer(wxHORIZONTAL
);
415 btn
= new wxButton(m_panel
, Widgets_ClearLog
, _T("Clear &log"));
417 sizerBtns
->Add(10, 0); // spacer
419 btn
= new wxButton(m_panel
, Widgets_Quit
, _T("E&xit"));
421 sizerDown
->Add(sizerBtns
, 0, wxALL
| wxALIGN_RIGHT
, 5);
423 // put everything together
424 sizerTop
->Add(m_book
, 1, wxGROW
| (wxALL
& ~(wxTOP
| wxBOTTOM
)), 10);
425 sizerTop
->Add(0, 5, 0, wxGROW
); // spacer in between
426 sizerTop
->Add(sizerDown
, 0, wxGROW
| (wxALL
& ~wxTOP
), 10);
428 #else // !__WXHANDHELD__/__WXHANDHELD__
430 sizerTop
->Add(m_book
, 1, wxGROW
| wxALL
);
432 #endif // __WXHANDHELD__
434 m_panel
->SetSizer(sizerTop
);
437 sizerTop
->SetSizeHints(this);
439 #if USE_LOG && !defined(__WXCOCOA__)
440 // wxCocoa's listbox is too flakey to use for logging right now
441 // now that everything is created we can redirect the log messages to the
443 m_logTarget
= new LboxLogger(m_lboxLog
, wxLog::GetActiveTarget());
444 wxLog::SetActiveTarget(m_logTarget
);
448 void WidgetsFrame::InitBook()
450 #if USE_ICONS_IN_BOOK
451 wxImageList
*imageList
= new wxImageList(32, 32);
453 imageList
->Add(wxBitmap(sample_xpm
));
455 wxImageList
*imageList
= NULL
;
459 WidgetsBookCtrl
*books
[MAX_PAGES
];
462 ArrayWidgetsPage pages
[MAX_PAGES
];
463 wxArrayString labels
[MAX_PAGES
];
465 wxMenu
*menuPages
= new wxMenu
;
466 unsigned int nPage
= 0, nFKey
= 0;
467 int cat
, imageId
= 1;
469 // we need to first create all pages and only then add them to the book
470 // as we need the image list first
472 // we also construct the pages menu during this first iteration
473 for ( cat
= 0; cat
< MAX_PAGES
; cat
++ )
476 nPage
++; // increase for parent page
478 books
[cat
] = new WidgetsBookCtrl(m_book
,
485 for ( WidgetsPageInfo
*info
= WidgetsPage::ms_widgetPages
;
487 info
= info
->GetNext() )
489 if( (info
->GetCategories() & ( 1 << cat
)) == 0)
492 WidgetsPage
*page
= (*info
->GetCtor())(
499 pages
[cat
].Add(page
);
501 labels
[cat
].Add(info
->GetLabel());
502 if ( cat
== ALL_PAGE
)
504 wxString
radioLabel(info
->GetLabel());
508 radioLabel
<< wxT("\tF" ) << nFKey
;
511 menuPages
->AppendRadioItem(
512 Widgets_GoToPage
+ nPage
,
516 // consider only for book in book architecture
522 // consider only for treebook architecture (with subpages)
528 GetMenuBar()->Append(menuPages
, _T("&Page"));
530 #if USE_ICONS_IN_BOOK
531 m_book
->AssignImageList(imageList
);
534 for ( cat
= 0; cat
< MAX_PAGES
; cat
++ )
537 m_book
->AddPage(NULL
,WidgetsCategories
[cat
],false,0);
539 m_book
->AddPage(books
[cat
],WidgetsCategories
[cat
],false,0);
540 #if USE_ICONS_IN_BOOK
541 books
[cat
]->SetImageList(imageList
);
546 size_t count
= pages
[cat
].GetCount();
547 for ( size_t n
= 0; n
< count
; n
++ )
556 false, // don't select
563 // for treebook page #0 is empty parent page only
564 m_book
->SetSelection(1);
565 m_book
->SetSelection(0);
569 WidgetsPage
*WidgetsFrame::CurrentPage()
571 wxWindow
*page
= m_book
->GetCurrentPage();
572 if(!page
) return NULL
;
575 return wxStaticCast(page
, WidgetsPage
);
577 WidgetsBookCtrl
*subBook
= wxStaticCast(page
, WidgetsBookCtrl
);
578 if (!subBook
) return NULL
;
579 page
= subBook
->GetCurrentPage();
580 if(!page
) return NULL
;
581 return wxStaticCast(page
, WidgetsPage
);
585 WidgetsFrame::~WidgetsFrame()
592 // ----------------------------------------------------------------------------
593 // WidgetsFrame event handlers
594 // ----------------------------------------------------------------------------
596 void WidgetsFrame::OnExit(wxCommandEvent
& WXUNUSED(event
))
602 void WidgetsFrame::OnButtonClearLog(wxCommandEvent
& WXUNUSED(event
))
610 void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent
& event
)
612 // adjust "Page" menu selection
613 wxMenuItem
*item
= GetMenuBar()->FindItem(Widgets_GoToPage
+ event
.GetSelection());
614 if (item
) item
->Check();
616 // lazy creation of the pages
617 WidgetsPage
* page
= CurrentPage();
618 if (page
&& (page
->GetChildren().GetCount()==0))
620 wxWindowUpdateLocker
noUpdates(page
);
621 page
->CreateContent();
622 WidgetsBookCtrl
*book
= wxStaticCast(page
->GetParent(), WidgetsBookCtrl
);
624 for ( size_t i
= 0; i
< book
->GetPageCount(); ++i
)
626 wxWindow
*page
= book
->GetPage(i
);
629 size
.IncTo(page
->GetSize());
638 void WidgetsFrame::OnGoToPage(wxCommandEvent
& event
)
641 m_book
->SetSelection(event
.GetId() - Widgets_GoToPage
);
643 m_book
->SetSelection(m_book
->GetPageCount()-1);
644 WidgetsBookCtrl
*book
= wxStaticCast(m_book
->GetCurrentPage(), WidgetsBookCtrl
);
645 book
->SetSelection(event
.GetId() - Widgets_GoToPage
);
651 void WidgetsFrame::OnSetTooltip(wxCommandEvent
& WXUNUSED(event
))
653 static wxString s_tip
= _T("This is a tooltip");
655 wxTextEntryDialog dialog
658 _T("Tooltip text (may use \\n, leave empty to remove): "),
659 _T("Widgets sample"),
663 if ( dialog
.ShowModal() != wxID_OK
)
666 s_tip
= dialog
.GetValue();
667 s_tip
.Replace(_T("\\n"), _T("\n"));
669 WidgetsPage
*page
= CurrentPage();
670 page
->GetWidget()->SetToolTip(s_tip
);
672 wxControl
*ctrl2
= page
->GetWidget2();
674 ctrl2
->SetToolTip(s_tip
);
677 #endif // wxUSE_TOOLTIPS
679 void WidgetsFrame::OnSetFgCol(wxCommandEvent
& WXUNUSED(event
))
682 // allow for debugging the default colour the first time this is called
683 WidgetsPage
*page
= CurrentPage();
685 m_colFg
= page
->GetForegroundColour();
687 wxColour col
= wxGetColourFromUser(this, m_colFg
);
693 page
->GetWidget()->SetForegroundColour(m_colFg
);
694 page
->GetWidget()->Refresh();
696 wxControl
*ctrl2
= page
->GetWidget2();
699 ctrl2
->SetForegroundColour(m_colFg
);
703 wxLogMessage(_T("Colour selection dialog not available in current build."));
707 void WidgetsFrame::OnSetBgCol(wxCommandEvent
& WXUNUSED(event
))
710 WidgetsPage
*page
= CurrentPage();
712 m_colBg
= page
->GetBackgroundColour();
714 wxColour col
= wxGetColourFromUser(this, m_colBg
);
720 page
->GetWidget()->SetBackgroundColour(m_colBg
);
721 page
->GetWidget()->Refresh();
723 wxControl
*ctrl2
= page
->GetWidget2();
726 ctrl2
->SetBackgroundColour(m_colFg
);
730 wxLogMessage(_T("Colour selection dialog not available in current build."));
734 void WidgetsFrame::OnSetFont(wxCommandEvent
& WXUNUSED(event
))
737 WidgetsPage
*page
= CurrentPage();
739 m_font
= page
->GetFont();
741 wxFont font
= wxGetFontFromUser(this, m_font
);
747 page
->GetWidget()->SetFont(m_font
);
748 page
->GetWidget()->Refresh();
750 wxControl
*ctrl2
= page
->GetWidget2();
753 ctrl2
->SetFont(m_font
);
757 wxLogMessage(_T("Font selection dialog not available in current build."));
761 void WidgetsFrame::OnEnable(wxCommandEvent
& event
)
763 WidgetsPage
*page
= CurrentPage();
764 page
->GetWidget()->Enable(event
.IsChecked());
767 void WidgetsFrame::OnSetBorder(wxCommandEvent
& event
)
770 switch ( event
.GetId() )
772 case Widgets_BorderNone
: border
= wxBORDER_NONE
; break;
773 case Widgets_BorderStatic
: border
= wxBORDER_STATIC
; break;
774 case Widgets_BorderSimple
: border
= wxBORDER_SIMPLE
; break;
775 case Widgets_BorderRaised
: border
= wxBORDER_RAISED
; break;
776 case Widgets_BorderSunken
: border
= wxBORDER_SUNKEN
; break;
777 case Widgets_BorderDouble
: border
= wxBORDER_DOUBLE
; break;
780 wxFAIL_MSG( _T("unknown border style") );
783 case Widgets_BorderDefault
: border
= wxBORDER_DEFAULT
; break;
786 WidgetsPage::ms_defaultFlags
&= ~wxBORDER_MASK
;
787 WidgetsPage::ms_defaultFlags
|= border
;
789 WidgetsPage
*page
= CurrentPage();
790 page
->RecreateWidget();
793 #endif // wxUSE_MENUS
795 // ----------------------------------------------------------------------------
797 // ----------------------------------------------------------------------------
799 WidgetsPageInfo::WidgetsPageInfo(Constructor ctor
, const wxChar
*label
, int categories
)
801 , m_categories(categories
)
807 // dummy sorting: add and immediately sort in the list according to label
808 if ( WidgetsPage::ms_widgetPages
)
810 WidgetsPageInfo
*node_prev
= WidgetsPage::ms_widgetPages
;
811 if ( wxStrcmp(label
, node_prev
->GetLabel().c_str()) < 0 )
815 WidgetsPage::ms_widgetPages
= this;
819 WidgetsPageInfo
*node_next
;
822 node_next
= node_prev
->GetNext();
825 // add if between two
826 if ( wxStrcmp(label
, node_next
->GetLabel().c_str()) < 0 )
828 node_prev
->SetNext(this);
830 // force to break loop
837 node_prev
->SetNext(this);
840 node_prev
= node_next
;
848 WidgetsPage::ms_widgetPages
= this;
852 // ----------------------------------------------------------------------------
854 // ----------------------------------------------------------------------------
856 int WidgetsPage::ms_defaultFlags
= wxBORDER_DEFAULT
;
857 WidgetsPageInfo
*WidgetsPage::ms_widgetPages
= NULL
;
859 WidgetsPage::WidgetsPage(WidgetsBookCtrl
*book
,
860 wxImageList
*imaglist
,
862 : wxPanel(book
, wxID_ANY
,
863 wxDefaultPosition
, wxDefaultSize
,
864 wxNO_FULL_REPAINT_ON_RESIZE
|
868 #if USE_ICONS_IN_BOOK
869 imaglist
->Add(wxBitmap(icon
));
871 wxUnusedVar(imaglist
);
876 wxSizer
*WidgetsPage::CreateSizerWithText(wxControl
*control
,
880 wxSizer
*sizerRow
= new wxBoxSizer(wxHORIZONTAL
);
881 wxTextCtrl
*text
= new wxTextCtrl(this, id
, wxEmptyString
,
882 wxDefaultPosition
, wxDefaultSize
, wxTE_PROCESS_ENTER
);
884 sizerRow
->Add(control
, 0, wxRIGHT
| wxALIGN_CENTRE_VERTICAL
, 5);
885 sizerRow
->Add(text
, 1, wxLEFT
| wxALIGN_CENTRE_VERTICAL
, 5);
893 // create a sizer containing a label and a text ctrl
894 wxSizer
*WidgetsPage::CreateSizerWithTextAndLabel(const wxString
& label
,
898 return CreateSizerWithText(new wxStaticText(this, wxID_ANY
, label
),
902 // create a sizer containing a button and a text ctrl
903 wxSizer
*WidgetsPage::CreateSizerWithTextAndButton(wxWindowID idBtn
,
904 const wxString
& label
,
908 return CreateSizerWithText(new wxButton(this, idBtn
, label
), id
, ppText
);
911 wxCheckBox
*WidgetsPage::CreateCheckBoxAndAddToSizer(wxSizer
*sizer
,
912 const wxString
& label
,
915 wxCheckBox
*checkbox
= new wxCheckBox(this, id
, label
);
916 sizer
->Add(checkbox
, 0, wxLEFT
| wxRIGHT
, 5);
917 sizer
->Add(0, 2, 0, wxGROW
); // spacer