]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/mousestate.h
Explicitly mention that wxDateTime ticks origin is in UTC.
[wxWidgets.git] / interface / wx / mousestate.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mousestate.h
3 // Purpose: documentation of wxMouseState
4 // Author: wxWidgets team
5 // Created: 2008-09-19
6 // RCS-ID: $Id$
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 /// Symbolic names for the mouse buttons.
11 enum wxMouseButton
12 {
13 /// Any mouse button, means to check for any button being pressed for
14 /// example.
15 wxMOUSE_BTN_ANY = -1,
16
17 /// None of the mouse buttons.
18 wxMOUSE_BTN_NONE = 0,
19
20 /// Left mouse button.
21 wxMOUSE_BTN_LEFT = 1,
22
23 /// Middle mouse button.
24 wxMOUSE_BTN_MIDDLE = 2,
25
26 /// Right mouse button.
27 wxMOUSE_BTN_RIGHT = 3,
28
29 /// First additional mouse button.
30 wxMOUSE_BTN_AUX1 = 4,
31
32 /// Second additional mouse button.
33 wxMOUSE_BTN_AUX2 = 5,
34
35 wxMOUSE_BTN_MAX
36 };
37
38
39 /**
40 @class wxMouseState
41
42 Represents the mouse state.
43
44 This class is used as a base class by wxMouseEvent and so its methods may
45 be used to obtain information about the mouse state for the mouse events.
46 It also inherits from wxKeyboardState and so carries information about the
47 keyboard state and not only the mouse one.
48
49 This class is implemented entirely inline in @<wx/mousestate.h@> and thus
50 has no linking requirements.
51
52 @nolibrary
53 @category{events}
54
55 @see wxGetMouseState(), wxMouseEvent
56 */
57 class wxMouseState : public wxKeyboardState
58 {
59 public:
60 /**
61 Default constructor.
62 */
63 wxMouseState();
64
65 /**
66 Returns X coordinate of the physical mouse event position.
67 */
68 wxCoord GetX() const;
69
70 /**
71 Returns Y coordinate of the physical mouse event position.
72 */
73 wxCoord GetY() const;
74
75 /**
76 Returns the physical mouse position.
77 */
78 //@{
79 wxPoint GetPosition() const;
80 void GetPosition(int *x, int *y) const;
81 //@}
82
83 /**
84 Returns @true if the left mouse button is currently down.
85 */
86 bool LeftIsDown() const;
87
88 /**
89 Returns @true if the middle mouse button is currently down.
90 */
91 bool MiddleIsDown() const;
92
93 /**
94 Returns @true if the right mouse button is currently down.
95 */
96 bool RightIsDown() const;
97
98 /**
99 Returns @true if the first extra button mouse button is currently down.
100 */
101 bool Aux1IsDown() const;
102
103 /**
104 Returns @true if the second extra button mouse button is currently down.
105 */
106 bool Aux2IsDown() const;
107
108
109 void SetX(wxCoord x);
110 void SetY(wxCoord y);
111 void SetPosition(wxPoint pos);
112
113 void SetLeftDown(bool down);
114 void SetMiddleDown(bool down);
115 void SetRightDown(bool down);
116 void SetAux1Down(bool down);
117 void SetAux2Down(bool down);
118
119 void SetState(const wxMouseState& state);
120
121 };
122
123