X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1dfbb7ad894afb95c58932926540b6972a50567..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/src/_event.i diff --git a/wxPython/src/_event.i b/wxPython/src/_event.i index 3ddc61936a..23f7064cc7 100644 --- a/wxPython/src/_event.i +++ b/wxPython/src/_event.i @@ -368,17 +368,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. @@ -564,6 +570,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; @@ -597,7 +613,8 @@ public: DocStr(GetPosition, // sets the docstring for both - "Returns the position of the mouse in window coordinates when the event happened."); + "Returns the position of the mouse in window coordinates when the event +happened.", ""); wxPoint GetPosition(); DocDeclAName( @@ -684,6 +701,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 @@ -695,14 +724,16 @@ public: %pythoncode { KeyCode = GetKeyCode } %extend { - int GetUniChar() { + int GetUnicodeKey() { %#if wxUSE_UNICODE - return self->m_uniChar; + return self->GetUnicodeKey(); %#else return 0; %#endif } } + %pythoncode { GetUniChar = GetUnicodeKey } + // get the raw key code (platform-dependent) wxUint32 GetRawKeyCode() const; @@ -712,7 +743,7 @@ public: DocStr(GetPosition, // sets the docstring for both - "Find the position of the event."); + "Find the position of the event.", ""); wxPoint GetPosition(); DocDeclAName( @@ -778,15 +809,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) + } }; //--------------------------------------------------------------------------- @@ -852,7 +881,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; }; @@ -897,7 +926,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; @@ -911,7 +940,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; @@ -925,7 +954,7 @@ public: class wxIconizeEvent: public wxEvent { public: - wxIconizeEvent(int id = 0, bool iconized = True); + wxIconizeEvent(int id = 0, bool iconized = true); bool Iconized(); }; @@ -1103,17 +1132,31 @@ public: // direction: forward (True) or backward (False) bool GetDirection() const; - void SetDirection(bool bForward); + void SetDirection(bool forward); // it may be a window change event (MDI, notebook pages...) or a control // change event bool IsWindowChange() const; - void SetWindowChange(bool bIs); + void SetWindowChange(bool ischange); + + // Set to true under MSW if the event was generated using the tab key. + // This is required for proper navogation over radio buttons + bool IsFromTab() const; + void SetFromTab(bool bIs); + void SetFlags(long flags); + // the child which has the focus currently (may be NULL - use // wxWindow::FindFocus then) wxWindow* GetCurrentFocus() const; void SetCurrentFocus(wxWindow *win); + + enum { + IsBackward, + IsForward, + WinChange, + FromTab + }; }; @@ -1187,7 +1230,7 @@ class wxIdleEvent : public wxEvent public: wxIdleEvent(); - void RequestMore(bool needMore = True); + void RequestMore(bool needMore = true); bool MoreRequested() const; // Specify how wxWindows will send idle events: to @@ -1211,7 +1254,7 @@ public: class wxPyEvent : public wxEvent { public: - %addtofunc wxPyEvent "self.SetSelf(self)" + %pythonAppend wxPyEvent "self.SetSelf(self)" wxPyEvent(int winid=0, wxEventType commandType = wxEVT_NULL ); ~wxPyEvent(); @@ -1223,7 +1266,7 @@ public: class wxPyCommandEvent : public wxCommandEvent { public: - %addtofunc wxPyCommandEvent "self.SetSelf(self)" + %pythonAppend wxPyCommandEvent "self.SetSelf(self)" wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0); ~wxPyCommandEvent(); @@ -1236,4 +1279,22 @@ public: //--------------------------------------------------------------------------- +class wxDateEvent : public wxCommandEvent +{ +public: + wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type); + + const wxDateTime& GetDate() const; + void SetDate(const wxDateTime &date); + +}; + +%constant wxEventType wxEVT_DATE_CHANGED; + +%pythoncode { + EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) +} + + +//---------------------------------------------------------------------------