- gridsizer->Add(new wxStaticText(this, wxID_ANY, _T("Label")), 0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- gridsizer->Add(new wxTextCtrl(this, wxID_ANY, _T("Grid sizer demo")), 1,
- wxGROW | wxALIGN_CENTER_VERTICAL);
- gridsizer->Add(new wxStaticText(this, wxID_ANY, _T("Another label")), 0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- gridsizer->Add(new wxTextCtrl(this, wxID_ANY, _T("More text")), 1,
- wxGROW | wxALIGN_CENTER_VERTICAL);
- gridsizer->Add(new wxStaticText(this, wxID_ANY, _T("Final label")), 0,
- wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- gridsizer->Add(new wxTextCtrl(this, wxID_ANY, _T("And yet more text")), 1,
- wxGROW | wxALIGN_CENTER_VERTICAL);
- topsizer->Add(gridsizer, 1, wxGROW | wxALL, 10);
+ gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Label")),
+ wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
+ gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("Grid sizer demo")),
+ wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));
+ gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Another label")),
+ wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
+ gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("More text")),
+ wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL));
+ gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Final label")),
+ wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL));
+ gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("And yet more text")),
+ wxSizerFlags().Align(wxGROW | wxALIGN_CENTER_VERTICAL));
+ topsizer->Add(
+ gridsizer,
+ wxSizerFlags().Proportion(1).Expand().Border(wxALL, 10));