X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56ac3e75d4ee0af27a3801de43072923f3226843..71ec83d2fd6dde4fd6ad1905cf74c6cf23d13c2a:/samples/layout/layout.cpp?ds=sidebyside diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 5b55468ada..fbec3d7dc0 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -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 ); @@ -275,7 +275,9 @@ void MyFrame::Draw(wxDC& dc, bool WXUNUSED(draw_bitmaps) ) dc.DrawRoundedRectangle(150, 150, 100, 50, 20); dc.DrawEllipse(250, 250, 100, 50); +#if wxUSE_SPLINES dc.DrawSpline(50, 200, 50, 100, 200, 10); +#endif // wxUSE_SPLINES dc.DrawLine(50, 230, 200, 230); dc.SetPen(* wxBLACK_PEN); @@ -348,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(