From 6c68b0c158c1cd3177b7d34cf9df856d38a47428 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 11 Apr 2015 19:51:13 +0200 Subject: [PATCH] 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. --- src/generic/choicbkg.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index 50f6e5646a..a5c34cb0da 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -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; }