X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af309447ff8413abd2fa5e9cc780fcef1c891f87..eb7159455d8967dbfa384e338eb584d09964d3fa:/utils/wxPython/src/events.i diff --git a/utils/wxPython/src/events.i b/utils/wxPython/src/events.i index da2653c594..a5f08b2eec 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,13 +72,14 @@ public: class wxCommandEvent : public wxEvent { public: + wxCommandEvent(int commandEventType = 0, int id = 0); + bool Checked(); long GetExtraLong(); int GetInt(); int GetSelection(); - char* GetString(); + wxString GetString(); bool IsSelection(); - }; @@ -80,6 +87,20 @@ public: class wxScrollEvent: public wxCommandEvent { public: + wxScrollEvent(int commandType = 0, int id = 0, int pos = 0, + int orientation = 0); + + int GetOrientation(); + int GetPosition(); +}; + +//--------------------------------------------------------------------------- + +class wxScrollWinEvent: public wxEvent { +public: + wxScrollWinEvent(int commandType = 0, int pos = 0, + int orientation = 0); + int GetOrientation(); int GetPosition(); }; @@ -88,6 +109,7 @@ public: class wxSpinEvent : public wxScrollEvent { public: + wxSpinEvent(int commandType = 0, int id = 0); }; @@ -95,6 +117,8 @@ public: class wxMouseEvent: public wxEvent { public: + wxMouseEvent(int mouseEventType = 0); + bool IsButton(); bool ButtonDown(int but = -1); bool ButtonDClick(int but = -1); @@ -121,8 +145,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(); @@ -132,18 +156,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 wxCommandEvent { +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(); }; @@ -151,6 +198,7 @@ public: class wxPaintEvent: public wxEvent { public: + wxPaintEvent(int id = 0); }; @@ -158,6 +206,8 @@ public: class wxEraseEvent: public wxEvent { public: + wxEraseEvent(int id = 0, wxDC* dc = NULL); + wxDC *GetDC(); }; @@ -165,13 +215,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(); }; @@ -179,13 +230,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(); }; @@ -193,6 +245,7 @@ public: class wxShowEvent: public wxEvent { public: + wxShowEvent(int id = 0, int show = FALSE); void SetShow(bool show); bool GetShow(); }; @@ -201,19 +254,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(); @@ -262,6 +320,7 @@ public: class wxIdleEvent: public wxEvent { public: + wxIdleEvent(); void RequestMore(bool needMore = TRUE); bool MoreRequested(); }; @@ -270,6 +329,7 @@ public: class wxUpdateUIEvent: public wxEvent { public: + wxUpdateUIEvent(wxWindowID commandId = 0); bool GetChecked(); bool GetEnabled(); wxString GetText(); @@ -286,67 +346,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 wxPaletteChangedEvent : public wxEvent { +public: + wxPaletteChangedEvent(wxWindowID id = 0); -///////////////////////////////////////////////////////////////////////////// -// -// $Log$ -// Revision 1.7 1999/02/20 09:02:57 RD -// Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a -// window handle. If you can get the window handle into the python code, -// it should just work... More news on this later. -// -// Added wxImageList, wxToolTip. -// -// Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the -// wxRegConfig class. -// -// As usual, some bug fixes, tweaks, etc. -// -// Revision 1.6 1999/02/06 22:55:00 RD -// -// Follow up for changes in wxWindows to various event classes -// -// Revision 1.5 1998/12/15 20:41:17 RD -// Changed the import semantics from "from wxPython import *" to "from -// wxPython.wx import *" This is for people who are worried about -// namespace pollution, they can use "from wxPython import wx" and then -// prefix all the wxPython identifiers with "wx." -// -// Added wxTaskbarIcon for wxMSW. -// -// Made the events work for wxGrid. -// -// Added wxConfig. -// -// Added wxMiniFrame for wxGTK, (untested.) -// -// Changed many of the args and return values that were pointers to gdi -// objects to references to reflect changes in the wxWindows API. -// -// Other assorted fixes and additions. -// -// Revision 1.4 1998/11/16 00:00:55 RD -// Generic treectrl for wxPython/GTK compiles... -// -// Revision 1.3 1998/10/20 06:43:56 RD -// New wxTreeCtrl wrappers (untested) -// some changes in helpers -// etc. -// -// Revision 1.2 1998/08/15 07:36:33 RD -// - Moved the header in the .i files out of the code that gets put into -// the .cpp files. It caused CVS conflicts because of the RCS ID being -// different each time. -// -// - A few minor fixes. -// -// Revision 1.1 1998/08/09 08:25:50 RD -// Initial version -// -// + void SetChangedWindow(wxWindow* win); + wxWindow* GetChangedWindow(); + +}; + +//--------------------------------------------------------------------------- + +class wxQueryNewPaletteEvent : public wxEvent { +public: + wxQueryNewPaletteEvent(wxWindowID id = 0); + + void SetPaletteRealized(bool realized); + bool GetPaletteRealized(); +}; + + +//--------------------------------------------------------------------------- + +class wxWindowCreateEvent : public wxEvent { +public: + 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(); +}; + + + + +//--------------------------------------------------------------------------- +//---------------------------------------------------------------------------