From b1dfbb7ad894afb95c58932926540b6972a50567 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 15 Jan 2004 01:04:38 +0000 Subject: [PATCH] Added wrappers for the missing wxSpinEvent, which fixes the deadlock when trying to catch events from wxSpinButton. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_controls_rename.i | 1 + wxPython/src/_event.i | 4 ---- wxPython/src/_spin.i | 18 +++++++++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/wxPython/src/_controls_rename.i b/wxPython/src/_controls_rename.i index 6eae0ff863..c3207198fb 100644 --- a/wxPython/src/_controls_rename.i +++ b/wxPython/src/_controls_rename.i @@ -77,6 +77,7 @@ %rename(SP_WRAP) wxSP_WRAP; %rename(SpinButton) wxSpinButton; %rename(SpinCtrl) wxSpinCtrl; +%rename(SpinEvent) wxSpinEvent; %rename(RadioBox) wxRadioBox; %rename(RadioButton) wxRadioButton; %rename(Slider) wxSlider; diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index 877fab6d12..3ddc61936a 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -314,10 +314,6 @@ EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1) -EVT_SPIN_UP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) -EVT_SPIN_DOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) -EVT_SPIN = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) - EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) diff --git a/wxPython/src/_spin.i b/wxPython/src/_spin.i index c092ec8303..0045d2733d 100644 --- a/wxPython/src/_spin.i +++ b/wxPython/src/_spin.i @@ -120,11 +120,27 @@ public: }; +//--------------------------------------------------------------------------- + +class wxSpinEvent : public wxNotifyEvent +{ +public: + wxSpinEvent(wxEventType commandType = wxEVT_NULL, int winid = 0); + + // get the current value of the control + int GetPosition() const; + void SetPosition(int pos); +}; + + %constant wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED; %pythoncode { -EVT_SPINCTRL = wx.PyEventBinder( wxEVT_COMMAND_SPINCTRL_UPDATED, 1) +EVT_SPIN_UP = wx.PyEventBinder( wx.wxEVT_SCROLL_LINEUP, 1) +EVT_SPIN_DOWN = wx.PyEventBinder( wx.wxEVT_SCROLL_LINEDOWN, 1) +EVT_SPIN = wx.PyEventBinder( wx.wxEVT_SCROLL_THUMBTRACK, 1) +EVT_SPINCTRL = wx.PyEventBinder( wxEVT_COMMAND_SPINCTRL_UPDATED, 1) } -- 2.45.2