Don't call GetSizeFromText() under wxOSX

We cannot use GetSizeFromText() to calculate
numeric box size under wxOSX because this function
calls GetSizeFromTextSize() which is implemented
only in wxMSW and wxGTK.
This commit is contained in:
Artur Wieczorek
2020-05-21 22:49:03 +02:00
parent 53a35d15bc
commit 39d586421b

View File

@@ -112,6 +112,9 @@ public:
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
{
wxString minVal = m_spin->DoValueToText(m_spin->m_min);
@@ -121,6 +124,7 @@ public:
return wxSize(wxMax(minValSize.x, maxValSize.x), wxMax(minValSize.y, maxValSize.y));
}
#endif // __WXMSW || __WXGTK__
wxSpinCtrlGenericBase *m_spin;