ubit::UBox Class Reference

Box container. More...

#include <ubox.hpp>

Inheritance diagram for ubit::UBox:

ubit::UGroup ubit::UControl ubit::UBrick ubit::UObject 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 Member Functions

 UBox (const UArgs &a=UArgs::none)
 creates a new UBox; see also the ubox() shortcut.
virtual ~UBox ()
 recursive destructor.
virtual UBoxboxCast ()
 dynamic cast.
virtual UBordergetBorder () const
virtual UBordergetBorder (bool create_if_none)
 gets the border of this box.
virtual UBoxaddlist (const UArgs &a)
 adds a list of arguments to the end the child list.
virtual UBoxgetChildAt (const UPoint &, UView *box_view=null) const
 return the direct child at this location in this box view.
virtual UBoxfindChildAt (const UPoint &, UView *box_view=null) const
 return the deepest indirect child at this location in this box view.
virtual UDimension getViewSize (UView *box_view=null) const
 returns the size of this box view.
virtual UPoint getViewPos (UView *box_view=null) const
 returns the position of the upper left corner of this box view.
virtual UPoint getEventPos (const UMouseEvent &) const
 returns the position of this event in the box view that received it.
virtual int getViewCount () const
 returns the number of views of this box.
virtual int getViews (std::vector< UView * > &) const
 returns the views of this box (see DETAILS).
virtual int getRelatedViews (std::vector< UView * > &v) const
 [impl] returns the views that are related to this object.
virtual UViewgetView (int n=0) const
 returns the Nth view of this box (see DETAILS).
virtual UViewgetViewAt (const UMouseEvent &) const
 returns the box view that contains this event (see also: getEventPos()).
virtual UViewgetViewContaining (const UView *child_view) const
 returns the box view that contains 'child_view'.
virtual UViewgetFirstViewInside (const UView *parent_view) const
 returns the first box view that is contained in 'parent_view'.
void setViewModes (int view_modes, bool)
virtual void repaint ()
 specifies that this object must be repainted.
virtual void update ()
 specifies that the layout and the paint of this object must be updated.
virtual void update (const UUpdate &)
 specifies that the layout and/or the paint of this object must be updated.

Static Public Member Functions

static UStylecreateStyle ()
 < important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!).

Friends

UBoxubox (const UArgs &a=UArgs::none)
 creator shortcut: returns *new UBox().

Detailed Description

Box container.

This class is a lightweight container that controls one or several UViews on the screen. It is the base class for most interactors [e.g. UButton, UTextfield...], containers [UHbox, UVbox, UMenubar...] and windows [UWin UDialog, UMenu...]. Note that most methods are inherited from superclasses.

IMPORTANT NOTE ON RECURSIVE DESTRUCTION AND SMART POINTERS: When a "box" is destroyed, its direct and indirect children are ALSO destroyed EXCEPT if they have other parents OR if they are pointed by a uptr<> (Ubit Smart Pointer). See class UBrick for details.

Multiple parents and multiple views:

Layout:

AutoResize:


Constructor & Destructor Documentation

virtual ubit::UBox::~UBox (  )  [virtual]

recursive destructor.

children are automatically destroyed if not pointed elsewhere (in the instance graph or by a uptr<>). see class UBrick for details.


Member Function Documentation

virtual UBox& ubit::UBox::addlist ( const UArgs a  )  [virtual]

adds a list of arguments to the end the child list.

Exemple:

   UBox* b = new UBox(); 
   b->addlist( UColor::red + UFont::bold + "abcd" );
 

Reimplemented from ubit::UGroup.

Reimplemented in ubit::UWin.

UStyle * ubit::UBox::createStyle (  )  [static]

< important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!).

this macro defines the UClass that corresponds to this class and:

Reimplemented from ubit::UGroup.

