X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..9d9b77552eeb78e0c7ee903aa265dc187651ff57:/src/msw/spinctrl.cpp diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 27b0b26c2d..1724bf68d8 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -50,7 +50,11 @@ // macros // ---------------------------------------------------------------------------- - IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl) + +BEGIN_EVENT_TABLE(wxSpinCtrl, wxSpinButton) + EVT_SPIN(-1, wxSpinCtrl::OnSpinChange) +END_EVENT_TABLE() // ---------------------------------------------------------------------------- // constants @@ -201,6 +205,24 @@ bool wxSpinCtrl::SetFont(const wxFont& font) return TRUE; } +// ---------------------------------------------------------------------------- +// event processing +// ---------------------------------------------------------------------------- + +void wxSpinCtrl::OnSpinChange(wxSpinEvent& eventSpin) +{ + wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, GetId()); + event.SetEventObject(this); + event.SetInt(eventSpin.GetPosition()); + + (void)GetEventHandler()->ProcessEvent(event); + + if ( eventSpin.GetSkipped() ) + { + event.Skip(); + } +} + // ---------------------------------------------------------------------------- // size calculations // ----------------------------------------------------------------------------