Fix calculating the size of wxSpinCtrl numeric box under wxOSX
Since8189ce89ed
(Improve wxTextCtrl::DoGetSizeFromTextSize() in wxOSX, 2020-05-28) GetSizeFromTextSize() is fully functional under wxOSX so we can revert39d586421b
(Don't call GetSizeFromText() under wxOSX, 2020-05-21) and use GetSizeFromText() in calculating text box size. Closes #18766.
This commit is contained in:
@@ -117,9 +117,6 @@ public:
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXMSW__) || defined(__WXGTK__)
|
|
||||||
// GetSizeFromTextSize() is not implemented in wxOSX
|
|
||||||
// so GetSizeFromText() cannot be used for size calculations.
|
|
||||||
virtual wxSize DoGetBestSize() const wxOVERRIDE
|
virtual wxSize DoGetBestSize() const wxOVERRIDE
|
||||||
{
|
{
|
||||||
wxString minVal = m_spin->DoValueToText(m_spin->m_min);
|
wxString minVal = m_spin->DoValueToText(m_spin->m_min);
|
||||||
@@ -129,7 +126,6 @@ public:
|
|||||||
|
|
||||||
return wxSize(wxMax(minValSize.x, maxValSize.x), wxMax(minValSize.y, maxValSize.y));
|
return wxSize(wxMax(minValSize.x, maxValSize.x), wxMax(minValSize.y, maxValSize.y));
|
||||||
}
|
}
|
||||||
#endif // __WXMSW || __WXGTK__
|
|
||||||
|
|
||||||
wxSpinCtrlGenericBase *m_spin;
|
wxSpinCtrlGenericBase *m_spin;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user