X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c75a4cf0f94cbe53bfde4fbcddff741158fbc7c..9269629e9edf24ce170f225d408a5472ab6864ac:/wxPython/src/_event.i diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index d122e1b886..ce01fce0c9 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -99,8 +99,16 @@ wxEventType wxNewEventType(); %constant wxEventType wxEVT_NAVIGATION_KEY; %constant wxEventType wxEVT_KEY_DOWN; %constant wxEventType wxEVT_KEY_UP; + +%{ +#if ! wxUSE_HOTKEY +#define wxEVT_HOTKEY -9999 +#endif +%} + %constant wxEventType wxEVT_HOTKEY; - + + // Set cursor event %constant wxEventType wxEVT_SET_CURSOR; @@ -113,7 +121,9 @@ wxEventType wxNewEventType(); %constant wxEventType wxEVT_SCROLL_PAGEDOWN; %constant wxEventType wxEVT_SCROLL_THUMBTRACK; %constant wxEventType wxEVT_SCROLL_THUMBRELEASE; -%constant wxEventType wxEVT_SCROLL_ENDSCROLL; +%constant wxEventType wxEVT_SCROLL_CHANGED; +%pythoncode { wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED } + // Scroll events from wxWindow %constant wxEventType wxEVT_SCROLLWIN_TOP; @@ -282,7 +292,7 @@ EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, wxEVT_SCROLL_PAGEDOWN, wxEVT_SCROLL_THUMBTRACK, wxEVT_SCROLL_THUMBRELEASE, - wxEVT_SCROLL_ENDSCROLL, + wxEVT_SCROLL_CHANGED, ]) EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) @@ -293,8 +303,9 @@ EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) -EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL ) - +EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) +EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED + %# Scrolling from wx.Slider and wx.ScrollBar, with an id EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, wxEVT_SCROLL_BOTTOM, @@ -304,7 +315,7 @@ EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, wxEVT_SCROLL_PAGEDOWN, wxEVT_SCROLL_THUMBTRACK, wxEVT_SCROLL_THUMBRELEASE, - wxEVT_SCROLL_ENDSCROLL, + wxEVT_SCROLL_CHANGED, ], 1) EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) @@ -315,7 +326,8 @@ EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) 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_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) +EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) @@ -2230,8 +2242,15 @@ public: DocStr(wxWindowDestroyEvent, - "The EVT_WINDOW_DESTROY event is sent right before the window is -destroyed.", ""); + "The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor +when the GUI window is destroyed. + +When a class derived from `wx.Window` is destroyed its destructor will +have already run by the time this event is sent. Therefore this event +will not usually be received at all by the window itself. Since it is +received after the destructor has run, an object should not try to +handle its own wx.WindowDestroyEvent, but it can be used to get +notification of the destruction of another window.", ""); class wxWindowDestroyEvent : public wxCommandEvent { public: