X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3ca6a5f04692678cd2d9f3ea0843fc3f5a0b254f..4bc6e5c51af44eb04313ae14f390f3780dfea346:/wxPython/src/events.i diff --git a/wxPython/src/events.i b/wxPython/src/events.i index d0c6713c0b..5983169335 100644 --- a/wxPython/src/events.i +++ b/wxPython/src/events.i @@ -30,9 +30,12 @@ //--------------------------------------------------------------------------- -class wxEvent { + +int wxNewEventType(); + +class wxEvent : public wxObject { public: - wxEvent(int id = 0); + // wxEvent(int id = 0); // *** This class is now an ABC ~wxEvent(); wxObject* GetEventObject(); @@ -45,6 +48,8 @@ public: void SetId(int id); void SetTimestamp(long timeStamp); void Skip(bool skip = TRUE); + + wxEvent *Clone(); }; //--------------------------------------------------------------------------- @@ -86,6 +91,18 @@ public: void SetExtraLong(long extraLong); void SetInt(int i); + %addmethods { + 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; + } + } + } }; @@ -156,6 +173,46 @@ public: wxPoint GetLogicalPosition(const wxDC& dc); long GetX(); long GetY(); + + int GetWheelRotation() const { return m_wheelRotation; } + int GetWheelDelta() const { return m_wheelDelta; } + int GetLinesPerAction() const { return m_linesPerAction; } + + long m_x, m_y; + bool m_leftDown; + bool m_middleDown; + bool m_rightDown; + bool m_controlDown; + bool m_shiftDown; + bool m_altDown; + bool m_metaDown; + int m_wheelRotation; + int m_wheelDelta; + int m_linesPerAction; +}; + +//--------------------------------------------------------------------------- + +class wxMouseCaptureChangedEvent : public wxEvent +{ +public: + wxMouseCaptureChangedEvent(wxWindowID id = 0, wxWindow* gainedCapture = NULL); + wxWindow* GetCapturedWindow() const; +}; + +//--------------------------------------------------------------------------- + +class wxSetCursorEvent : public wxEvent +{ +public: + wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0); + + wxCoord GetX() const; + wxCoord GetY() const; + + void SetCursor(const wxCursor& cursor); + const wxCursor& GetCursor() const; + bool HasCursor() const; }; //--------------------------------------------------------------------------- @@ -173,10 +230,27 @@ public: long GetKeyCode(); bool HasModifiers(); + // get the raw key code (platform-dependent) + long GetRawKeyCode() const; + + // get the raw key flags (platform-dependent) + long GetRawKeyFlags() const; + long GetX(); long GetY(); wxPoint GetPosition(); %name(GetPositionTuple) void GetPosition(long* OUTPUT, long* OUTPUT); + + long m_x, m_y; + long m_keyCode; + bool m_controlDown; + bool m_shiftDown; + bool m_altDown; + bool m_metaDown; + bool m_scanCode; + long m_rawCode; + long m_rawFlags; + }; //--------------------------------------------------------------------------- @@ -227,6 +301,18 @@ public: wxFocusEvent(WXTYPE eventType = 0, int id = 0); }; +//--------------------------------------------------------------------------- + +// wxChildFocusEvent notifies the parent that a child has got the focus: unlike +// wxFocusEvent it is propgated upwards the window chain +class wxChildFocusEvent : public wxCommandEvent +{ +public: + wxChildFocusEvent(wxWindow *win = NULL); + wxWindow *GetWindow() const; +}; + + //--------------------------------------------------------------------------- class wxActivateEvent: public wxEvent{ @@ -248,6 +334,7 @@ class wxMenuEvent: public wxEvent { public: wxMenuEvent(WXTYPE id = 0, int id = 0); int GetMenuId(); + bool IsPopup(); }; //--------------------------------------------------------------------------- @@ -263,7 +350,8 @@ public: class wxIconizeEvent: public wxEvent { public: - wxIconizeEvent(int id = 0); + wxIconizeEvent(int id = 0, bool iconized = TRUE); + bool Iconized(); }; //--------------------------------------------------------------------------- @@ -318,7 +406,11 @@ public: } for (int i=0; i