Use wxSizerFlags when constructing sizers in propgrid sample.
Use it instead of multiple argument wxSizer::Add() overload.
This commit is contained in:
parent
ef30f6fe63
commit
6299874971
@ -1840,16 +1840,16 @@ void FormMain::FinalizePanel( bool wasCreated )
|
||||
// Button for tab traversal testing
|
||||
m_topSizer->Add( new wxButton(m_panel, wxID_ANY,
|
||||
wxT("Should be able to move here with Tab")),
|
||||
0, wxEXPAND );
|
||||
wxSizerFlags(0).Expand());
|
||||
m_topSizer->Add( new wxButton(m_panel, ID_SHOWPOPUP,
|
||||
wxT("Show Popup")),
|
||||
0, wxEXPAND );
|
||||
wxSizerFlags(0).Expand());
|
||||
|
||||
m_panel->SetSizer( m_topSizer );
|
||||
m_topSizer->SetSizeHints( m_panel );
|
||||
|
||||
wxBoxSizer* panelSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
panelSizer->Add( m_panel, 1, wxEXPAND|wxFIXED_MINSIZE );
|
||||
panelSizer->Add( m_panel, wxSizerFlags(1).Expand().FixedMinSize());
|
||||
|
||||
SetSizer( panelSizer );
|
||||
panelSizer->SetSizeHints( this );
|
||||
@ -1957,7 +1957,7 @@ void FormMain::CreateGrid( int style, int extraStyle )
|
||||
wxPropertyGridEventHandler(FormMain::OnPropertyGridChange) );
|
||||
*/
|
||||
|
||||
m_topSizer->Add( m_pPropGridManager, 1, wxEXPAND );
|
||||
m_topSizer->Add( m_pPropGridManager, wxSizerFlags(1).Expand());
|
||||
|
||||
FinalizePanel(wasCreated);
|
||||
}
|
||||
@ -3242,7 +3242,7 @@ struct PropertyGridPopup : wxPopupWindow
|
||||
::SetMinSize(m_grid);
|
||||
|
||||
m_sizer = new wxBoxSizer( wxVERTICAL );
|
||||
m_sizer->Add(m_grid, 0, wxALL | wxEXPAND, 0);
|
||||
m_sizer->Add(m_grid, wxSizerFlags(0).Expand().Border(wxALL, 0));
|
||||
m_panel->SetAutoLayout(true);
|
||||
m_panel->SetSizer(m_sizer);
|
||||
m_sizer->Fit(m_panel);
|
||||
|
@ -166,13 +166,11 @@ void FormMain::OnDumpList( wxCommandEvent& WXUNUSED(event) )
|
||||
wxTextCtrl* ed = new wxTextCtrl(dlg, 11, text,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE);
|
||||
rowsizer->Add( ed, 1, wxEXPAND|wxALL, spacing );
|
||||
topsizer->Add( rowsizer, 1, wxEXPAND, 0 );
|
||||
rowsizer->Add( ed, wxSizerFlags(1).Expand().Border(wxALL, spacing));
|
||||
topsizer->Add( rowsizer, wxSizerFlags(1).Expand());
|
||||
rowsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
const int butSzFlags =
|
||||
wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT;
|
||||
rowsizer->Add( new wxButton(dlg,wxID_OK,wxT("Ok")),
|
||||
0, butSzFlags, spacing );
|
||||
wxSizerFlags(0).CentreHorizontal().CentreVertical().Border(wxBOTTOM|wxLEFT|wxRIGHT, spacing));
|
||||
topsizer->Add( rowsizer, wxSizerFlags().Right() );
|
||||
|
||||
dlg->SetSizer( topsizer );
|
||||
@ -347,13 +345,11 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
wxTextCtrl* ed = new wxTextCtrl(dlg, 11, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxTE_MULTILINE);
|
||||
rowsizer->Add( ed, 1, wxEXPAND|wxALL, spacing );
|
||||
topsizer->Add( rowsizer, 1, wxEXPAND, 0 );
|
||||
rowsizer->Add( ed, wxSizerFlags(1).Expand().Border(wxALL, spacing));
|
||||
topsizer->Add( rowsizer, wxSizerFlags(1).Expand());
|
||||
rowsizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
const int butSzFlags =
|
||||
wxALIGN_CENTRE_HORIZONTAL|wxALIGN_CENTRE_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT;
|
||||
rowsizer->Add( new wxButton(dlg,wxID_OK,wxT("Ok")),
|
||||
0, butSzFlags, spacing );
|
||||
wxSizerFlags(0).CentreHorizontal().CentreVertical().Border(wxBOTTOM|wxLEFT|wxRIGHT, spacing));
|
||||
topsizer->Add( rowsizer, wxSizerFlags().Right() );
|
||||
|
||||
dlg->SetSizer( topsizer );
|
||||
@ -1206,7 +1202,7 @@ bool FormMain::RunTests( bool fullTest, bool interactive )
|
||||
if ( pgman->GetGrid()->GetSplitterPosition() != trySplitterPos )
|
||||
RT_FAILURE_MSG(wxString::Format(wxT("Splitter position was %i (should have been %i)"),(int)pgman->GetGrid()->GetSplitterPosition(),trySplitterPos).c_str());
|
||||
|
||||
m_topSizer->Add( m_pPropGridManager, 1, wxEXPAND );
|
||||
m_topSizer->Add( m_pPropGridManager, wxSizerFlags(1).Expand());
|
||||
FinalizePanel();
|
||||
|
||||
wxSize sz = GetSize();
|
||||
|
Loading…
Reference in New Issue
Block a user