00001 #ifndef __CMouseEvent__
00002 #define __CMouseEvent__
00003
00004 #include <Basics/CCountedObject.hpp>
00005 #include "../Windowing/CMouse.hpp"
00006
00007
00008
00009 using Exponent::Basics::CCountedObject;
00010 using Exponent::GUI::Windowing::CMouse;
00011
00012
00013
00014 #ifdef WIN32
00015 #ifndef WM_MOUSEWHEEL
00016 #define WM_MOUSEWHEEL 0x020A
00017 #endif
00018 #endif
00019
00020
00021
00022 namespace Exponent
00023 {
00024 namespace GUI
00025 {
00026 namespace Events
00027 {
00045 class CMouseEvent : public CCountedObject
00046 {
00048 EXPONENT_CLASS_DECLARATION;
00051
00052
00053 public:
00054
00055
00056
00061 enum EMouseEventType
00062 {
00063 #ifdef WIN32
00064 e_leftMouseDown = WM_LBUTTONDOWN,
00065 e_rightMouseDown = WM_RBUTTONDOWN,
00066 e_leftMouseUp = WM_LBUTTONUP,
00067 e_rightMouseUp = WM_RBUTTONUP,
00068 e_leftMouseDoubleClick = WM_LBUTTONDBLCLK,
00069 e_button3MouseClick = 0,
00070 e_mouseWheelMove = WM_MOUSEWHEEL,
00071 e_mouseMove = WM_MOUSEMOVE,
00072 e_mouseLeftArea = WM_MOUSELEAVE
00073 #else
00074 e_leftMouseDown = 0,
00075 e_rightMouseDown,
00076 e_leftMouseUp,
00077 e_rightMouseUp,
00078 e_leftMouseDoubleClick,
00079 e_button3MouseClick,
00080 e_mouseWheelMove,
00081 e_mouseMove,
00082 e_mouseLeftArea,
00083 #endif
00084 };
00085
00086
00087
00094 CMouseEvent(CMouse *mouse, const EMouseEventType type, double wheelMovementAmount = 0.0);
00095
00096 #ifdef WIN32
00097
00103 CMouseEvent(CMouse *mouse, const UINT type, double wheelMovementAmount = 0.0);
00104 #endif
00105
00109 virtual ~CMouseEvent();
00110
00111
00112
00117 void setWheelMovementAmount(const double wheelMovementAmount);
00118
00123 double getWheelMovementAmount() const;
00124
00125
00126
00131 void setEventType(EMouseEventType type);
00132
00137 EMouseEventType getEventType() const;
00138
00139
00140
00145 const CMouse *getMouse() const;
00146
00151 CMouse *getMutableMouse() const;
00152
00153
00154
00161 void setModifiers(const bool ctrl, const bool shift, const bool alt);
00162
00163 #ifdef WIN32
00164
00168 void setModifiers(WPARAM wParam);
00169
00174 WPARAM getModifiers() const;
00175 #endif
00176
00177
00178
00183 bool isCtrlDown() const;
00184
00189 bool isShiftDown() const;
00190
00195 bool isAltDown() const;
00196
00197
00198
00203 void setMousePosition(const CPoint &point);
00204
00209 const CPoint &getMousePosition() const;
00210
00211
00212
00213 protected:
00214
00215
00216
00217 EMouseEventType m_type;
00218 CMouse *m_mouse;
00219 double m_wheelMovementAmount;
00221 bool m_ctrlIsDown;
00222 bool m_shiftIsDown;
00223 bool m_altIsDown;
00225 #ifdef WIN32
00226 WPARAM m_rawModifiers;
00227 #endif
00228
00229 };
00230 }
00231 }
00232 }
00233 #endif // End of CMouseEvent.hpp