#include <MouseEvent.h>
It has a trigger mouse button (the button of the mouse that was the trigger of the event), a point where the event was happend (relative to the widget's client area).
This kind of event is generated when the mouse position is changed, the wheel is moved, or a button is pressed (click or double-click).
getButton returns MouseButton::None if the event was produced by mouse movement (no button was pressed to trigger the event).
Public Member Functions | |
MouseEvent (Widget *source, Point point, int clicks, int flags, MouseButton trigger, int delta=0) | |
Creates an event from the mouse. | |
virtual | ~MouseEvent () |
int | getX () const |
Returns the X component of the mouse position (getPoint). | |
int | getY () const |
Returns the Y component of the mouse position (getPoint). | |
Point | getPoint () const |
Returns the mouse position relative to the Widget client area. | |
int | getClicks () const |
Returns how many clicks the user did:. | |
MouseButton | getButton () const |
Returns the button that trigger the event (if the event is Widget::onMouseUp or Widget::onMouseDown). | |
bool | isLeftButtonPressed () const |
Returns true if the left button was pressed when the event was generated. | |
bool | isRightButtonPressed () const |
Returns true if the left button was pressed when the event was generated. | |
bool | isMiddleButtonPressed () const |
Returns true if the middle button was pressed when the event was generated. | |
bool | isShiftKeyPressed () const |
bool | isControlKeyPressed () const |
bool | isAltKeyPressed () const |
int | getDelta () const |
Private Attributes | |
Point | m_point |
int | m_clicks |
int | m_flags |
MouseButton | m_trigger |
int | m_delta |
MouseEvent::MouseEvent | ( | Widget * | source, | |
Point | point, | |||
int | clicks, | |||
int | flags, | |||
MouseButton | trigger, | |||
int | delta = 0 | |||
) |
Creates an event from the mouse.
source | Source of the event (a Widget or Component) | |
point | Point where the mouse happened | |
clicks | How many clicks the user pressed? 1 means click-down, 2 means double-click. | |
flags | Flags used internally (see MK_* constants of Win32) | |
trigger | Which buttons were pressed | |
delta | The wheel delta (Z axis) counted in notches. |
MouseEvent::~MouseEvent | ( | ) | [virtual] |
int MouseEvent::getX | ( | ) | const |
Returns the X component of the mouse position (getPoint).
The position is relative to the client-bounds of the source.
int MouseEvent::getY | ( | ) | const |
Returns the Y component of the mouse position (getPoint).
The position is relative to the client-bounds of the source.
Point MouseEvent::getPoint | ( | ) | const |
int MouseEvent::getClicks | ( | ) | const |
Returns how many clicks the user did:.
MouseButton MouseEvent::getButton | ( | ) | const |
Returns the button that trigger the event (if the event is Widget::onMouseUp or Widget::onMouseDown).
bool MouseEvent::isLeftButtonPressed | ( | ) | const |
bool MouseEvent::isRightButtonPressed | ( | ) | const |
bool MouseEvent::isMiddleButtonPressed | ( | ) | const |
Returns true if the middle button was pressed when the event was generated.
The middle button could be the wheel in modern mouses with wheel.
bool MouseEvent::isShiftKeyPressed | ( | ) | const |
bool MouseEvent::isControlKeyPressed | ( | ) | const |
bool MouseEvent::isAltKeyPressed | ( | ) | const |
int MouseEvent::getDelta | ( | ) | const |
Point Vaca::MouseEvent::m_point [private] |
int Vaca::MouseEvent::m_clicks [private] |
int Vaca::MouseEvent::m_flags [private] |
MouseButton Vaca::MouseEvent::m_trigger [private] |
int Vaca::MouseEvent::m_delta [private] |