%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;
%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;
wxEVT_SCROLL_PAGEDOWN,
wxEVT_SCROLL_THUMBTRACK,
wxEVT_SCROLL_THUMBRELEASE,
- wxEVT_SCROLL_ENDSCROLL,
+ wxEVT_SCROLL_CHANGED,
])
EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
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,
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)
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)
deselection), or a boolean value representing the value of a checkbox.", "");
+ %extend {
+ DocStr(GetClientData,
+ "Returns the client data object for a listbox or choice selection event, (if any.)", "");
+ PyObject* GetClientData() {
+ wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
+ if (data) {
+ Py_INCREF(data->m_obj);
+ return data->m_obj;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+
+ DocStr(SetClientData,
+ "Associate the given client data with the item at position n.", "");
+ void SetClientData(PyObject* clientData) {
+ wxPyClientData* data = new wxPyClientData(clientData);
+ self->SetClientObject(data);
+ }
+ }
+ %pythoncode {
+ GetClientObject = GetClientData
+ SetClientObject = SetClientData
+ }
+
virtual wxEvent *Clone() const;
};
* ", "");
+ DocDeclStr(
+ int, GetModifiers() const,
+ "Returns a bitmask of the current modifier settings. Can be used to
+check if the key event has exactly the given modifiers without having
+to explicitly check that the other modifiers are not down. For
+example::
+
+ if event.GetModifers() == wx.MOD_CONTROL:
+ DoSomething()
+", "");
+
DocDeclStr(
bool , ControlDown() const,
"Returns ``True`` if the Control key was down at the time of the event.", "");
DocDeclStr(
bool , GetLoggingOff() const,
- "Returns true if the user is logging off.", "");
+ "Returns ``True`` if the user is logging off or ``False`` if the
+system is shutting down. This method can only be called for end
+session and query end session events, it doesn't make sense for close
+window event.", "");
DocDeclStr(
DocDeclStr(
bool , GetEnabled() const,
"Returns ``True`` if the UI element should be enabled.", "");
-
+
+ DocDeclStr(
+ bool , GetShown() const,
+ "Returns ``True`` if the UI element should be shown.", "");
+
DocDeclStr(
wxString , GetText() const,
"Returns the text that should be set for the UI element.", "");
"Returns ``True`` if the application has called `Enable`. For wxWidgets
internal use only.", "");
-
+ DocDeclStr(
+ bool , GetSetShown() const,
+ "Returns ``True`` if the application has called `Show`. For wxWidgets
+internal use only.", "");
+
DocDeclStr(
void , Check(bool check),
DocDeclStr(
void , Enable(bool enable),
"Enable or disable the UI element.", "");
+
+ DocDeclStr(
+ void , Show(bool show),
+ "Show or hide the UI element.", "");
+
DocDeclStr(
void , SetText(const wxString& text),
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: