Use wxSizerFlags in wxChoicebook layout code.
This makes the code more clear and, as a side effect, avoids the (harmless) warning about using enums of different types with the ternary operator.
This commit is contained in:
@@ -92,8 +92,13 @@ wxChoicebook::Create(wxWindow *parent,
|
||||
mainSizer->Add(0, 0, 1, wxEXPAND, 0);
|
||||
|
||||
m_controlSizer = new wxBoxSizer(IsVertical() ? wxHORIZONTAL : wxVERTICAL);
|
||||
m_controlSizer->Add(m_bookctrl, 1, wxGROW, 0);
|
||||
mainSizer->Add(m_controlSizer, 0, (IsVertical() ? wxGROW : wxALIGN_CENTRE_VERTICAL)|wxALL, m_controlMargin);
|
||||
m_controlSizer->Add(m_bookctrl, wxSizerFlags(1).Expand());
|
||||
wxSizerFlags flags;
|
||||
if ( IsVertical() )
|
||||
flags.Expand();
|
||||
else
|
||||
flags.CentreVertical();
|
||||
mainSizer->Add(m_controlSizer, flags.Border(wxALL, m_controlMargin));
|
||||
SetSizer(mainSizer);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user