X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0826b119e63f4cfbf8361cbaf7cedef56e0ec53..472eec8a0391538e4dcf7f7c6c4f4d44c8383616:/include/wx/event.h?ds=sidebyside diff --git a/include/wx/event.h b/include/wx/event.h index 469d6534c9..d63a1140ee 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -30,16 +30,16 @@ // forward declarations // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxList; +class WXDLLIMPEXP_FWD_BASE wxList; #if wxUSE_GUI - class WXDLLIMPEXP_CORE wxDC; - class WXDLLIMPEXP_CORE wxMenu; - class WXDLLIMPEXP_CORE wxWindow; - class WXDLLIMPEXP_CORE wxWindowBase; + class WXDLLIMPEXP_FWD_CORE wxDC; + class WXDLLIMPEXP_FWD_CORE wxMenu; + class WXDLLIMPEXP_FWD_CORE wxWindow; + class WXDLLIMPEXP_FWD_CORE wxWindowBase; #endif // wxUSE_GUI -class WXDLLIMPEXP_BASE wxEvtHandler; +class WXDLLIMPEXP_FWD_BASE wxEvtHandler; // ---------------------------------------------------------------------------- // Event types @@ -179,6 +179,12 @@ BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE(wxEVT_KILL_FOCUS, 113) DECLARE_EVENT_TYPE(wxEVT_CHILD_FOCUS, 114) DECLARE_EVENT_TYPE(wxEVT_MOUSEWHEEL, 115) + DECLARE_EVENT_TYPE(wxEVT_AUX1_DOWN, 116) + DECLARE_EVENT_TYPE(wxEVT_AUX1_UP, 117) + DECLARE_EVENT_TYPE(wxEVT_AUX1_DCLICK, 118) + DECLARE_EVENT_TYPE(wxEVT_AUX2_DOWN, 119) + DECLARE_EVENT_TYPE(wxEVT_AUX2_UP, 120) + DECLARE_EVENT_TYPE(wxEVT_AUX2_DCLICK, 121) // Non-client mouse events DECLARE_EVENT_TYPE(wxEVT_NC_LEFT_DOWN, 200) @@ -269,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 @@ -411,7 +419,7 @@ protected: private: // it needs to access our m_propagationLevel - friend class WXDLLIMPEXP_BASE wxPropagateOnce; + friend class WXDLLIMPEXP_FWD_BASE wxPropagateOnce; DECLARE_ABSTRACT_CLASS(wxEvent) }; @@ -676,14 +684,17 @@ enum wxMOUSE_BTN_NONE = 0, wxMOUSE_BTN_LEFT = 1, wxMOUSE_BTN_MIDDLE = 2, - wxMOUSE_BTN_RIGHT = 3 + wxMOUSE_BTN_RIGHT = 3, + wxMOUSE_BTN_AUX1 = 4, + wxMOUSE_BTN_AUX2 = 5, + wxMOUSE_BTN_MAX }; 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*?) @@ -725,20 +736,28 @@ public: bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); } bool MiddleDown() const { return (m_eventType == wxEVT_MIDDLE_DOWN); } bool RightDown() const { return (m_eventType == wxEVT_RIGHT_DOWN); } + bool Aux1Down() const { return (m_eventType == wxEVT_AUX1_DOWN); } + bool Aux2Down() const { return (m_eventType == wxEVT_AUX2_DOWN); } bool LeftUp() const { return (m_eventType == wxEVT_LEFT_UP); } bool MiddleUp() const { return (m_eventType == wxEVT_MIDDLE_UP); } bool RightUp() const { return (m_eventType == wxEVT_RIGHT_UP); } + bool Aux1Up() const { return (m_eventType == wxEVT_AUX1_UP); } + bool Aux2Up() const { return (m_eventType == wxEVT_AUX2_UP); } bool LeftDClick() const { return (m_eventType == wxEVT_LEFT_DCLICK); } bool MiddleDClick() const { return (m_eventType == wxEVT_MIDDLE_DCLICK); } bool RightDClick() const { return (m_eventType == wxEVT_RIGHT_DCLICK); } + bool Aux1DClick() const { return (m_eventType == wxEVT_AUX1_UP); } + bool Aux2DClick() const { return (m_eventType == wxEVT_AUX2_UP); } // Find the current state of the mouse buttons (regardless // of current event type) bool LeftIsDown() const { return m_leftDown; } bool MiddleIsDown() const { return m_middleDown; } bool RightIsDown() const { return m_rightDown; } + bool Aux1IsDown() const { return m_aux1Down; } + bool Aux2IsDown() const { return m_aux2Down; } // True if a button is down and the mouse is moving bool Dragging() const @@ -758,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 { @@ -809,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); } @@ -823,12 +846,16 @@ public: bool m_leftDown; bool m_middleDown; bool m_rightDown; + bool m_aux1Down; + bool m_aux2Down; bool m_controlDown; bool m_shiftDown; bool m_altDown; bool m_metaDown; - + + int m_clickCount; + int m_wheelAxis; int m_wheelRotation; int m_wheelDelta; @@ -2285,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 @@ -2337,12 +2364,12 @@ public: virtual bool ProcessEvent(wxEvent& event); // add an event to be processed later - virtual void AddPendingEvent(wxEvent& event); + virtual void AddPendingEvent(const wxEvent& event); void ProcessPendingEvents(); #if wxUSE_THREADS - bool ProcessThreadEvent(wxEvent& event); + bool ProcessThreadEvent(const wxEvent& event); #endif // Dynamic association of a member function handler with the event handler, @@ -2498,7 +2525,7 @@ private: // Post a message to the given eventhandler which will be processed during the // next event loop iteration -inline void wxPostEvent(wxEvtHandler *dest, wxEvent& event) +inline void wxPostEvent(wxEvtHandler *dest, const wxEvent& event) { wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") ); @@ -2827,6 +2854,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)) @@ -2882,19 +2911,31 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& #define EVT_LEAVE_WINDOW(func) wx__DECLARE_EVT0(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(func)) #define EVT_ENTER_WINDOW(func) wx__DECLARE_EVT0(wxEVT_ENTER_WINDOW, wxMouseEventHandler(func)) #define EVT_MOUSEWHEEL(func) wx__DECLARE_EVT0(wxEVT_MOUSEWHEEL, wxMouseEventHandler(func)) +#define EVT_MOUSE_AUX1_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX1_DOWN, wxMouseEventHandler(func)) +#define EVT_MOUSE_AUX1_UP(func) wx__DECLARE_EVT0(wxEVT_AUX1_UP, wxMouseEventHandler(func)) +#define EVT_MOUSE_AUX1_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX1_DCLICK, wxMouseEventHandler(func)) +#define EVT_MOUSE_AUX2_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX2_DOWN, wxMouseEventHandler(func)) +#define EVT_MOUSE_AUX2_UP(func) wx__DECLARE_EVT0(wxEVT_AUX2_UP, wxMouseEventHandler(func)) +#define EVT_MOUSE_AUX2_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX2_DCLICK, wxMouseEventHandler(func)) // All mouse events #define EVT_MOUSE_EVENTS(func) \ EVT_LEFT_DOWN(func) \ EVT_LEFT_UP(func) \ + EVT_LEFT_DCLICK(func) \ EVT_MIDDLE_DOWN(func) \ EVT_MIDDLE_UP(func) \ + EVT_MIDDLE_DCLICK(func) \ EVT_RIGHT_DOWN(func) \ EVT_RIGHT_UP(func) \ - EVT_MOTION(func) \ - EVT_LEFT_DCLICK(func) \ - EVT_MIDDLE_DCLICK(func) \ EVT_RIGHT_DCLICK(func) \ + EVT_MOUSE_AUX1_DOWN(func) \ + EVT_MOUSE_AUX1_UP(func) \ + EVT_MOUSE_AUX1_DCLICK(func) \ + EVT_MOUSE_AUX2_DOWN(func) \ + EVT_MOUSE_AUX2_UP(func) \ + EVT_MOUSE_AUX2_DCLICK(func) \ + EVT_MOTION(func) \ EVT_LEAVE_WINDOW(func) \ EVT_ENTER_WINDOW(func) \ EVT_MOUSEWHEEL(func)