X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/242ec2f7e9e964025400a72581dfa9762850e98b..f096a6fdfc9653196b72935d71b93867fd2d5f33:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 05965d0c3d..d7a13374d0 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -335,10 +335,16 @@ bool wxSpinCtrl::Create(wxWindow *parent, WXDWORD exStyle = 0; WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ; + // propagate text alignment style to text ctrl + if ( style & wxALIGN_RIGHT ) + msStyle |= ES_RIGHT; + else if ( style & wxALIGN_CENTER ) + msStyle |= ES_CENTER; + // 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; + msStyle |= 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) @@ -475,7 +481,7 @@ void wxSpinCtrl::SetValue(const wxString& text) void wxSpinCtrl::SetValue(int val) { m_blockEvent = true; - + wxSpinButton::SetValue(val); // normally setting the value of the spin button is enough as it updates @@ -491,7 +497,7 @@ void wxSpinCtrl::SetValue(int val) } m_oldValue = GetValue(); - + m_blockEvent = false; }