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