X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/932324990328613e69526cb88e587de4024061c3..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/src/msw/spinbutt.cpp?ds=sidebyside diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 43141278d6..1695f13436 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -25,6 +25,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/msw/wrapcctl.h" // include "properly" #include "wx/app.h" #endif @@ -35,7 +36,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent) #include "wx/msw/private.h" -#include "wx/msw/wrapcctl.h" #ifndef UDM_SETRANGE32 #define UDM_SETRANGE32 (WM_USER+111) @@ -195,7 +195,7 @@ bool wxSpinButton::Create(wxWindow *parent, SubclassWin(m_hWnd); - SetBestSize(size); + SetInitialSize(size); return true; } @@ -256,6 +256,11 @@ void wxSpinButton::SetValue(int val) } } +void wxSpinButton::NormalizeValue() +{ + SetValue( GetValue() ); +} + void wxSpinButton::SetRange(int minVal, int maxVal) { const bool hadRange = m_min < m_max; @@ -303,7 +308,7 @@ bool wxSpinButton::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, event.SetPosition((short)pos); // cast is important for negative values! event.SetEventObject(this); - return GetEventHandler()->ProcessEvent(event); + return HandleWindowEvent(event); } bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM *result) @@ -319,7 +324,7 @@ bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM * event.SetPosition(lpnmud->iPos + lpnmud->iDelta); event.SetEventObject(this); - bool processed = GetEventHandler()->ProcessEvent(event); + bool processed = HandleWindowEvent(event); *result = event.IsAllowed() ? 0 : 1;