X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d45906e0a78871eaedb431a9f1a1097def3790c9..757cc9def70e4685054f4a24238e2df111f6c9fd:/src/generic/spinctlg.cpp diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 9c8aad397b..0da033d763 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -190,7 +190,10 @@ bool wxSpinCtrl::Create(wxWindow *parent, } DoSetSize(pos.x, pos.y, csize.x, csize.y); #else - DoSetSize(pos.x, pos.y, size.x, size.y); + wxSize best = GetBestSize(); + if ( size.x != -1 ) best.x = size.x; + if ( size.y != -1 ) best.y = size.y; + DoSetSize(pos.x, pos.y, best.x, best.y); #endif // have to disable this window to avoid interfering it with message // processing to the text and the button... but pretend it is enabled to @@ -220,7 +223,7 @@ wxSpinCtrl::~wxSpinCtrl() // geometry // ---------------------------------------------------------------------------- -wxSize wxSpinCtrl::DoGetBestClientSize() const +wxSize wxSpinCtrl::DoGetBestSize() const { wxSize sizeBtn = m_btn->GetBestSize(), sizeText = m_text->GetBestSize();