X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..42a04f70db5f3e16ee6e679ddf8fadbc275ee51b:/wxPython/src/_event.i diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index f009c9d50c..0df1ed9552 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -163,6 +163,8 @@ wxEventType wxNewEventType(); %constant wxEventType wxEVT_UPDATE_UI; %constant wxEventType wxEVT_SIZING; %constant wxEventType wxEVT_MOVING; +%constant wxEventType wxEVT_HIBERNATE; + // Generic command events // Note: a click is a higher-level event than button down/up @@ -203,6 +205,7 @@ EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) +EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) @@ -314,10 +317,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) @@ -372,17 +371,23 @@ public: void SetEventObject(wxObject *obj); long GetTimestamp() const; void SetTimestamp(long ts = 0); - int GetId() const; + int GetId() const; void SetId(int Id); bool IsCommandEvent() const; - // Can instruct event processor that we wish to ignore this event - // (treat as if the event table entry had not been found): this must be done - // to allow the event processing by the base classes (calling event.Skip() - // is the analog of calling the base class verstion of a virtual function) - void Skip(bool skip = TRUE); + DocDeclStr( + void , Skip(bool skip = true), + "Called by an event handler, it controls whether additional event +handlers bound to this event will be called after the current event +handler returns. Skip(false) (the default setting) will prevent +additional event handlers from being called and control will be +returned to the sender of the event immediately after the current +handler has finished. Skip(True) will cause the event processing +system to continue searching for a handler function for this event. +", ""); + bool GetSkipped() const; // Determine if this event should be propagating to the parent window. @@ -450,8 +455,9 @@ public: // Get checkbox value bool IsChecked() const; - - // TRUE if the listbox event was a selection. + %pythoncode { Checked = IsChecked } + + // True if the listbox event was a selection. bool IsSelection() const; void SetExtraLong(long extraLong); @@ -567,6 +573,16 @@ public: bool AltDown() const; bool ShiftDown() const; + DocDeclStr( + bool , CmdDown() const, + "\"Cmd\" is a pseudo key which is the same as Control for PC and Unix +platforms but the special \"Apple\" (a.k.a as \"Command\") key on +Macs: it makes often sense to use it instead of, say, `ControlDown` +because Cmd key is used for the same thing under Mac as Ctrl +elsewhere. The Ctrl still exists, it's just not used for this +purpose. So for non-Mac platforms this is the same as `ControlDown` +and Macs this is the same as `MetaDown`.", ""); + // Find which event was just generated bool LeftDown() const; bool MiddleDown() const; @@ -598,10 +614,17 @@ public: // True if the mouse is just leaving the window bool Leaving() const; - // Find the position of the event + + DocStr(GetPosition, // sets the docstring for both + "Returns the position of the mouse in window coordinates when the event +happened.", ""); wxPoint GetPosition(); - %name(GetPositionTuple)void GetPosition(long *OUTPUT, long *OUTPUT); + DocDeclAName( + void, GetPosition(long *OUTPUT, long *OUTPUT), + "GetPositionTuple() -> (x,y)", + GetPositionTuple); + // Find the logical position of the event given the DC wxPoint GetLogicalPosition(const wxDC& dc) const; @@ -681,6 +704,18 @@ public: bool MetaDown() const; bool AltDown() const; bool ShiftDown() const; + + DocDeclStr( + bool , CmdDown() const, + "\"Cmd\" is a pseudo key which is the same as Control for PC and Unix +platforms but the special \"Apple\" (a.k.a as \"Command\") key on +Macs: it makes often sense to use it instead of, say, `ControlDown` +because Cmd key is used for the same thing under Mac as Ctrl +elsewhere. The Ctrl still exists, it's just not used for this +purpose. So for non-Mac platforms this is the same as `ControlDown` +and Macs this is the same as `MetaDown`.", ""); + + // exclude MetaDown() from HasModifiers() because NumLock under X is often // configured as mod2 modifier, yet the key events even when it is pressed @@ -692,14 +727,16 @@ public: %pythoncode { KeyCode = GetKeyCode } %extend { - int GetUniChar() { - #if wxUSE_UNICODE - return self->m_uniChar; - #else + int GetUnicodeKey() { + %#if wxUSE_UNICODE + return self->GetUnicodeKey(); + %#else return 0; - #endif + %#endif } } + %pythoncode { GetUniChar = GetUnicodeKey } + // get the raw key code (platform-dependent) wxUint32 GetRawKeyCode() const; @@ -707,9 +744,15 @@ public: // get the raw key flags (platform-dependent) wxUint32 GetRawKeyFlags() const; - // Find the position of the event + + DocStr(GetPosition, // sets the docstring for both + "Find the position of the event.", ""); wxPoint GetPosition(); - %name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT); + + DocDeclAName( + void, GetPosition(long *OUTPUT, long *OUTPUT), + "GetPositionTuple() -> (x,y)", + GetPositionTuple); // Get X position wxCoord GetX() const; @@ -769,15 +812,13 @@ public: wxPoint GetPosition() const; wxRect GetRect() const; - void SetRect(wxRect rect); - %extend { - void SetPosition(wxPoint pos) { - self->m_pos = pos; - } - } + void SetRect(const wxRect& rect); + void SetPosition(const wxPoint& pos); - wxPoint m_pos; - wxRect m_rect; + %pythoncode { + m_pos = property(GetPosition, SetPosition) + m_rect = property(GetRect, SetRect) + } }; //--------------------------------------------------------------------------- @@ -843,7 +884,7 @@ public: class wxActivateEvent : public wxEvent { public: - wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = TRUE, int Id = 0); + wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0); bool GetActive() const; }; @@ -888,7 +929,7 @@ public: void SetLoggingOff(bool logOff); bool GetLoggingOff() const; - void Veto(bool veto = TRUE); + void Veto(bool veto = true); void SetCanVeto(bool canVeto); bool CanVeto() const; @@ -902,7 +943,7 @@ public: class wxShowEvent : public wxEvent { public: - wxShowEvent(int winid = 0, bool show = FALSE); + wxShowEvent(int winid = 0, bool show = false); void SetShow(bool show); bool GetShow() const; @@ -916,7 +957,7 @@ public: class wxIconizeEvent: public wxEvent { public: - wxIconizeEvent(int id = 0, bool iconized = TRUE); + wxIconizeEvent(int id = 0, bool iconized = true); bool Iconized(); }; @@ -951,11 +992,7 @@ public: } for (int i=0; i