Reimplemented in ubit::UVbox, ubit::UHbox, ubit::UFlowbox, ubit::UCardbox, ubit::UAlertbox, ubit::UBar, ubit::UStatusbar, ubit::USepar, ubit::ULabel, ubit::UItem, ubit::UButton, ubit::UTabbutton, ubit::UFlatbutton, ubit::ULinkbutton, ubit::URadiobutton, ubit::UCheckbox, ubit::USpinbox, ubit::UCtlmenu, ubit::UIconbox, ubit::UListbox, ubit::UCombobox, ubit::UMenubar, ubit::UMenu, ubit::UPopmenu, ubit::UPiemenu, ubit::UScrollbar, ubit::UScrollpane, ubit::USlider, ubit::UTable, ubit::UTcell, ubit::UTextbox, ubit::UTextfield, ubit::UTextarea, ubit::UWin, ubit::UDialog, and ubit::UFrame.

UBox * ubit::UBox::findChildAt ( const UPoint &  ,
UView box_view = null 
) const [virtual]

return the deepest indirect child at this location in this box view.

a box can control several views. Returns the child at this position in the first view if 'box_view' = null

UBorder * ubit::UBox::getBorder ( bool  create_if_none  )  [virtual]

gets the border of this box.

creates a border if arg is true and this box has no border.

UBox * ubit::UBox::getChildAt ( const UPoint &  ,
UView box_view = null 
) const [virtual]

return the direct child at this location in this box view.

a box can control several views. Returns the child at this position in the first view if 'box_view' = null

UPoint ubit::UBox::getEventPos ( const UMouseEvent  )  const [virtual]

returns the position of this event in the box view that received it.

getViewAt() returns the box view that received the event.

UView * ubit::UBox::getFirstViewInside ( const UView parent_view  )  const [virtual]

returns the first box view that is contained in 'parent_view'.

'parent_view' must be belong to a (direct or indirect) parent of this box null is returned otherwise.

UView * ubit::UBox::getView ( int  n = 0  )  const [virtual]

returns the Nth view of this box (see DETAILS).

returns the first view if 'n' = 0 and the last view if 'n' = -1. Object views can be retreived as follows:

   for (UView* v = obj->getView(); v!=null; v = v->getNext())
      ....;
 

UView * ubit::UBox::getViewContaining ( const UView child_view  )  const [virtual]

returns the box view that contains 'child_view'.

'child_view' must be belong to a (direct or indirect) child of this box. null is returned otherwise.

UPoint ubit::UBox::getViewPos ( UView box_view = null  )  const [virtual]

returns the position of the upper left corner of this box view.

a box can control several views. Returns the upper left corner of the first view if 'box_view' = null

int ubit::UBox::getViews ( std::vector< UView * > &   )  const [virtual]

returns the views of this box (see DETAILS).

The following example shows a more efficient way to retrieve views:

   for (UView* v = obj->getView(); v!=null; v = v->getNext())
      ....;
 

UDimension ubit::UBox::getViewSize ( UView box_view = null  )  const [virtual]

returns the size of this box view.

a box can control several views. Returns the size of the first view if 'box_view' = null

virtual void ubit::UBox::repaint (  )  [virtual]

specifies that this object must be repainted.

note that actual painting is generally delayed (

See also:
UUpdate). this function is a shortcut for: update(UUpdate::paint)

Reimplemented from ubit::UGroup.

Reimplemented in ubit::UWin.

void ubit::UBox::update ( const UUpdate  )  [virtual]

specifies that the layout and/or the paint of this object must be updated.

the specific actions that will take place depend on the UUpdate argument. Note that these actions are generally delayed:

See also:
UUpdate for details.

Reimplemented from ubit::UGroup.

Reimplemented in ubit::UWin.

virtual void ubit::UBox::update (  )  [virtual]

specifies that the layout and the paint of this object must be updated.

note that these actions are generally delayed (

See also:
UUpdate). this function is a shortcut for: update(UUpdate::layoutAndPaint)

Reimplemented from ubit::UGroup.

Reimplemented in ubit::UWin.


Friends And Related Function Documentation

UBox& ubox ( const UArgs a = UArgs::none  )  [friend]

creator shortcut: returns *new UBox().

Note: watch the case: UBox is a class while ubox() is a function!


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