ubit::UOn Class Reference

Event conditions. More...

#include <uon.hpp>

Inheritance diagram for ubit::UOn:

ubit::UCond List of all members.

Public Member Functions

 UOn (short id)
 !CAUTION: NEVER delete UOn instances.
virtual int getID () const
virtual bool operator== (const UCond &) const
virtual bool operator!= (const UCond &) const
virtual const UCondmatches (const UCond &) const
virtual bool verifies (const UContext &, const UControl *) const
virtual UOnonCast ()
virtual const UOnonCast () const
virtual void setParentModes (UControl *parent) const
 UOn (short id, UMask bmodes)
 UOn (short id, UMask bmodes, UMask cmodes, short state)

Public Attributes

const short ID

Static Public Attributes

static UOn idle
 no event condition.
static UOn action
 fires callbacks when the box is "activated".
static UOn arm
static UOn disarm
 fire callbacks when the box is "armed" or "disarmed".
static UOn enter
static UOn leave
 fire callbacks when the mouse enter or leaves the box.
static UOn click
static UOn doubleClick
 fire callbacks when the mouse is clicked or double clicked in the box.
static UOn mpress
static UOn mrelease
static UOn mdrag
static UOn mmove
 fire callbacks when the mouse is pressed, released, dragged, moved in a box.
static UOn wheel
 fires callbacks when the mouse wheel is rotated.
static UOn kpress
static UOn krelease
 fire callbacks when a key is pressed or released.
static UOn ktype
 fire callbacks when a text is entered by pressing a key.
static UOn dragStart
static UOn dragDone
static UOn dropEnter
static UOn dropLeave
static UOn dropDone
 drag and drop.
static UOn show
static UOn hide
 fires callbacks when a box is shown or hidden.
static UOn paint
static UOn resize
 fires callbacks when a box view is repainted or resized.
static UOn select
static UOn deselect
 fire callbacks when a "selectable" box is selected or deselected.
static UOn change
 fires callbacks when the value of an object is changed.
static UOn propChange
static UOn dataChange
static UOn strChange
static UOn addChild
 < child change conditions.
static UOn removeChild
 fire callbacks when a child is added to / removed from an object.
static UOn destruct
 fires callbacks when an object is destructed.
static UOn close
 fires callbacks when a window is closed externally.
static UOn winConfigure
 fires callbacks when a window is configured.
static UOn winProperty
 fires callbacks when a window property is changed.
static UOn winMessage
 fires callbacks when a window receives a message.
static UOn filterEvent
 intercepts events *before* they reach their final target.
static UOn userEvent
 user events
static UOn miscEvent
 other events
static UOn mrelax
 obsolete.

Friends

class UControl
class UGroup
class UEvent

Detailed Description

Event conditions.

specify when callback functions are fired or when conditionnal objects are activated. Examples:

 ubutton("Click Me"    + UOn::action / ucall(arg, myfunc))
 uhbox("Press Me"      + UOn::mpress / ucall(obj, &Myclass::mymethod))
 ucheckbox("Select Me" + UOn::select / UColor::red + UOn::unselect / UColor::blue)
 
Notes:

See also:
also: the UCall class and the ucall() templates.


Member Function Documentation

bool ubit::UOn::verifies ( const UContext ,
const UControl  
) const [virtual]

Implements ubit::UCond.


Member Data Documentation

UOn ubit::UOn::action [static]

fires callbacks when the box is "activated".

"activated" depends on the semantics of the box. For instance, UButton instances are activated by clicking on them or by typing the SPACE key when they have the focus while UTextfield instances are activated by typing on the ENTER or RETURN key. No action occur if the widget is disabled (

See also:
UGroup::enable()).
Callbacks can have an optional UEvent parameter. In most cases, this UEvent is actually a UMouseEvent or a UKeyEvent. Dynamic cast or methods UEvent::mouseEvent() and keyEvent() can be used to perform the conversion

See also:
also: UOn::arm, UOn::disarm

UOn ubit::UOn::addChild [static]

< child change conditions.

these conditions detects when a child of a box is changed:

UOn ubit::UOn::change [static]

fires callbacks when the value of an object is changed.

this condition detects when:

Notes for UChoice, UListbox, UCombobox:

UOn ubit::UOn::close [static]

fires callbacks when a window is closed externally.

this condition only apply for windows and menus (ie. objects that derive from UWin such as UFrame, UDialog, UMenu). A window is closed when its UWin::close() method is called. In most cases, close() just hides the window, but some subclasses redefine it to perform specifir behaviors (e.g. the UFrame::close() method of the main frame quits the application)

