X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d426c97e9a8563ff5539a9c86acf2cfb03fbf5bc..26b9cf270e57348e6fadf1e05a4a097ddb3615a4:/utils/wxPython/src/events.i?ds=sidebyside diff --git a/utils/wxPython/src/events.i b/utils/wxPython/src/events.i index b14b98beae..1464154828 100644 --- a/utils/wxPython/src/events.i +++ b/utils/wxPython/src/events.i @@ -31,6 +31,9 @@ class wxEvent { public: + wxEvent(int id = 0); + ~wxEvent(); + wxObject* GetEventObject(); wxEventType GetEventType(); int GetId(); @@ -47,6 +50,7 @@ public: class wxSizeEvent : public wxEvent { public: + wxSizeEvent(const wxSize& sz, int id = 0); wxSize GetSize(); }; @@ -54,6 +58,8 @@ public: class wxCloseEvent : public wxEvent { public: + wxCloseEvent(int commandEventType = 0, int id = 0); + void SetLoggingOff(bool loggingOff); bool GetLoggingOff(); void Veto(bool veto = TRUE); @@ -66,12 +72,18 @@ public: class wxCommandEvent : public wxEvent { public: + wxCommandEvent(int commandEventType = 0, int id = 0); + bool Checked(); long GetExtraLong(); int GetInt(); int GetSelection(); wxString GetString(); bool IsSelection(); + void SetString(const wxString& s); + void SetExtraLong(long extraLong); + void SetInt(int i); + }; @@ -79,6 +91,9 @@ public: class wxScrollEvent: public wxCommandEvent { public: + wxScrollEvent(int commandType = 0, int id = 0, int pos = 0, + int orientation = 0); + int GetOrientation(); int GetPosition(); }; @@ -87,6 +102,9 @@ public: class wxScrollWinEvent: public wxEvent { public: + wxScrollWinEvent(int commandType = 0, int pos = 0, + int orientation = 0); + int GetOrientation(); int GetPosition(); }; @@ -95,6 +113,7 @@ public: class wxSpinEvent : public wxScrollEvent { public: + wxSpinEvent(int commandType = 0, int id = 0); }; @@ -102,6 +121,8 @@ public: class wxMouseEvent: public wxEvent { public: + wxMouseEvent(int mouseEventType = 0); + bool IsButton(); bool ButtonDown(int but = -1); bool ButtonDClick(int but = -1); @@ -128,8 +149,8 @@ public: bool Moving(); bool Entering(); bool Leaving(); - void Position(long *OUTPUT, long *OUTPUT); wxPoint GetPosition(); + %name(GetPositionTuple)void GetPosition(long *OUTPUT, long *OUTPUT); wxPoint GetLogicalPosition(const wxDC& dc); long GetX(); long GetY(); @@ -139,18 +160,41 @@ public: class wxKeyEvent: public wxEvent { public: + wxKeyEvent(int keyEventType); + bool ControlDown(); bool MetaDown(); bool AltDown(); bool ShiftDown(); long KeyCode(); + long GetX(); + long GetY(); + wxPoint GetPosition(); + %name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT); +}; + +//--------------------------------------------------------------------------- + +class wxNavigationKeyEvent : public wxEvent { +public: + wxNavigationKeyEvent(); + + bool GetDirection(); + void SetDirection(bool bForward); + bool IsWindowChange(); + void SetWindowChange(bool bIs); + wxWindow* GetCurrentFocus(); + void SetCurrentFocus(wxWindow *win); }; + //--------------------------------------------------------------------------- class wxMoveEvent: public wxEvent { public: + wxMoveEvent(const wxPoint& pt, int id = 0); + wxPoint GetPosition(); }; @@ -158,6 +202,7 @@ public: class wxPaintEvent: public wxEvent { public: + wxPaintEvent(int id = 0); }; @@ -165,6 +210,8 @@ public: class wxEraseEvent: public wxEvent { public: + wxEraseEvent(int id = 0, wxDC* dc = NULL); + wxDC *GetDC(); }; @@ -172,13 +219,14 @@ public: class wxFocusEvent: public wxEvent { public: - + wxFocusEvent(WXTYPE eventType = 0, int id = 0); }; //--------------------------------------------------------------------------- class wxActivateEvent: public wxEvent{ public: + wxActivateEvent(WXTYPE eventType = 0, int active = TRUE, int id = 0); bool GetActive(); }; @@ -186,13 +234,14 @@ public: class wxInitDialogEvent: public wxEvent { public: - + wxInitDialogEvent(int id = 0); }; //--------------------------------------------------------------------------- class wxMenuEvent: public wxEvent { public: + wxMenuEvent(WXTYPE id = 0, int id = 0); int GetMenuId(); }; @@ -200,6 +249,7 @@ public: class wxShowEvent: public wxEvent { public: + wxShowEvent(int id = 0, int show = FALSE); void SetShow(bool show); bool GetShow(); }; @@ -208,19 +258,24 @@ public: class wxIconizeEvent: public wxEvent { public: + wxIconizeEvent(int id = 0); }; //--------------------------------------------------------------------------- class wxMaximizeEvent: public wxEvent { public: - + wxMaximizeEvent(int id = 0); }; //--------------------------------------------------------------------------- class wxJoystickEvent: public wxEvent { public: + wxJoystickEvent(int type = wxEVT_NULL, + int state = 0, + int joystick = wxJOYSTICK1, + int change = 0); wxPoint GetPosition(); int GetZPosition(); int GetButtonState(); @@ -269,6 +324,7 @@ public: class wxIdleEvent: public wxEvent { public: + wxIdleEvent(); void RequestMore(bool needMore = TRUE); bool MoreRequested(); }; @@ -277,6 +333,7 @@ public: class wxUpdateUIEvent: public wxEvent { public: + wxUpdateUIEvent(wxWindowID commandId = 0); bool GetChecked(); bool GetEnabled(); wxString GetText(); @@ -293,30 +350,91 @@ public: class wxSysColourChangedEvent: public wxEvent { public: + wxSysColourChangedEvent(); +}; + +//--------------------------------------------------------------------------- + +class wxNotifyEvent : public wxCommandEvent { +public: + wxNotifyEvent(int commandType = wxEVT_NULL, int id = 0); + bool IsAllowed(); + void Veto(); }; + //--------------------------------------------------------------------------- -class wxPyEvent : public wxCommandEvent { +class wxPaletteChangedEvent : public wxEvent { public: - wxPyEvent(wxEventType commandType = wxEVT_NULL, PyObject* userData = Py_None); - ~wxPyEvent(); + wxPaletteChangedEvent(wxWindowID id = 0); + + void SetChangedWindow(wxWindow* win); + wxWindow* GetChangedWindow(); - void SetUserData(PyObject* userData); - PyObject* GetUserData(); }; +//--------------------------------------------------------------------------- + +class wxQueryNewPaletteEvent : public wxEvent { +public: + wxQueryNewPaletteEvent(wxWindowID id = 0); + + void SetPaletteRealized(bool realized); + bool GetPaletteRealized(); +}; //--------------------------------------------------------------------------- -class wxNotifyEvent : public wxCommandEvent { +class wxWindowCreateEvent : public wxEvent { public: - bool IsAllowed(); - void Veto(); + wxWindowCreateEvent(wxWindow *win = NULL); + + wxWindow *GetWindow(); +}; + +class wxWindowDestroyEvent : public wxEvent { +public: + wxWindowDestroyEvent(wxWindow *win = NULL); + + wxWindow *GetWindow(); +}; + + +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- +// These classes can be derived from in Python and passed through the event +// system without loosing anything. They do this by keeping a reference to +// themselves and some special case handling in wxPyCallback::EventThunker. + +class wxPyEvent : public wxEvent { +public: + wxPyEvent(int id=0); + ~wxPyEvent(); + + %pragma(python) addtomethod = "__init__:self.SetSelf(self)" + + void SetSelf(PyObject* self); + PyObject* GetSelf(); +}; + + +class wxPyCommandEvent : public wxCommandEvent { +public: + wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0); + ~wxPyCommandEvent(); + + %pragma(python) addtomethod = "__init__:self.SetSelf(self)" + + void SetSelf(PyObject* self); + PyObject* GetSelf(); }; + + + //--------------------------------------------------------------------------- //---------------------------------------------------------------------------