From a5988a03891f9a6d763a85412f68d55947c60853 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 5 Apr 2015 20:46:00 +0200 Subject: [PATCH] Fix invalid use of wxSizer flags inside the library itself. It doesn't make sense to use wxALIGN_CENTRE_VERTICAL with wxGROW, so remove the alignment style. --- include/wx/pickerbase.h | 7 ++++--- samples/xrc/rc/basicdlg.xrc | 2 +- src/generic/choicbkg.cpp | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/wx/pickerbase.h b/include/wx/pickerbase.h index 5266b1d9b8..7ca5e53a24 100644 --- a/include/wx/pickerbase.h +++ b/include/wx/pickerbase.h @@ -91,9 +91,10 @@ public: // public API { int f = GetDefaultPickerCtrlFlag(); if ( grow ) + { + f &= ~wxALIGN_MASK; f |= wxGROW; - else - f &= ~wxGROW; + } GetPickerCtrlItem()->SetFlag(f); } @@ -153,7 +154,7 @@ protected: { // on macintosh, without additional borders // there's not enough space for focus rect - return wxALIGN_CENTER_VERTICAL|wxGROW + return wxALIGN_CENTER_VERTICAL #ifdef __WXMAC__ | wxTOP | wxRIGHT | wxBOTTOM #endif diff --git a/samples/xrc/rc/basicdlg.xrc b/samples/xrc/rc/basicdlg.xrc index 55857ca13f..919035d266 100644 --- a/samples/xrc/rc/basicdlg.xrc +++ b/samples/xrc/rc/basicdlg.xrc @@ -8,7 +8,7 @@ wxVERTICAL - wxGROW|wxALIGN_CENTER_VERTICAL|wxALL + wxGROW|wxALL 5 500,150 diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index 5ea3a62538..50f6e5646a 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -92,8 +92,8 @@ wxChoicebook::Create(wxWindow *parent, mainSizer->Add(0, 0, 1, wxEXPAND, 0); m_controlSizer = new wxBoxSizer(IsVertical() ? wxHORIZONTAL : wxVERTICAL); - m_controlSizer->Add(m_bookctrl, 1, (IsVertical() ? wxALIGN_CENTRE_VERTICAL : wxALIGN_CENTRE) |wxGROW, 0); - mainSizer->Add(m_controlSizer, 0, (IsVertical() ? (int) wxGROW : (int) wxALIGN_CENTRE_VERTICAL)|wxALL, m_controlMargin); + m_controlSizer->Add(m_bookctrl, 1, wxGROW, 0); + mainSizer->Add(m_controlSizer, 0, (IsVertical() ? wxGROW : wxALIGN_CENTRE_VERTICAL)|wxALL, m_controlMargin); SetSizer(mainSizer); return true; }