1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mousestate.h
3 // Purpose: Declaration of wxMouseState class
4 // Author: Vadim Zeitlin
5 // Created: 2008-09-19 (extracted from wx/utils.h)
7 // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MOUSESTATE_H_
12 #define _WX_MOUSESTATE_H_
14 #include "wx/kbdstate.h"
16 // ----------------------------------------------------------------------------
17 // wxMouseState contains the information about mouse position, buttons and also
19 // ----------------------------------------------------------------------------
21 // wxMouseState is used to hold information about button and modifier state
22 // and is what is returned from wxGetMouseState.
23 class WXDLLIMPEXP_CORE wxMouseState
: public wxKeyboardState
28 m_leftDown(false), m_middleDown(false), m_rightDown(false),
29 m_aux1Down(false), m_aux2Down(false)
33 // default copy ctor, assignment operator and dtor are ok
36 // accessors for the mouse position
37 wxCoord
GetX() const { return m_x
; }
38 wxCoord
GetY() const { return m_y
; }
39 wxPoint
GetPosition() const { return wxPoint(m_x
, m_y
); }
41 // accessors for the pressed buttons
42 bool LeftDown() const { return m_leftDown
; }
43 bool MiddleDown() const { return m_middleDown
; }
44 bool RightDown() const { return m_rightDown
; }
45 bool Aux1Down() const { return m_aux1Down
; }
46 bool Aux2Down() const { return m_aux2Down
; }
48 // these functions are mostly used by wxWidgets itself
49 void SetX(wxCoord x
) { m_x
= x
; }
50 void SetY(wxCoord y
) { m_y
= y
; }
52 void SetLeftDown(bool down
) { m_leftDown
= down
; }
53 void SetMiddleDown(bool down
) { m_middleDown
= down
; }
54 void SetRightDown(bool down
) { m_rightDown
= down
; }
55 void SetAux1Down(bool down
) { m_aux1Down
= down
; }
56 void SetAux2Down(bool down
) { m_aux2Down
= down
; }
60 bool m_middleDown
: 1;
69 #endif // _WX_MOUSESTATE_H_