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