X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d93c719ac09362890adde4f6f0e5962aed816280..d769e8ebe01770bd070e1dd64b5a8f6e96c2dad7:/samples/layout/layout.cpp?ds=sidebyside diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 1b5fa69511..c3bfb5e58d 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -6,7 +6,7 @@ // Created: 04/01/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx/wx.h". @@ -75,7 +75,7 @@ bool MyApp::OnInit() // Make a panel frame->panel = new wxPanel(frame, 0, 0, 1000, 500, wxTAB_TRAVERSAL); - frame->panel->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); + frame->panel->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); // frame->panel->SetAutoLayout(TRUE); // Create some panel items @@ -227,7 +227,7 @@ void MyFrame::TestNotebookSizers(wxCommandEvent& WXUNUSED(event) ) wxPanel *panel = new wxPanel( notebook, -1 ); notebook->AddPage( panel, "Page Two" ); - wxBoxSizer *panelsizer = new wxBoxSizer( wxVERTICAL ); + wxSizer *panelsizer = new wxBoxSizer( wxVERTICAL ); wxTextCtrl *text = new wxTextCtrl( panel, -1, "TextLine 1.", wxDefaultPosition, wxSize(250,-1) ); panelsizer->Add( text, 0, wxGROW|wxALL, 30 ); @@ -350,6 +350,22 @@ MySizerFrame::MySizerFrame(wxFrame *frame, char *title, int x, int y ): 30); topsizer->Add(statsizer, 1, wxEXPAND | wxALL, 10); + // 2.7) And a test of wxGridSizer + wxGridSizer *gridsizer = new wxGridSizer(2, 5, 5); + gridsizer->Add(new wxStaticText(this, -1, "Label"), 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + gridsizer->Add(new wxTextCtrl(this, -1, "Grid sizer demo"), 1, + wxGROW | wxALIGN_CENTER_VERTICAL); + gridsizer->Add(new wxStaticText(this, -1, "Another label"), 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + gridsizer->Add(new wxTextCtrl(this, -1, "More text"), 1, + wxGROW | wxALIGN_CENTER_VERTICAL); + gridsizer->Add(new wxStaticText(this, -1, "Final label"), 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + gridsizer->Add(new wxTextCtrl(this, -1, "And yet more text"), 1, + wxGROW | wxALIGN_CENTER_VERTICAL); + topsizer->Add(gridsizer, 1, wxGROW | wxALL, 10); + // 3) middle: create wxStaticLine with minimum size (3x3) topsizer->Add(