X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/befa6d980e781d3afc961ab5b28f9fed9d4c0fab..c71830c3b63568566cf5f006165e51ffaee0c704:/samples/checklst/checklst.cpp diff --git a/samples/checklst/checklst.cpp b/samples/checklst/checklst.cpp index 9846d2008b..fdefc46f6c 100644 --- a/samples/checklst/checklst.cpp +++ b/samples/checklst/checklst.cpp @@ -30,6 +30,7 @@ #include "wx/log.h" +#include "wx/sizer.h" #include "wx/menuitem.h" #include "wx/checklst.h" @@ -167,9 +168,29 @@ CheckListBoxFrame::CheckListBoxFrame(wxFrame *frame, m_pListBox->Check(2); // create buttons for moving the items around - (void)new wxButton(panel, Btn_Up, " &Up ", wxPoint(420, 90)); - (void)new wxButton(panel, Btn_Down, "&Down", wxPoint(420, 120)); + wxButton *button1 = new wxButton(panel, Btn_Up, " &Up ", wxPoint(420, 90)); + wxButton *button2 = new wxButton(panel, Btn_Down, "&Down", wxPoint(420, 120)); + + wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL ); + + mainsizer->Add( m_pListBox, 1, wxGROW|wxALL, 10 ); + + wxBoxSizer *bottomsizer = new wxBoxSizer( wxHORIZONTAL ); + + bottomsizer->Add( button1, 0, wxALL, 10 ); + bottomsizer->Add( button2, 0, wxALL, 10 ); + + mainsizer->Add( bottomsizer, 0, wxCENTER ); + + // tell frame to make use of sizer (or constraints, if any) + panel->SetAutoLayout( TRUE ); + panel->SetSizer( mainsizer ); + + // don't allow frame to get smaller than what the sizers tell ye + mainsizer->SetSizeHints( this ); + + Show(TRUE); }