X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6f45066bd8f45e15d645d0f46a29f81aed8c020e..0a4090e635a3765e62181ecf039914c2c27df63c:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index bf56006ade..1b9910d66f 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -32,6 +32,7 @@ #include "wx/msw/wrapcctl.h" // include "properly" #include "wx/event.h" #include "wx/textctrl.h" + #include "wx/wxcrtvararg.h" #endif #include "wx/msw/private.h" @@ -317,7 +318,12 @@ bool wxSpinCtrl::Create(wxWindow *parent, WXDWORD exStyle = 0; WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ; - // calculate the sizes: the size given is the toal size for both controls + // this control is used for numeric entry so normally using these flags by + // default shouldn't be a problem, if it is we can always add a style such + // as wxSP_NON_NUMERIC later + msStyle |= ES_RIGHT | ES_NUMBER; + + // calculate the sizes: the size given is the total size for both controls // and we need to fit them both in the given width (height is the same) wxSize sizeText(size), sizeBtn(size); sizeBtn.x = wxSpinButton::DoGetBestSize().x; @@ -461,7 +467,8 @@ void wxSpinCtrl::SetValue(int val) // text control is currently empty, the spin button seems to be happy // to leave it like this, while we really want to always show the // current value in the control, so do it manually - ::SetWindowText(GetBuddyHwnd(), wxString::Format(_T("%d"), val)); + ::SetWindowText(GetBuddyHwnd(), + wxString::Format(_T("%d"), val).wx_str()); } m_oldValue = GetValue();