UOn ubit::UOn::deselect [static]

fire callbacks when a "selectable" box is selected or deselected.

Boxes must be "selectable" to receive these events. UCheckbox instances and UListbox children are "selectable" by default. Adding UMode::canSelect to any box makes it "selectable". Callbacks can have an optional UEvent parameter.

UOn ubit::UOn::destruct [static]

fires callbacks when an object is destructed.

these callbacks are fired by the object destructor.

UOn ubit::UOn::disarm [static]

fire callbacks when the box is "armed" or "disarmed".

as for UOn::action, these conditions depends on the semantics of the box. For instance, a UButton is armed when it is pressed then disarmed when it is released or if the mouse leaves this button. It is armed again if the mouse is moved back inside the button (and if the mouse remains pressed), and so on.

In lists and menu systems, a button is armed if the mouse is pressed somewhere in the menu or the list then moved inside this button. This specific way of arming (and activating) menu and list buttons is called "browsing".

Boxes must be "armable" to receive these events. Most interactors are armable by default. Adding UMode::canArm to any box makes it "armable".

Callbacks can have an optional UEvent parameter: see UOn::action for details.

See also:
also: UOn::action.

UOn ubit::UOn::doubleClick [static]

fire callbacks when the mouse is clicked or double clicked in the box.

Callbacks may have an optional UMouseEvent parameter. Its getClickCount() method returns the number of clicks. The radius and the delay for detecting mouse clicks is set by UConf::click_radius, UConf::click_delay.

UOn ubit::UOn::filterEvent [static]

intercepts events *before* they reach their final target.

This makes it possible to detect, filter and modify events while they are traversing the widget graph. The final target receives the events as usual, except if the filterEvent callback function calls UEvent::ignore() or UEvent::consume() or if its changes its coordinates. filterEvent callbacks are especially useful for implementing transparent tools and for sophisticated event management

Notes:

UOn ubit::UOn::hide [static]

fires callbacks when a box is shown or hidden.

these callbacks are fired when show(true) or show(false) is applied to an object. Note that they are not called recursively on children.

UOn ubit::UOn::idle [static]

no event condition.

this condition is useful for Style specs.

UOn ubit::UOn::krelease [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. Its 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)

See also:
: UOn::ktype

UOn ubit::UOn::ktype [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. Its 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)

See also:
: UOn::kpress, UOn::krelease

UOn ubit::UOn::leave [static]

fire callbacks when the mouse enter or leaves the box.

Callbacks may have an optional UMouseEvent parameter.

UOn ubit::UOn::mmove [static]

fire callbacks when the mouse is pressed, released, dragged, moved in a box.

the box that gets mpress and mmove events is the one where the mouse is currenly located. The box that gets mrelease and mdrag events is the one that got the mpress (which is not necessarily the box where the mouse is now located!). Callbacks can have an optional UMouseEvent parameter. Its coordinates are relative to the box that got the event.

mpress, mrelease events are repeated if the box is in auto repeat mode (

See also:
UMode::autoRepeat). Event conditions are fired in the following order (when they are applicable): mpress / arm / action / click / disarm / mrelease. Note that mouse and key these conditions only apply to boxes (ie. objects that derive from UBox)

UOn ubit::UOn::removeChild [static]

fire callbacks when a child is added to / removed from an object.

objects must derive from UGroup. Callbacks can have an optional UEvent parameter. Its getTarget() method returns the child that was added or removed (beware: this child may have been destroyed in the latter case!)

UOn ubit::UOn::resize [static]

fires callbacks when a box view is repainted or resized.

these conditions only apply to boxes. They are fired when a box view is repainted or resized (note that boxes can have several views)

UOn ubit::UOn::wheel [static]

fires callbacks when the mouse wheel is rotated.

the box that gets wheel events is the one where the mouse is currenly located. Callbacks can have an optional UWheelEvent parameter. Its getWheelDelta() method returns the amount of wheel movement

UOn ubit::UOn::winConfigure [static]

fires callbacks when a window is configured.

this condition only apply for windows. It is fired by map, unmap and window state events.

UOn ubit::UOn::winMessage [static]

fires callbacks when a window receives a message.

this condition only apply for windows. It is fired by X client message events.

See also:
also: UAppli::onMessage()

UOn ubit::UOn::winProperty [static]

fires callbacks when a window property is changed.

this condition only apply for windows. It is fired by X property events.


The documentation for this class was generated from the following files:
Generated on Mon Jan 29 00:20:54 2007 for Ubit by  doxygen 1.4.7