|
ubit
|
Callback conditions. More...
#include <uon.hpp>
Public Types | |
| enum | Callback { DESTRUCT_CB = 1<<12, CONTAINER_CB = 1<<13, CHANGE_CB = 1<<14, CHILD_CHANGE_CB = 1<<15, VIEW_PAINT_CB = 1<<16, VIEW_CHANGE_CB = 1<<17, SHOW_HIDE_CB = 1<<18, MOUSE_CB = 1<<19, MOUSE_CROSS_CB = 1<<20, MOUSE_DRAG_CB = 1<<21, MOUSE_MOVE_CB = 1<<22, KEY_CB = 1<<23, DND_CB = 1<<24, MESSAGE_CB = 1<<25, WIN_STATE_CB = 1<<27, SYSWM_CB = 1<<28, USER_EVENT_CB = 1<<29, CALLBACKS } |
| enum | IState { ANY = -1, IDLE = 0, DISABLED, ENTERED, ARMED, ACTIONED, DRAGGED, DROP_ENTERED, ACTION_COUNT } |
Public Member Functions | |
| UOn (int id, long callback_mask, int istate=-1) | |
| virtual int | getID () const |
| < creates a callback condition. More... | |
| virtual bool | operator== (const UCond &) const |
| virtual bool | operator!= (const UCond &) const |
| virtual const UCond * | matches (const UCond &) const |
| virtual bool | verifies (const UUpdateContext &, const UElem &) const |
| virtual UOn * | toOn () |
| virtual const UOn * | toOn () const |
Public Attributes | |
| const int | ID |
Static Public Attributes | |
| static UOn | idle |
| no event condition. More... | |
| static UOn | action |
| detects that a high-level "action" was performed on a widget. More... | |
| static UOn & | arm |
| static UOn & | disarm |
| detects that a widget was "armed" or "disarmed". More... | |
| static UOn & | select |
| static UOn & | deselect |
| detects that a widget was "selected" or "deselected". More... | |
| static UOn | enter |
| static UOn | leave |
| detects that the mouse entered or left a widget. More... | |
| static UOn | click |
| static UOn | doubleClick |
| detects that the mouse was clicked or double-clicked on a widget. More... | |
| static UOn | mpress |
| static UOn | mrelease |
| static UOn | mdrag |
| static UOn | mmove |
| detects that the mouse was pressed, released, dragged or moved. More... | |
| static UOn | wheel |
| detects that the wheel was moved while the mouse was over a widget. More... | |
| static UOn | kpress |
| static UOn | krelease |
| fire callbacks when a key is pressed or released. More... | |
| static UOn | ktype |
| fire callbacks when a text is entered by pressing a key. More... | |
| static UOn & | dragStart |
| static UOn & | dragDone |
| static UOn & | dropEnter |
| static UOn & | dropLeave |
| static UOn & | dropDone |
| detects drag and drop events occuring on a widget. More... | |
| static UOn | show |
| static UOn | hide |
| detect that a widget was shown or hidden. More... | |
| static UOn | close |
| fires callbacks when a window (or a menu) is closed by the window manager ( More... | |
| static UOn | paint |
| detect that a widget was repainted. More... | |
| static UOn | resize |
| static UOn | motion |
| detect that a widget was resized or moved. More... | |
| static UOn | addChild |
| static UOn | removeChild |
| fire callbacks when a child is added to / removed from an object. More... | |
| static UOn | destruct |
| detects when an object is being destructed. | |
| static UOn | winState |
| fires callbacks when a window state is changed. More... | |
| static UOn | sysWM |
| fires callbacks when a platform-dependent window manager event is received. More... | |
| static UOn | change |
| fires callbacks when the value of an object is changed. More... | |
| static UOn | propChange |
| static UOn | dataChange |
| static UOn | strChange |
| static UOn | userEvent |
| < child change conditions. More... | |
Protected Member Functions | |
| virtual void | setParentModes (UElem &parent) const |
Protected Attributes | |
| long | callback_mask |
| int | istate |
Friends | |
| class | UElem |
Callback conditions.
specify when callback functions are fired or when 'conditional' attributes are activated.
Note that:
| enum ubit::UOn::Callback |
|
inlinevirtual |
< creates a callback condition.
callback conditions have a unique ID. IDs in the range [0-100] are reserved for standard event conditions. IDs > 100 can be used for custom client conditions. Notes:
|
virtual |
!!PBM: pas le meme test que pour les callbacks!!
Implements ubit::UCond.
|
static |
detects that a high-level "action" was performed on a widget.
the semantics of this "action" depends on the widget (e.g. a mouse click or a SPACE key press for a button, an ENTER key press for a textfield).
Callback functions triggered by UOn::action can have an optional UEvent parameter.
|
static |
|
static |
fires callbacks when the value of an object is changed.
this condition detects when:
Notes for UChoice, UListbox, UCombobox:
|
static |
fires callbacks when a window (or a menu) is closed by the window manager (
|
static |
detects that a widget was "selected" or "deselected".
Certain widgets, such as UCheckbox or UListbox items can be selected. Besides, any widget deriving from UBox can be made "selectable" by UElem::setSelectable().
Callback functions triggered by UOn::select and UOn::deselect can have an optional UEvent parameter.
|
static |
detects that a widget was "armed" or "disarmed".
The semantics of 'arm' and 'disarm' depends on the widget. An individual button is armed when it is pressed then disarmed when it is released. It is also disarmed/armed if the mouse moves outside/inside the button while being pressed.
This behavior is slightly different in lists and menus: an item is armed when the mouse enters even if the initial mouse press was performed on another item.
Any widget deriving from UBox can be made "armable" by UElem::setArmable(). Most interactors (e.g. UButton, UCheckbox...) are armable by default.
Callback functions triggered by UOn::arm and UOn::disarm can have an optional UEvent parameter.
|
static |
detects that the mouse was clicked or double-clicked on a widget.
These conditions are applicable to any widget that derives from UBox.
Callback functions triggered by UOn::click and UOn::doubleClick can have an optional UMouseEvent parameter which has a getClickCount() method.
The radius and the delay for detecting mouse clicks depend on UConf::click_radius and UConf::click_delay.
|
static |
|
static |
|
static |
detects drag and drop events occuring on a widget.
|
static |
|
static |
|
static |
detect that a widget was shown or hidden.
these callbacks are ONLY fired when show(true) or show(false) is applied to a widget (currently, they are not fired if a parent was shown or hidden)
|
static |
fire callbacks when a key is pressed or released.
these are low-level conditions that do not compose characters. For instance, typing SHIFT 'A' produces 2 kpress and 2 krelease events. UOn::ktype, that composes characters, should be used in most cases. Callbacks can have an optional UKeyEvent parameter. Their getKeyCode() method returns a code that identifies the key.
The box that gets these events is the one that has the input focus (which is the box where the mouse is currenly located in the current version of the toolkit) Note that mouse and key these conditions only apply to boxes (ie. objects that derive from UBox)
|
static |
fire callbacks when a text is entered by pressing a key.
in constrast with kpress, ktype composes characters and it is only fired when printable characters are typed. For instance, typing SHIFT 'A' produce only one ktype event. Callbacks can have an optional UKeyEvent parameter. Their getChar() method returns the composed character (for instance, if SHIFT was pressed, it will return 'uppercase A' rather than 'lowercase A')
The box that gets these events is the one that has the input focus (which is the box where the mouse is currenly located in the current version of the toolkit) Note that mouse and key these conditions only apply to boxes (ie. objects that derive from UBox)
|
static |
detects that the mouse entered or left a widget.
These conditions are applicable to any widget that derives from UBox.
Callback functions triggered by UOn::enter and UOn::leave can have an optional UMouseEvent parameter.
|
static |
detects that the mouse was pressed, released, dragged or moved.
These conditions are applicable to any widget that derives from UBox.
Callback functions triggered by these conditions can have an optional UMouseEvent parameter which have several useful methods such as getSource(), getX(), getY() that return the corresponding widget and the position of the mouse relatively from its origin.
It is worth noticing that drag and release events are always related to the widget where the mouse press occured, even if the mouse is now located on another widget (this is not the case for move events as no widget was pressed).
Notes:
|
static |
detect that a widget was resized or moved.
These conditions are applicable to any widget that derives from UBox.
Callback functions triggered by these conditions can have an optional UEvent parameter
A UBox can have multiple views. Callback functions are then fired for each view that has been resized or moved.
|
static |
detect that a widget was repainted.
This condition is applicable to any widget that derives from UBox.
Callback functions triggered by UOn::paint can have an optional UPaintEvent parameter which have several useful methods such as getSource(), getView(), getClip(), etc.
A UBox can have multiple views. Callback functions are then fired for each view that has been repainted.
|
static |
|
static |
|
static |
fires callbacks when a platform-dependent window manager event is received.
this condition only apply for windows. When X11 is used, it will be fired when X11 properties are changed and, non-Ubit client messages are received (see UOn::message).
|
static |
< child change conditions.
these conditions detects when a child of a box is changed:
|
static |
detects that the wheel was moved while the mouse was over a widget.
This condition is applicable to any widget that derives from UBox. The widget that receive the wheel events is the one where the mouse is currenly located.
Callback functions triggered by UOn::wheel can have an optional UWheelEvent parameter which has getWheelDelta() method that returns the amount of wheel movement
|
static |
fires callbacks when a window state is changed.
this condition only applies for windows. It is fired by map, unmap and window state events.
1.8.12