From cc86c80495451cf828846bb4f49d842b511eafaa Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Fri, 14 Apr 2017 17:38:38 +0300 Subject: [PATCH] Fix the integer value in events generated by generic wxSpinCtrl This notably fixes the problem with changing the year using spin control arrows under macOS, where this control is used as part of wxGenericCalendarCtrl, as not having the correct value in the event object resulted in bogus events with dates in the year 0 there. See http://trac.wxwidgets.org/ticket/17193 (cherry picked from commit 148e8971c7f4c931d6304de35e562c92d0b2c82f) --- docs/changes.txt | 1 + src/generic/spinctlg.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index e4fd5de23c..b859d07472 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -679,6 +679,7 @@ wxOSX: - Return false from wxSound::Create()/IsOk() if the file doesn't exist. - Fix scrolling behaviour of wxSearchCtrl (John Roberts). - Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl (Andreas Falkenhahn). +- Fix changing year in wxCalendarCtrl using arrows (Lauri Nurmi). 3.0.2: (released 2014-10-06) diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 8209a30ae4..e69cdde203 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -96,6 +96,7 @@ public: wxCommandEvent eventCopy(event); eventCopy.SetEventObject(m_spin); eventCopy.SetId(m_spin->GetId()); + eventCopy.SetInt(wxAtoi(event.GetString())); m_spin->ProcessWindowEvent(eventCopy); }