don't duplicate wxMouseState in wxMouseEvent but reuse its methods and variables (somehow this was never done when wxMouseState was introduced)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-04-29 21:42:30 +00:00
parent 8f1a82e6bb
commit ab826fd86f
5 changed files with 131 additions and 189 deletions

View File

@@ -1873,14 +1873,16 @@ public:
left the window and the state variables for it may have changed during this time.
@note Note the difference between methods like wxMouseEvent::LeftDown and
wxMouseEvent::LeftIsDown: the former returns @true when the event corresponds
to the left mouse button click while the latter returns @true if the left
mouse button is currently being pressed. For example, when the user is dragging
the mouse you can use wxMouseEvent::LeftIsDown to test whether the left mouse
button is (still) depressed. Also, by convention, if wxMouseEvent::LeftDown
returns @true, wxMouseEvent::LeftIsDown will also return @true in wxWidgets
whatever the underlying GUI behaviour is (which is platform-dependent).
The same applies, of course, to other mouse buttons as well.
the inherited wxMouseState::LeftIsDown: the former returns @true when
the event corresponds to the left mouse button click while the latter
returns @true if the left mouse button is currently being pressed.
For example, when the user is dragging the mouse you can use
wxMouseEvent::LeftIsDown to test whether the left mouse button is
(still) depressed. Also, by convention, if wxMouseEvent::LeftDown
returns @true, wxMouseEvent::LeftIsDown will also return @true in
wxWidgets whatever the underlying GUI behaviour is (which is
platform-dependent). The same applies, of course, to other mouse
buttons as well.
@beginEventTable{wxMouseEvent}
@@ -1972,12 +1974,6 @@ public:
*/
bool Aux1Down() const;
/**
Returns @true if the first extra button mouse button is currently down,
independent of the current event type.
*/
bool Aux1IsDown() const;
/**
Returns @true if the first extra button mouse button changed to up.
*/
@@ -1993,52 +1989,38 @@ public:
*/
bool Aux2Down() const;
/**
Returns @true if the second extra button mouse button is currently down,
independent of the current event type.
*/
bool Aux2IsDown() const;
/**
Returns @true if the second extra button mouse button changed to up.
*/
bool Aux2Up() const;
/**
Returns @true if the identified mouse button is changing state.
Valid values of @a button are:
Returns @true if the event was generated by the specified button.
@li @c wxMOUSE_BTN_LEFT: check if left button was pressed
@li @c wxMOUSE_BTN_MIDDLE: check if middle button was pressed
@li @c wxMOUSE_BTN_RIGHT: check if right button was pressed
@li @c wxMOUSE_BTN_AUX1: check if the first extra button was pressed
@li @c wxMOUSE_BTN_AUX2: check if the second extra button was pressed
@li @c wxMOUSE_BTN_ANY: check if any button was pressed
@todo introduce wxMouseButton enum
@see wxMouseState::ButtoinIsDown()
*/
bool Button(int button) const;
bool Button(wxMouseButton but) const;
/**
If the argument is omitted, this returns @true if the event was a mouse
double click event. Otherwise the argument specifies which double click event
was generated (see Button() for the possible values).
*/
bool ButtonDClick(int but = wxMOUSE_BTN_ANY) const;
bool ButtonDClick(wxMouseButton but = wxMOUSE_BTN_ANY) const;
/**
If the argument is omitted, this returns @true if the event was a mouse
button down event. Otherwise the argument specifies which button-down event
was generated (see Button() for the possible values).
*/
bool ButtonDown(int = wxMOUSE_BTN_ANY) const;
bool ButtonDown(wxMouseButton but = wxMOUSE_BTN_ANY) const;
/**
If the argument is omitted, this returns @true if the event was a mouse
button up event. Otherwise the argument specifies which button-up event
was generated (see Button() for the possible values).
*/
bool ButtonUp(int = wxMOUSE_BTN_ANY) const;
bool ButtonUp(wxMouseButton but = wxMOUSE_BTN_ANY) const;
/**
Returns @true if this was a dragging event (motion while a button is depressed).
@@ -2088,20 +2070,6 @@ public:
*/
wxPoint GetLogicalPosition(const wxDC& dc) const;
//@{
/**
Sets *x and *y to the position at which the event occurred.
Returns the physical mouse position in pixels.
Note that if the mouse event has been artificially generated from a special
keyboard combination (e.g. under Windows when the "menu" key is pressed), the
returned position is ::wxDefaultPosition.
*/
wxPoint GetPosition() const;
void GetPosition(wxCoord* x, wxCoord* y) const;
void GetPosition(long* x, long* y) const;
//@}
/**
Get wheel delta, normally 120.
@@ -2130,16 +2098,6 @@ public:
*/
int GetWheelAxis() const;
/**
Returns X coordinate of the physical mouse event position.
*/
wxCoord GetX() const;
/**
Returns Y coordinate of the physical mouse event position.
*/
wxCoord GetY() const;
/**
Returns @true if the event was a mouse button event (not necessarily a button
down event - that may be tested using ButtonDown()).
@@ -2169,21 +2127,6 @@ public:
*/
bool LeftDown() const;
/**
Returns @true if the left mouse button is currently down, independent
of the current event type.
Please notice that it is not the same as LeftDown() which returns @true if the
event was generated by the left mouse button being pressed. Rather, it simply
describes the state of the left mouse button at the time when the event was
generated (so while it will be @true for a left click event, it can also be @true
for a right click if it happened while the left mouse button was pressed).
This event is usually used in the mouse event handlers which process "move
mouse" messages to determine whether the user is (still) dragging the mouse.
*/
bool LeftIsDown() const;
/**
Returns @true if the left mouse button changed to up.
*/
@@ -2204,12 +2147,6 @@ public:
*/
bool MiddleDown() const;
/**
Returns @true if the middle mouse button is currently down, independent
of the current event type.
*/
bool MiddleIsDown() const;
/**
Returns @true if the middle mouse button changed to up.
*/
@@ -2232,12 +2169,6 @@ public:
*/
bool RightDown() const;
/**
Returns @true if the right mouse button is currently down, independent
of the current event type.
*/
bool RightIsDown() const;
/**
Returns @true if the right mouse button changed to up.
*/