Hasty Badger
Small UI library (a branch of Turbo Badger)
|
Public Member Functions | |
TBOBJECT_SUBCLASS (TBWidgetEvent, TBTypedObject) | |
TBWidgetEvent (EVENT_TYPE type) | |
TBWidgetEvent (EVENT_TYPE type, int x, int y, bool touch, MODIFIER_KEYS modifierkeys=TB_MODIFIER_NONE) | |
int | GetCountCycle (int max) |
The count value may be 1 to infinity. More... | |
bool | IsPointerEvent () const |
bool | IsKeyEvent () const |
Public Member Functions inherited from tb::TBTypedObject | |
virtual bool | IsOfTypeId (const TB_TYPE_ID type_id) const |
Returns true if the class or the base class matches the type id. | |
template<class T > | |
T * | SafeCastTo () const |
Returns this object as the given type or nullptr if it's not that type. More... | |
template<class T > | |
bool | IsOfType () const |
Return true if this object can safely be casted to the given type. More... | |
virtual const char * | GetClassName () const |
Get the classname of the object. More... | |
Public Attributes | |
TBWidget * | target |
The widget that invoked the event. | |
EVENT_TYPE | type |
Which type of event. | |
int | target_x |
X position in target widget. Set for all pointer events, click and wheel. | |
int | target_y |
Y position in target widget. Set for all pointer events, click and wheel. | |
int | delta_x |
Set for EVENT_TYPE_WHEEL. Positive is a turn right. | |
int | delta_y |
Set for EVENT_TYPE_WHEEL. Positive is a turn against the user. | |
int | count |
1 for all events, but increased for POINTER_DOWN event to 2 for doubleclick, 3 for tripleclick and so on. More... | |
int | key |
for EVENT_TYPE_KEY_* the key, or 0 if key is in special_key; for EVENT_TYPE_FINGER_* is the finger number. More... | |
SPECIAL_KEY | special_key |
MODIFIER_KEYS | modifierkeys |
TBID | ref_id |
Sometimes (when documented) events have a ref_id (The id that caused this event) | |
bool | touch |
Set for pointer events. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from tb::TBTypedObject | |
template<class T > | |
static TB_TYPE_ID | GetTypeId () |
A static template method that returns a unique id for each type. More... | |
|
inline |
The count value may be 1 to infinity.
If you f.ex want to see which count it is for something handling click and double click, call GetCountCycle(2). If you also handle triple click, call GetCountCycle(3) and so on. That way you'll get a count that always cycle in the range you need.
int tb::TBWidgetEvent::count |
1 for all events, but increased for POINTER_DOWN event to 2 for doubleclick, 3 for tripleclick and so on.
For FINGER events, this is the number of active fingers.
int tb::TBWidgetEvent::key |
for EVENT_TYPE_KEY_* the key, or 0 if key is in special_key; for EVENT_TYPE_FINGER_* is the finger number.
bool tb::TBWidgetEvent::touch |
Set for pointer events.
True if the event is a touch event (finger or pen on screen) False if mouse or other cursor input.