Deprecate wxPickerBase::GetDefaultXXXFlag() methods

They just seem completely useless, not documented and only used by wxPickerBase
itself internally. Replace the code using them with wxSizerFlags which is more
clear and also doesn't hard code the border sizes (especially in the case of
the picker control which doesn't even have borders in the first place) and
prepare for removing them later.
This commit is contained in:
Vadim Zeitlin
2016-06-08 02:51:53 +02:00
parent c5825827fb
commit 0d86c01b8b
2 changed files with 15 additions and 9 deletions

View File

@@ -102,8 +102,8 @@ bool wxPickerBase::CreateBase(wxWindow *parent,
wxWindowDestroyEventHandler(wxPickerBase::OnTextCtrlDelete),
NULL, this);
// the text control's proportion values defaults to 2
m_sizer->Add(m_text, 2, GetDefaultTextCtrlFlag(), 5);
m_sizer->Add(m_text,
wxSizerFlags(1).CentreVertical().Border(wxRIGHT));
}
return true;
@@ -111,9 +111,9 @@ bool wxPickerBase::CreateBase(wxWindow *parent,
void wxPickerBase::PostCreation()
{
// the picker's proportion value defaults to 1 when there's no text control
// associated with it - in that case it defaults to 0
m_sizer->Add(m_picker, HasTextCtrl() ? 0 : 1, GetDefaultPickerCtrlFlag(), 5);
// the picker grows in the major direction only if there is no text control
m_sizer->Add(m_picker,
wxSizerFlags(HasTextCtrl() ? 0 : 1).CentreVertical());
// For aesthetic reasons, make sure the picker is at least as high as the
// associated text control and is always at least square, unless we are