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

@@ -1228,19 +1228,6 @@ private:
wxEVT_NC_RIGHT_DCLICK,
*/
// the symbolic names for the mouse buttons
enum
{
wxMOUSE_BTN_ANY = -1,
wxMOUSE_BTN_NONE = 0,
wxMOUSE_BTN_LEFT = 1,
wxMOUSE_BTN_MIDDLE = 2,
wxMOUSE_BTN_RIGHT = 3,
wxMOUSE_BTN_AUX1 = 4,
wxMOUSE_BTN_AUX2 = 5,
wxMOUSE_BTN_MAX
};
class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent,
public wxMouseState
{
@@ -1265,12 +1252,9 @@ public:
// Was it a up event from this (or any) button?
bool ButtonUp(int but = wxMOUSE_BTN_ANY) const;
// Was the given button?
// Was this event generated by the given button?
bool Button(int but) const;
// Was the given button in Down state?
bool ButtonIsDown(int but) const;
// Get the button which is changing state (wxMOUSE_BTN_NONE if none)
int GetButton() const;
@@ -1293,14 +1277,6 @@ public:
bool Aux1DClick() const { return (m_eventType == wxEVT_AUX1_UP); }
bool Aux2DClick() const { return (m_eventType == wxEVT_AUX2_UP); }
// Find the current state of the mouse buttons (regardless
// of current event type)
bool LeftIsDown() const { return m_leftDown; }
bool MiddleIsDown() const { return m_middleDown; }
bool RightIsDown() const { return m_rightDown; }
bool Aux1IsDown() const { return m_aux1Down; }
bool Aux2IsDown() const { return m_aux2Down; }
// True if a button is down and the mouse is moving
bool Dragging() const
{
@@ -1322,36 +1298,9 @@ public:
// Returns the number of mouse clicks associated with this event.
int GetClickCount() const { return m_clickCount; }
// Find the position of the event
void GetPosition(wxCoord *xpos, wxCoord *ypos) const
{
if (xpos)
*xpos = m_x;
if (ypos)
*ypos = m_y;
}
void GetPosition(long *xpos, long *ypos) const
{
if (xpos)
*xpos = (long)m_x;
if (ypos)
*ypos = (long)m_y;
}
// Find the position of the event
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
// Find the logical position of the event given the DC
wxPoint GetLogicalPosition(const wxDC& dc) const;
// Get X position
wxCoord GetX() const { return m_x; }
// Get Y position
wxCoord GetY() const { return m_y; }
// Get wheel rotation, positive or negative indicates direction of
// rotation. Current devices all send an event when rotation is equal to
// +/-WheelDelta, but this allows for finer resolution devices to be
@@ -1389,14 +1338,6 @@ public:
}
public:
wxCoord m_x, m_y;
bool m_leftDown;
bool m_middleDown;
bool m_rightDown;
bool m_aux1Down;
bool m_aux2Down;
int m_clickCount;
int m_wheelAxis;