#include <uevent.hpp>
Inheritance diagram for ubit::UMouseEvent:
Public Member Functions | |
virtual UMouseEvent * | mouseEvent () |
int | getX () const |
int | getY () const |
return the location of the mouse in getView(). | |
int | getXwin () const |
int | getYwin () const |
return the location of the mouse in getWinView(). | |
int | getXscreen () const |
int | getYscreen () const |
return the location of the mouse on the screen. | |
virtual int | getButton () const |
returns the button that was just pressed or released. | |
virtual int | getClickCount () const |
returns the number of mouse clicks. | |
virtual bool | isBrowsing () const |
virtual bool | isFirstDrag () const |
virtual UData * | getData () |
virtual UStr * | getStr () |
virtual UData * | getData (UDataProps &) |
virtual UStr * | getStr (UDataProps &) |
returns the UData/the UStr that was under the mouse. | |
int | getButtons () const |
obsolete: use getState() or getButtonMask(). | |
UMouseEvent (UEventFlow *f, UView *v, USysEvent e, UTime t, const UCond &c) |
int ubit::UMouseEvent::getButton | ( | ) | const [virtual] |
returns the button that was just pressed or released.
returns one of UEvent::LeftButton, MidButton, RightButton for UOn::mpress and UOn::mrelease events. BEWARE: returns 0 for move or drag events. Exemple:
void pressCB(UMouseEvent& e) { if (e.getCond() == UOn::mpress && (e.getButton() == e::RightButton || (e.getButton() == e::LeftButton && e.isControlDown())) ) { ..... } }
UStr * ubit::UMouseEvent::getStr | ( | UDataProps & | ) | [virtual] |
returns the UData/the UStr that was under the mouse.
returns null if no UData/UStr found. Optional argument UDataProps is filled with useful info on the retreived object (see UDataProps).
Note on UStr(s) which are rendered on several lines (UFlowview rendering) : the region returned in UDataProps does not contain the entire string but just the line that is beneath the mouse