X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dd989e1bf4c3667d27b3c27a9cf64a66484ee90..700ec4546cfa7a89b3bca0a4eb5b6ee9d43ac17a:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 1e9f2df629..59a6470caf 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -506,7 +506,7 @@ public: void CopyObject(wxObject& object_dest) const; public: int m_commandInt; // Additional information - long m_extraLong; + long m_extraLong; }; // Mouse event class @@ -605,15 +605,23 @@ public: bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } // Find the position of the event - void GetPosition(long *xpos, long *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } - void GetPosition(int *xpos, int *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } - void Position(long *xpos, long *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } + void GetPosition(wxCoord *xpos, wxCoord *ypos) const + { + if (xpos) + *xpos = m_x; + if (ypos) + *ypos = m_y; + } + +#ifndef __WIN16__ + void GetPosition(long *xpos, long *ypos) const + { + if (xpos) + *xpos = (long)m_x; + if (ypos) + *ypos = (long)m_y; + } +#endif // Find the position of the event wxPoint GetPosition() const { return wxPoint(m_x, m_y); } @@ -623,6 +631,14 @@ public: // Compatibility #if WXWIN_COMPATIBILITY + void Position(long *xpos, long *ypos) const + { + if (xpos) + *xpos = (long)m_x; + if (ypos) + *ypos = (long)m_y; + } + void Position(float *xpos, float *ypos) const { *xpos = (float) m_x; *ypos = (float) m_y; @@ -638,8 +654,8 @@ public: void CopyObject(wxObject& obj) const; public: - long m_x; - long m_y; + wxCoord m_x, m_y; + bool m_leftDown; bool m_middleDown; bool m_rightDown; @@ -674,28 +690,36 @@ public: long KeyCode() const { return m_keyCode; } // Find the position of the event + void GetPosition(wxCoord *xpos, wxCoord *ypos) const + { + if (xpos) *xpos = m_x; + if (ypos) *ypos = m_y; + } + +#ifndef __WIN16__ void GetPosition(long *xpos, long *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } - void GetPosition(int *xpos, int *ypos) const - { if (xpos) *xpos = m_x; - if (ypos) *ypos = m_y; } + { + if (xpos) *xpos = (long)m_x; + if (ypos) *ypos = (long)m_y; + } +#endif wxPoint GetPosition() const { return wxPoint(m_x, m_y); } // Get X position - long GetX() const { return m_x; } + wxCoord GetX() const { return m_x; } // Get Y position - long GetY() const { return m_y; } + wxCoord GetY() const { return m_y; } void CopyObject(wxObject& obj) const; public: - long m_x; - long m_y; + wxCoord m_x, m_y; + long m_keyCode; + bool m_controlDown; bool m_shiftDown; bool m_altDown; @@ -1339,7 +1363,7 @@ public: // process all pending events void ProcessPendingEvents(); - // add a + // add a #if wxUSE_THREADS bool ProcessThreadEvent(wxEvent& event); #endif @@ -1356,12 +1380,28 @@ public: wxObject *userData = (wxObject *) NULL ) { Connect(id, -1, eventType, func, userData); } + bool Disconnect( int id, int lastId = -1, wxEventType eventType = wxEVT_NULL, + wxObjectEventFunction func = NULL, + wxObject *userData = (wxObject *) NULL ); + + // Convenience function: take just one id + bool Disconnect( int id, wxEventType eventType = wxEVT_NULL, + wxObjectEventFunction func = NULL, + wxObject *userData = (wxObject *) NULL ) + { return Disconnect(id, -1, eventType, func, userData); } + // implementation from now on virtual bool SearchEventTable(wxEventTable& table, wxEvent& event); bool SearchDynamicEventTable( wxEvent& event ); #if wxUSE_THREADS - void ClearEventLocker() { delete m_eventsLocker; m_eventsLocker = NULL; }; + void ClearEventLocker() + { +# if !defined(__VISAGECPP__) + delete m_eventsLocker; + m_eventsLocker = NULL; +#endif + }; #endif // old stuff @@ -1396,7 +1436,11 @@ protected: wxList* m_dynamicEvents; wxList* m_pendingEvents; #if wxUSE_THREADS +#if defined (__VISAGECPP__) + wxCriticalSection m_eventsLocker; +# else wxCriticalSection* m_eventsLocker; +# endif #endif // optimization: instead of using costly IsKindOf() to decide whether we're