|
ubit
|
mouse events More...
#include <uevent.hpp>
Public Member Functions | |
| UMouseEvent (const UCond &, UView *source, UEventFlow *, unsigned long time, int state, const UPoint &pos, const UPoint &abs_pos, int btn) | |
| virtual UMouseEvent * | toMouseEvent () |
| float | getX () const |
| returns the X coordinate of the mouse in getView(). | |
| float | getY () const |
| returns the Y coordinate of the mouse in getView(). | |
| const UPoint & | getPos () const |
| returns the coordinates of the mouse in getView(). | |
| const UPoint & | getScreenPos () const |
| returns the screen coordinates of the mouse. | |
| UPoint | getPosIn (const UView &view) const |
| returns the coordinates of this event in this 'view'. | |
| UPoint | getPosIn (const UBox &parent_box) const |
| returns the coordinates of this event in parent_box. More... | |
| UPoint | getPosAndViewIn (const UBox &parent, UView *&parent_view) const |
| returns the coordinates of this event in 'parent' and the corresponding 'parent's view. More... | |
| int | getClickCount () const |
| returns the number of mouse clicks. | |
| int | getButton () const |
| returns the button that was just pressed or released. More... | |
| int | getButtons () const |
| returns an ORed mask of mouse buttons after the event occured. More... | |
| void | translatePos (float x, float y) |
| translates the mouse position. | |
| void | propagate () |
| propagates events in children: More... | |
| void | setFirstDrag (bool s) |
| bool | isFirstDrag () const |
| bool | isBrowsing () const |
| UStr * | getStr () |
| returns the UStr object that is under the mouse ( More... | |
| UStr * | getStr (UDataContext &) |
| returns the UStr object that is under the mouse and related properties ( More... | |
| UData * | getData () |
| returns the UData object that is under the mouse ( More... | |
| UData * | getData (UDataContext &) |
| returns the UData object that is under the mouse and related properties. More... | |
Public Member Functions inherited from ubit::UInputEvent | |
| UInputEvent (const UCond &, UView *source_view, UEventFlow *, unsigned long when, int state) | |
| virtual UInputEvent * | toInputEvent () |
| dynamic cast: returns 'this' converted to the requested class or null. | |
| virtual UElem * | getSource () const |
| returns the object that received this event. | |
| UView * | getView () const |
| returns the object's view that received this event. More... | |
| UView * | getViewOf (const UBox &box) const |
| returns the view of 'box' that (indirectly) received this event. More... | |
| unsigned long | getWhen () const |
| returns the time when this event was produced. | |
| virtual int | getModifiers () const |
| returns an ORed mask of mouse buttons and modifiers that are pressed. More... | |
| bool | isShiftDown () const |
| bool | isControlDown () const |
| bool | isMetaDown () const |
| bool | isAltDown () const |
| bool | isAltGraphDown () const |
| UWin * | getWin () const |
| returns the hard window that received this event. | |
| UView * | getWinView () const |
| returns the view of the hard window that received this event. | |
| UEventFlow * | getFlow () const |
| returns the Event Flow that received this event (for two-handed interaction or groupware). More... | |
| UDisp * | getDisp () const |
| returns the display that received this event. More... | |
| bool | dontCloseMenu () const |
| impl. | |
Public Member Functions inherited from ubit::UEvent | |
| UEvent (const UCond &c, UObject *source, UObject *aux=null) | |
| const UCond & | getCond () const |
| returns the event condition that detected this event. More... | |
| virtual UObject * | getAux () const |
| returns auxilliary data. | |
| virtual UKeyEvent * | toKeyEvent () |
| virtual UWheelEvent * | toWheelEvent () |
| virtual UViewEvent * | toViewEvent () |
| virtual UPaintEvent * | toPaintEvent () |
| virtual UResizeEvent * | toResizeEvent () |
| virtual UTimerEvent * | toTimerEvent () |
| virtual UWinEvent * | toWinEvent () |
| virtual UMessageEvent * | toMessageEvent () |
| virtual USysWMEvent * | toSysWMEvent () |
| virtual UUserEvent * | toUserEvent () |
| void | setCond (const UCond &) |
Protected Attributes | |
| int | button |
| int | click_count |
| UPoint | pos |
| UPoint | abs_pos |
Protected Attributes inherited from ubit::UInputEvent | |
| struct ubit::UInputEvent::Modes | modes |
| int | state |
| unsigned long | when |
| UView * | source_view |
| UEventFlow * | eflow |
| UElem * | event_observer |
Protected Attributes inherited from ubit::UEvent | |
| const UCond * | cond |
| UObject * | source |
| UObject * | aux |
Friends | |
| class | UEventFlow |
| class | UElem |
| class | UView |
| class | UFlowView |
Additional Inherited Members | |
Static Public Member Functions inherited from ubit::UModifier | |
| static void | mapKeys (UDisp *) |
| impl: init keys mapping. | |
Static Public Attributes inherited from ubit::UModifier | |
| static const int | LeftButton |
| static const int | RightButton |
| static const int | MidButton |
| static const int | ShiftDown |
| static const int | ControlDown |
| static const int & | MetaDown |
| static const int & | AltDown |
| static const int | AltGraphDown |
mouse events
|
inline |
returns the button that was just pressed or released.
returns one of: UEvent::LeftButton, MidButton, RightButton for UOn::mpress and UOn::mrelease events. Returns 0 for UOn::mmove or UOn::mdrag events. Example:
class MyClass {
public:
Myclass(); // contructor
private:
void pressCB(UMouseEvent&);
}; MyClass::MyClass() {
....
ubutton("Press Me" + ucall(this, &MyClass::pressCB))
....
} void MyClass::pressCB(UMouseEvent& e) {
if (e.getButton() == e.RightButton && e.isControlDown())
// done when the left mouse button AND the control key are pressed
}
| int UMouseEvent::getButtons | ( | ) | const |
returns an ORed mask of mouse buttons after the event occured.
button mask are UEvent::LeftButton, MidButton, RightButton. They are defined in class UModifier and inherited by UEvent. see UInputEvent::getModifiers() for examples.
| UData * UMouseEvent::getData | ( | ) |
returns the UData object that is under the mouse (
| UData* ubit::UMouseEvent::getData | ( | UDataContext & | ) |
returns the UData object that is under the mouse and related properties.
returns the coordinates of this event in 'parent' and the corresponding 'parent's view.
returns point (0,0) and 'parent_view' == null if the mouse is not located inside 'parent'.
returns the coordinates of this event in parent_box.
returns point (0,0) if the mouse is not located inside 'parent_box'.
| UStr * UMouseEvent::getStr | ( | ) |
returns the UStr object that is under the mouse (
| UStr* ubit::UMouseEvent::getStr | ( | UDataContext & | ) |
returns the UStr object that is under the mouse and related properties (
|
inline |
propagates events in children:
1.8.12