ubit::UControl Class Reference

generic interaction controller. More...

#include <ucontrol.hpp>

Inheritance diagram for ubit::UControl:

ubit::UBrick ubit::UObject ubit::UGroup ubit::UBox ubit::UMessagePort ubit::UTrow ubit::UAlertbox ubit::UBar ubit::UButton ubit::UCardbox ubit::UFinder ubit::UFlowbox ubit::UHbox ubit::UItem ubit::ULabel ubit::UListbox ubit::UScrollbar ubit::UScrollpane ubit::USepar ubit::USlider ubit::USpinbox ubit::UStatusbar ubit::UTable ubit::UTextbox ubit::UVbox ubit::UWin List of all members.

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

Detailed Description

generic interaction controller.

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.


Member Function Documentation

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

See also:
class UOn.

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.

See also:
: isArmed()

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.

See also:
: setEnabled()

bool ubit::UControl::isSelected (  )  const

returns true if this object is currently selected.

an object can be selected if isSelectable() returns true.

See also:
: setSelected()

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.

See also:
: isShowable(), UGroup::show()

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

See also:
: isEnabled()

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

See also:
: isSelected()

virtual void ubit::UControl::updateView ( UEvent ,
UView ,
const UUpdate  
) [pure virtual]

updates a UView that is managed by this object.

this function is called internally and should not be redefined by clients.


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