#include <ubox.hpp>
Inheritance diagram for UBox:
Public Member Functions | |
UBox (const UArgs &a=UArgs::none) | |
constructor; see also class UGroup, destructor UGroup::~UGroup() and the creator shortcut ubox(). | |
virtual | ~UBox () |
see important notes on recursive deletion : see UGroup::~UGroup() | |
virtual const UStyle & | getStyle (UContext *) const |
returns the contextual UStyle of this object. | |
UBox & | addlist (const UArgs &a) |
adds a list of children to the end of the object's child list. | |
virtual void | update () |
virtual void | update (UUpdate upmode) |
updates this object's paint and/or layout. | |
virtual UView * | getView (int no) const |
virtual int | getViewCount () const |
virtual UView ** | getViews () const |
virtual UView ** | getViews (int &view_count) const |
virtual int | getViews (std::vector< UView * > &) const |
get the views managed by this Box. | |
UView * | getViewContaining (UEvent &) const |
returns the Box's View that contains the Event location (null if none). | |
UView * | getViewContaining (UView *child_view) const |
returns the Box's View that contains this (direct or indirect) child view (null if none). | |
UView * | getFirstViewInside (UView *parent_view) const |
returns the first Box's View that is contained in this (direct) parent view. | |
virtual UBox & | onPostChildEvent (const UArgs &) |
detect events that *have already* been received by children. | |
Static Public Member Functions | |
static const UStyle & | makeStyle () |
creates the Style of this object. | |
Static Public Attributes | |
static UStyle * | style = null |
corresponding Ubit UStyle | |
Friends | |
UBox & | ubox (const UArgs &a=UArgs::none) |
creator shortcut that is equivalent to: *new UBox(). |
This class is a lightweight container that is able to control one or several Views (UView class) on the Screen. This class is the base for all interactive "gadgets" (UButton, etc.), visible containers (UHbox, UVbox, UMenubar, etc.) and Windows (UWin, UDialog, UMenu...)
Notes:
See:
Geometry:
Examples:
UBox& r = uhbox( UFont::bold + "String" + ubutton("Button") + etc. );
UBox* p = &uvbox( UColor::red + ubutton(UPix::folder + "Open") + etc. );
uptr<UBox>smp = ubar( ubutton("Btn 1") + ubutton("Btn 2") + etc. );
These 3 examples show how to create objects in the heap (the dynamic memory). uhbox(), uvbox(), etc. are creator shortcuts that create a new object by calling primitive 'new': uhbox(...) equals *new UHbox(...) They can have a list of child objects as an argument (these children being separated by the + operator).
Notes:
UStr& str = ustr("String")
UBox& box = uhbox(uedit() + str); // uedit() makes string editable
....
cout << str + endl; // prints the content of 'str'
str.set("xxxxx"); // changes the content of 'str' and update 'box'
|
adds a list of children to the end of the object's child list. Notes:
Reimplemented from UGroup. |
|
returns the first Box's View that is contained in this (direct) parent view. Notes:
|
|
returns the contextual UStyle of this object. This virtual function calls the makeStyle() static function that was redefined for this specific class
Reimplemented from UGroup. Reimplemented in UVbox, UHbox, UBar, UFlowbox, USepar, ULabel, UItem, UButton, UFlatbutton, ULinkbutton, URadiobutton, UCheckbox, UTextbox, UListbox, USpinbox, UMenubar, UMenu, UPopmenu, UPane, UScrollbar, UTable, UTcell, UWin, UDialog, UFrame, and UIncrust. |
|
get the views managed by this Box. these functions work in the same way as UGroup::getChidren()/getChild() Reimplemented from UGroup. |
|
creates the Style of this object. This static function is redefined by each class that derives from UGroup. It is called by the virtual function UGroup::getStyle()
Reimplemented from UGroup. Reimplemented in UVbox, UHbox, UBar, UFlowbox, ULabel, UItem, UButton, UTextbox, UListbox, USpinbox, UMenubar, UMenu, UPopmenu, UPane, UTable, UTcell, UWin, UDialog, UFrame, and UIncrust. |
|
detect events that *have already* been received by children. intercepts events that have already bee received by the direct or indirect children of this UBox (or subclass):
See also:
Example: box->onPostChildEvents( UOn::mmove :: ucall(arg1, func1) + UOn::mpress:: ucall(arg2, func2)) |
|
updates this object's paint and/or layout. Arguments:
Note:
Reimplemented from UGroup. Reimplemented in UWin. |
|
creator shortcut that is equivalent to: *new UBox(). Note: watch the case: UBox is a class while ubox is a function! |