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:
Vadim Zeitlin
2015-04-11 19:51:13 +02:00
parent 31d1644daa
commit 6c68b0c158

View File

@@ -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;
}