18 #define uboxgeom_hpp 1 19 #include <ubit/uattr.hpp> 20 #include <ubit/ulength.hpp> 21 #include <ubit/ugeom.hpp> 41 operator float()
const {
return value;}
44 UScale& operator=(
float v) {
set(v);
return *
this;}
45 UScale& operator=(
const UFloat& v) {
set(v);
return *
this;}
46 UScale& operator=(
const UScale& v) {
set(v.value);
return *
this;}
48 bool operator==(
float v)
const {
return v == value;}
49 bool operator==(
const UFloat& v)
const {
return v == value;}
50 bool operator==(
const UScale& v)
const {
return value == v.value;}
52 virtual void set(float);
53 virtual void mult(
float);
54 virtual void div(
float);
62 inline UScale& uscale(
float v = 1.) {
return *
new UScale(v);}
114 const ULength& getX()
const {
return x;}
115 const ULength& getY()
const {
return y;}
121 UPos& operator=(
const UPos& p) {
return set(p.x, p.y);}
122 UPos& operator=(
const UPoint& p) {
return set(p.x, p.y);}
125 bool operator==(
const UPos& p)
const {
return equals(p.x, p.y);}
126 bool operator==(
const UPoint& p)
const {
return equals(p.x, p.y);}
128 bool isFloating()
const;
177 static const int MARGIN = 5;
178 UPoint box_pos0, pt_in_pane0;
179 bool change_cursor, freeze_x, freeze_y;
250 const ULength& getWidth()
const {
return width;}
251 const ULength& getHeight()
const {
return height;}
253 USize& setWidth(
const ULength& _w) {
return set(_w, height);}
254 USize& setHeight(
const ULength& _h) {
return set(width, _h);}
257 USize& operator=(
const USize& s) {
return set(s.width, s.height);}
261 bool operator==(
const USize& s)
const {
return equals(s.width, s.height);}
262 bool operator==(
const UDimension& d)
const {
return equals(d.width, d.height);}
307 bool freeze_w, freeze_h;
325 UPadding() : val(UIGNORE,UIGNORE) {}
341 ULength getTop()
const {
return val.top;}
342 ULength getRight()
const {
return val.right;}
343 ULength getBottom()
const {
return val.bottom;}
344 ULength getLeft()
const {
return val.left;}
369 static UOrient horizontal, vertical;
378 bool operator==(
const UOrient& v)
const {
return value == v.value;}
385 enum {HORIZONTAL=0, VERTICAL=1, INHERIT=2};
416 static UHalign left, right, flex, center;
425 bool operator==(
const UHalign& v)
const {
return value == v.value;}
431 enum {INHERIT, LEFT, RIGHT, FLEX, CENTER};
441 inline UHalign& uleft() {
return UHalign::left;}
448 inline UHalign& uright() {
return UHalign::right;}
455 inline UHalign& uhcenter() {
return UHalign::center;}
462 inline UHalign& uhflex() {
return UHalign::flex;}
484 static UValign top, bottom, flex, center;
493 bool operator==(
const UValign& v)
const {
return value == v.value;}
499 enum {INHERIT, TOP, BOTTOM, FLEX, CENTER};
508 inline UValign& utop() {
return UValign::top;}
515 inline UValign& ubottom() {
return UValign::bottom;}
522 inline UValign& uvcenter() {
return UValign::center;}
529 inline UValign& uvflex() {
return UValign::flex;}
549 operator float()
const {
return value;}
555 bool operator==(
float v)
const {
return value == v;}
556 bool operator==(
const UVspacing& v)
const {
return value == v.value;}
581 operator float()
const {
return value;}
587 bool operator==(
float v)
const {
return value == v;}
588 bool operator==(
const UHspacing& v)
const {
return value == v.value;}
Base class for attributes.
Definition: uattr.hpp:97
2D Dimension.
Definition: ugeom.hpp:55
Widget position.
Definition: uboxgeom.hpp:91
Makes it possible to change the UPos of a Magic Lens interactively.
Definition: uboxgeom.hpp:199
virtual void removingFrom(UChild &, UElem &parent)
called when this object is removed from a parent (SEE DETAILS IF YOU REDEFINE THIS METHOD)...
Definition: unode.hpp:222
Definition: uobject.hpp:282
Box container.
Definition: ubox.hpp:64
2D Point.
Definition: ugeom.hpp:25
Size Control: interactive control of the size of a widget.
Definition: uboxgeom.hpp:287
Box vertical layout.
Definition: uboxgeom.hpp:480
USize()
creates a new size attribute with width=UAUTO and height=UAUTO.
Definition: uboxgeom.hpp:235
Length of positions (UPos), sizes (USize) and padding (UPadding)
Definition: ulength.hpp:59
virtual bool is3Dpos() const
returns true if this is a U3Dpos.
Definition: uboxgeom.hpp:134
USize(ULength width, ULength height=UIGNORE)
creates a new size attribute,
Definition: uboxgeom.hpp:238
Definition: ulength.hpp:135
virtual void update()
updates parents graphics.
Definition: uboxgeom.cpp:62
virtual void putProp(UUpdateContext *, UElem &)
[impl] changes corresponding value in the UUpdateContext
Definition: uboxgeom.hpp:184
UScale(float value=1.)
creates a new scale attribute; see also shortcut uscale().
Box horizontal spacing.
Definition: uboxgeom.hpp:573
virtual void addingTo(UChild &, UElem &parent)
called when this object is added to a parent.
Definition: unode.hpp:219
lightweight general purpose container.
Definition: uelem.hpp:44
USize(const USize &s)
creates a new size attribute.
Definition: uboxgeom.hpp:244
Smart Pointer for UObject instances (.
Definition: uobject.hpp:365
Box vertical spacing.
Definition: uboxgeom.hpp:541
Box padding.
Definition: ulength.hpp:150
UPos()
creates a new position attribute with x=0 and y=0.
Definition: uboxgeom.hpp:97
Widget Orientation.
Definition: uboxgeom.hpp:365
Position Control: interactive control of the position of a widget.
Definition: uboxgeom.hpp:162
virtual void destructs()
unlinks the object from its parents and destroys its children.
Definition: unode.cpp:56
Box horizontal layout.
Definition: uboxgeom.hpp:412
Box View.
Definition: uview.hpp:65
Definition: uupdatecontext.hpp:32
Definition: uhardfont.hpp:31
USize(const UDimension &d)
creates a new size attribute.
Definition: uboxgeom.hpp:241
Widget scale.
Definition: uboxgeom.hpp:31
Active Float.
Definition: unumber.hpp:140
Definition: ulength.hpp:142
Widget padding.
Definition: uboxgeom.hpp:321
Base class for windows and menus.
Definition: uwin.hpp:47
Definition: ulength.hpp:61
Definition: uviewImpl.hpp:123
virtual void putProp(UUpdateContext *, UElem &)
[impl] changes corresponding value in the UUpdateContext
Definition: uboxgeom.hpp:300
UPos(const UPos &p)
creates a new position attribute.
Definition: uboxgeom.hpp:106
Widget Size.
Definition: uboxgeom.hpp:228
UPos(const UPoint &p)
creates a new position attribute; see also shortcut upos().
Definition: uboxgeom.hpp:103
mouse events
Definition: uevent.hpp:172
[impl] Internal implementation of a child node.
Definition: uchild.hpp:23
UPos(ULength x, ULength y)
creates a new position attribute; see also shortcut upos(ULength x, ULength y).
Definition: uboxgeom.hpp:100