X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01101e2da6f4493ce8cfcf4d9509163b9c264d58..9d5507f7a2701395e1d5c121bd877bb9066ee6ea:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 3635b757ec..ffea5e3562 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_EVENT_H__ -#define _WX_EVENT_H__ +#ifndef _WX_EVENT_H_ +#define _WX_EVENT_H_ #include "wx/defs.h" #include "wx/cpp.h" @@ -22,8 +22,6 @@ #include "wx/cursor.h" #endif -#include "wx/thread.h" - #include "wx/dynarray.h" // ---------------------------------------------------------------------------- @@ -31,7 +29,9 @@ // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxList; - +#if wxUSE_THREADS + class WXDLLIMPEXP_FWD_BASE wxCriticalSection; +#endif #if wxUSE_GUI class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxMenu; @@ -275,13 +275,15 @@ BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE(wxEVT_UPDATE_UI, 440) DECLARE_EVENT_TYPE(wxEVT_SIZING, 441) DECLARE_EVENT_TYPE(wxEVT_MOVING, 442) - DECLARE_EVENT_TYPE(wxEVT_HIBERNATE, 443) + DECLARE_EVENT_TYPE(wxEVT_MOVE_START, 443) + DECLARE_EVENT_TYPE(wxEVT_MOVE_END, 444) + DECLARE_EVENT_TYPE(wxEVT_HIBERNATE, 445) // more power events follow -- see wx/power.h // Clipboard events - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY, 444) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT, 445) - DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE, 446) + DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY, 446) + DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT, 447) + DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE, 448) // Generic command events // Note: a click is a higher-level event than button down/up @@ -692,7 +694,7 @@ class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent { public: wxMouseEvent(wxEventType mouseType = wxEVT_NULL); - wxMouseEvent(const wxMouseEvent& event) : wxEvent(event) + wxMouseEvent(const wxMouseEvent& event) : wxEvent(event) { Assign(event); } // Was it a button event? (*doesn't* mean: is any button *down*?) @@ -775,6 +777,10 @@ public: // True if the mouse is just leaving the window bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } + // Returns the number of mouse clicks associated with this event. + int GetClickCount() const { return m_clickCount; } + + // Find the position of the event void GetPosition(wxCoord *xpos, wxCoord *ypos) const { @@ -826,7 +832,7 @@ public: // Returns the configured number of lines (or whatever) to be scrolled per // wheel action. Defaults to one. int GetLinesPerAction() const { return m_linesPerAction; } - + // Is the system set to do page scrolling? bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); } @@ -847,7 +853,9 @@ public: bool m_shiftDown; bool m_altDown; bool m_metaDown; - + + int m_clickCount; + int m_wheelAxis; int m_wheelRotation; int m_wheelDelta; @@ -2304,7 +2312,7 @@ public: // Clear table void Clear(); -#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING +#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING // Clear all tables static void ClearAll(); #endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING @@ -2355,6 +2363,12 @@ public: // process an event right now virtual bool ProcessEvent(wxEvent& event); + // Process an event by calling ProcessEvent and handling any exceptions + // thrown by event handlers. It's mostly useful when processing wx events + // when called from C code (e.g. in GTK+ callback) when the exception + // wouldn't correctly propagate to wxEventLoop. + bool SafelyProcessEvent(wxEvent& event); + // add an event to be processed later virtual void AddPendingEvent(const wxEvent& event); @@ -2846,6 +2860,8 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& #define EVT_SIZING(func) wx__DECLARE_EVT0(wxEVT_SIZING, wxSizeEventHandler(func)) #define EVT_MOVE(func) wx__DECLARE_EVT0(wxEVT_MOVE, wxMoveEventHandler(func)) #define EVT_MOVING(func) wx__DECLARE_EVT0(wxEVT_MOVING, wxMoveEventHandler(func)) +#define EVT_MOVE_START(func) wx__DECLARE_EVT0(wxEVT_MOVE_START, wxMoveEventHandler(func)) +#define EVT_MOVE_END(func) wx__DECLARE_EVT0(wxEVT_MOVE_END, wxMoveEventHandler(func)) #define EVT_CLOSE(func) wx__DECLARE_EVT0(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(func)) #define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func)) #define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func)) @@ -3096,4 +3112,4 @@ WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor); #endif // wxUSE_GUI -#endif // _WX_EVENT_H__ +#endif // _WX_EVENT_H_