]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/mousestate.h
Applied #15226 with modifications: wxRichTextCtrl: Implement setting properties with...
[wxWidgets.git] / interface / wx / mousestate.h
CommitLineData
0e097789
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/mousestate.h
3// Purpose: documentation of wxMouseState
4// Author: wxWidgets team
5// Created: 2008-09-19
526954c5 6// Licence: wxWindows licence
0e097789
VZ
7/////////////////////////////////////////////////////////////////////////////
8
ab826fd8
VZ
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
0e097789
VZ
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
ba1d7a6c 51 @nolibrary
9e0ed083 52 @category{events}
0e097789
VZ
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;
ba1d7a6c 68
0e097789
VZ
69 /**
70 Returns Y coordinate of the physical mouse event position.
71 */
72 wxCoord GetY() const;
ba1d7a6c 73
0e097789
VZ
74 /**
75 Returns the physical mouse position.
76 */
ab826fd8 77 //@{
0e097789 78 wxPoint GetPosition() const;
ab826fd8
VZ
79 void GetPosition(int *x, int *y) const;
80 //@}
0e097789
VZ
81
82 /**
ab826fd8 83 Returns @true if the left mouse button is currently down.
0e097789 84 */
ab826fd8 85 bool LeftIsDown() const;
ba1d7a6c 86
0e097789 87 /**
ab826fd8 88 Returns @true if the middle mouse button is currently down.
0e097789 89 */
ab826fd8 90 bool MiddleIsDown() const;
ba1d7a6c 91
0e097789 92 /**
ab826fd8 93 Returns @true if the right mouse button is currently down.
0e097789 94 */
ab826fd8 95 bool RightIsDown() const;
ba1d7a6c 96
0e097789 97 /**
ab826fd8 98 Returns @true if the first extra button mouse button is currently down.
0e097789 99 */
ab826fd8 100 bool Aux1IsDown() const;
ba1d7a6c 101
0e097789 102 /**
ab826fd8 103 Returns @true if the second extra button mouse button is currently down.
0e097789 104 */
ab826fd8 105 bool Aux2IsDown() const;
a90e69f7
RD
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
0e097789
VZ
120};
121
122