#include <ucontrol.hpp>
Inheritance diagram for ubit::UControl:
Public Types | |
NORMAL = 0 | |
BROWSE = 1 | |
TYPE = 2 | |
enum | InputType { NORMAL = 0, BROWSE = 1, TYPE = 2 } |
Public Member Functions | |
UControl () | |
constructor (see: ~UBrick and ~UGroup for more info). | |
virtual void | update (const UUpdate &)=0 |
updates paint and/or layout according to the UUpdate argument. | |
virtual void | update () |
updates the layout AND the paint. | |
virtual void | updatePaint () |
updates the paint (shortcut for: update(UUpdate::paint)). | |
virtual void | updateView (UEvent &, UView *, const UUpdate &)=0 |
updates a UView that is managed by this object. | |
virtual bool | isShown () const |
returns true if this object is shown. | |
bool | isShowable () const |
returns true if this object can be shown. | |
bool | isEnabled () const |
returns true if this object is currently enabled. | |
virtual void | setEnabled (bool state, bool call_callbacks=true) |
enables this object if 'state' is true; disables it if false. | |
void | enable (bool state=true) |
void | disable () |
bool | isSelected () const |
returns true if this object is currently selected. | |
virtual void | setSelected (bool state, bool call_callbacks=true) |
selects this object if 'state' is true; unselects it if false. | |
void | select (bool state, bool call_cb=true) |
synononym of setSelected(). | |
bool | isArmed () const |
bool | isArmable () const |
checks/specifies if this object can be armed. | |
bool | isEntered () const |
bool | isActionPerformed () const |
bool | isDragged () const |
UMask | getCModes () const |
[impl] returns the current C-Modes bitmask. | |
bool | hasCMode (UMask modes) const |
[impl] returns true if ONE of these C-Modes are verified. | |
void | addCModes (UMask modes) |
[impl] add these modes to the C-Modes bitmask. | |
void | removeCModes (UMask modes) |
[impl] remove these modes from the C-Modes bitmask. | |
short | getInterState () const |
[impl] returns the internal interactive state. | |
void | setInterState (short) |
[impl] changes the internal interactive state. | |
virtual void | enterBehavior (UEventFlow &, UEvent &, int input_type=0) |
virtual void | leaveBehavior (UEventFlow &, UEvent &) |
virtual void | keyPressBehavior (UEventFlow &, UEvent &) |
virtual void | keyReleaseBehavior (UEventFlow &, UEvent &) |
virtual void | armBehavior (UEventFlow &, UEvent &, int input_type=0) |
virtual bool | disarmBehavior (UEventFlow &, UEvent &, int input_type=0) |
virtual void | actionBehavior (UEventFlow &, UEvent &) |
virtual void | changeBehavior (UEventFlow &, UEvent &) |
[impl] behavioral functions. | |
Protected Attributes | |
UMask | cmodes |
short | istate |
Friends | |
class | UMode |
class | UOn |
class | UAppli |
class | UEventFlow |
this class controls object's interaction. It is a superclass of UGroup, so that all container objects have the same basic interactive capabilities. In other words, a UBox object can behave in the same way as a UButton, a UCheckbox or a textual object depending on how UControl has been set.
void ubit::UControl::changeBehavior | ( | UEventFlow & | , | |
UEvent & | ||||
) | [virtual] |
[impl] behavioral functions.
these functions are called when the object receives the corresponding events. Usually, these functions should not be redefined by clients. Instead, clients should add UOn::xxx conditions that are called by these functions
bool ubit::UControl::isArmable | ( | ) | const |
checks/specifies if this object can be armed.
a armable object *behaves* as a button (but its appearance depends on its own UStyle). any object can be made armable by calling setArmable() or by adding UMode::canArm to it.
bool ubit::UControl::isEnabled | ( | ) | const |
returns true if this object is currently enabled.
'enabled' means: sensible to high-level events such as: UOn::action, UOn::arm, UOn::disarm, etc.
bool ubit::UControl::isSelected | ( | ) | const |
returns true if this object is currently selected.
an object can be selected if isSelectable() returns true.
bool ubit::UControl::isShowable | ( | ) | const |
returns true if this object can be shown.
isShowable() == true means that this object will be shown if its parents can also be shown. Note: this function has the same meaning as isVisible() in Java. : isShown(), UGroup::show()
bool ubit::UControl::isShown | ( | ) | const [virtual] |
returns true if this object is shown.
isShown() returns true if this object is "showable" (see isShowable()) and all its parents are also "showable". Note that "shown" objects are not always visible on the screen as they may be hidden or clipped by other objects such as scroll panes.
Reimplemented in ubit::UWin.
void ubit::UControl::setEnabled | ( | bool | state, | |
bool | call_callbacks = true | |||
) | [virtual] |
enables this object if 'state' is true; disables it if false.
calls the related object's callbacks if second arg is true
void ubit::UControl::setSelected | ( | bool | state, | |
bool | call_callbacks = true | |||
) | [virtual] |
selects this object if 'state' is true; unselects it if false.
calls the related object's callbacks if second arg is true
updates a UView that is managed by this object.
this function is called internally and should not be redefined by clients.