Fix calculating the size of wxSpinCtrl numeric box under wxOSX

Since 8189ce89ed (Improve wxTextCtrl::DoGetSizeFromTextSize() in wxOSX, 2020-05-28) GetSizeFromTextSize() is fully functional under wxOSX
so we can revert 39d586421b (Don't call GetSizeFromText() under wxOSX, 2020-05-21) and use GetSizeFromText() in calculating text box size.

Closes #18766.
This commit is contained in:
Artur Wieczorek
2020-06-29 20:02:38 +02:00
parent ce9b7bcd81
commit 0065799965

View File

@@ -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;