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:
@@ -76,27 +76,29 @@ public: // public API
|
||||
{ return (GetTextCtrlItem()->GetFlag() & wxGROW) != 0; }
|
||||
void SetTextCtrlGrowable(bool grow = true)
|
||||
{
|
||||
int f = GetDefaultTextCtrlFlag();
|
||||
wxSizerItem* const item = GetTextCtrlItem();
|
||||
int f = item->GetFlag();
|
||||
if ( grow )
|
||||
f |= wxGROW;
|
||||
else
|
||||
f &= ~wxGROW;
|
||||
|
||||
GetTextCtrlItem()->SetFlag(f);
|
||||
item->SetFlag(f);
|
||||
}
|
||||
|
||||
bool IsPickerCtrlGrowable() const
|
||||
{ return (GetPickerCtrlItem()->GetFlag() & wxGROW) != 0; }
|
||||
void SetPickerCtrlGrowable(bool grow = true)
|
||||
{
|
||||
int f = GetDefaultPickerCtrlFlag();
|
||||
wxSizerItem* const item = GetPickerCtrlItem();
|
||||
int f = item->GetFlag();
|
||||
if ( grow )
|
||||
{
|
||||
f &= ~wxALIGN_MASK;
|
||||
f |= wxGROW;
|
||||
}
|
||||
|
||||
GetPickerCtrlItem()->SetFlag(f);
|
||||
item->SetFlag(f);
|
||||
}
|
||||
|
||||
bool HasTextCtrl() const
|
||||
@@ -150,15 +152,19 @@ protected:
|
||||
return m_sizer->GetItem((size_t)0);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
wxDEPRECATED_MSG("useless and will be removed in the future")
|
||||
int GetDefaultPickerCtrlFlag() const
|
||||
{
|
||||
return wxALIGN_CENTER_VERTICAL;
|
||||
}
|
||||
|
||||
wxDEPRECATED_MSG("useless and will be removed in the future")
|
||||
int GetDefaultTextCtrlFlag() const
|
||||
{
|
||||
return wxALIGN_CENTER_VERTICAL | wxRIGHT;
|
||||
}
|
||||
#endif // WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
void PostCreation();
|
||||
|
||||
|
Reference in New Issue
Block a user