|
ubit
|
Box View. More...
#include <uview.hpp>
Public Types | |
| enum | FindMode { FIND_CLIP, FIND_VIEW_CONTEXT, FIND_PARENT_CONTEXT } |
| enum | VMODES { INITIALIZING = 1<<0, INITIALIZED = 1<<1, DAMAGED = 1<<2, DESTRUCTED = 1<<3, FIXED_WIDTH = 1<<4, FIXED_HEIGHT = 1<<5, REALIZED_CHILDREN = 1<<6, POS_HAS_CHANGED = 1<<9, SIZE_HAS_CHANGED = 1<<10, NO_DOUBLE_BUFFER = 1<< 11 } |
| typedef std::list< UViewProp * > | UViewProps |
Public Types inherited from ubit::URect | |
| enum | { OUT_LEFT = 1, OUT_TOP = 2, OUT_RIGHT = 4, OUT_BOTTOM = 8 } |
Public Types inherited from ubit::UShape | |
| enum | ShapeType { LINE = 1, RECT = 2, ELLIPSE = 3, ARC = 4, POLYGON = 5 } |
Public Types inherited from ubit::UObject | |
| typedef unsigned char | State |
| typedef short | PtrCount |
Public Member Functions | |
| UView (UBox *, UView *parview, UHardwinImpl *) | |
| virtual UFlowView * | toFlowView () |
| virtual UTableView * | toTableView () |
| virtual UPaneView * | toPaneView () |
| bool | isShown () const |
| returns true if this view is currently shown. | |
| bool | isRealized () const |
| returns true if system resources have been allocated. | |
| float | getWidth () const |
| returns the width of the view. | |
| float | getHeight () const |
| returns the height of the view. | |
| UDimension | getSize () const |
| returns the size of the view. | |
| void | setSize (const UDimension &) |
| changes the size of the view (see details). More... | |
| float | getX () const |
| returns the x position of the view relatively to its parent origin. | |
| float | getY () const |
| returns the y position of the view relatively to its parent origin. | |
| UPoint | getPos () const |
| returns the position of the view relatively to its parent origin. | |
| UPoint | getPosIn (UView &ref_view) const |
| returns the position of the view relatively to the view given as an argument. | |
| UPoint | getScreenPos () const |
| returns the position of the view relatively to the screen origin. | |
| UPoint | getGLPos () const |
| returns the position of the view relatively to its hard window in GL coordinates. More... | |
| UPoint | getHardwinPos () const |
| returns the position of the view relatively to its hard window. More... | |
| float | getScale () const |
| returns the scaling factor applied to this view. | |
| virtual bool | caretPosToXY (long caret_pos, int &xcol, int &yline) const |
| convert a caret position to XY coordinates. More... | |
| virtual bool | xyToCaretPos (int line, int col, long &caret_pos) const |
| convert XY coordinates to a caret position. More... | |
| UBox * | getBox () const |
| returns the widget that controls this view. | |
| UBox * | getBoxParent () const |
| returns the closest UBox parent of getBox() (which is not necessarily a direct parent). | |
| UView * | getParentView () const |
| returns the parent view (if any, null for window views). | |
| UDisp * | getDisp () const |
| returns the Display where this view is displayed. | |
| UWin * | getWin () const |
| returns the Window where this view is displayed. | |
| UView * | getWinView () const |
| returns the view of the Window where this view is displayed. | |
| UHardwinImpl * | getHardwin () const |
| returns the hard window that contains this view. | |
| bool | isChildOf (const std::vector< UView *> &parent_views) |
| virtual bool | containsWC (const UPoint &pos_in_win) |
| returns true if this point (in window coordinates) in contained in this view. | |
| virtual void | updateLayout (const UDimension *force_size, bool upd_paint_data=true) |
| [Impl] updates layout coordinates. | |
| virtual void | updatePaintData (const URect *region=null) |
| [Impl] updates paint data (but does not paint). More... | |
| virtual void | updatePaint (const URect *region=null) |
| [Impl] paints this view or a part of this view. More... | |
| virtual UView * | findSource (UViewFind &, UPoint &pos_in_src) |
| [Impl]. | |
| virtual UView * | findSourceNext (UViewFind &, UPoint &pos_in_src) |
| [Impl]. | |
| virtual bool | findContext (UViewContext &, FindMode) |
| [Impl]. | |
| virtual UData * | findData (UDataContext &, const UPoint &pos, const UData *searched_data, int strpos1, int strpos2) |
| [Impl]. | |
| void | operator delete (void *) |
| int | getVModes () const |
| bool | hasVMode (int modes) const |
| void | addVModes (long modes) |
| void | removeVModes (long modes) |
| virtual UViewStyle * | getViewStyle () |
| UView * | getNext () |
| template<typename T > | |
| T * | getProp (T *&p) |
| template<typename T > | |
| T & | obtainProp (T *&p) |
| void | incrHFlexCount () |
| void | incrVFlexCount () |
| void | setScale (float s) |
| virtual bool | doLayout (UUpdateContext &, UViewLayout &) |
| virtual void | doUpdate (UUpdateContext &, URect r, URect clip, UViewUpdate &) |
Public Member Functions inherited from ubit::URect | |
| int | getShapeType () const |
| URect (float _x, float _y, float _w, float _h) | |
| URect (const UPoint &p1, const UPoint &p2) | |
| URect | getBounds () const |
| returns the bounding box of this shape. | |
| bool | isEmpty () const |
| void | setRect (const URect &r) |
| void | setRect (float x, float y, float width, float height) |
| void | setRect (const UPoint &p1, const UPoint &p2) |
| void | setFrame (const URect &r) |
| bool | contains (const UPoint &) const |
| tests if a given point is inside the boundary of this Shape. | |
| bool | contains (const URect &) const |
| tests if the interior of this Shape entirely contains the specified Rectangle | |
| bool | intersects (const URect &) const |
| tests if this Rectangle intersects the interior of a specified Rectangle. | |
| bool | intersectsLine (const ULine &) const |
| tests if the specified line segment intersects the interior of this Rectangle. | |
| bool | doIntersection (const URect &) |
| performs the intersection with the rectangle that is given as an argument. More... | |
| void | doUnion (const URect &) |
| performs the union with the rectangle that is given as an argument. More... | |
| int | outcode (const UPoint &p) const |
| determines where the specified coordinates lie with respect to this Rectangle. | |
| virtual void | draw (const UGraph &) const |
| virtual void | fill (const UGraph &) const |
Public Member Functions inherited from ubit::UObject | |
| UObject (const UObject &) | |
| UObject & | operator= (const UObject &) |
| virtual const UClass & | getClass () const |
| instance method that returns the metaclass of this object. More... | |
| const UStr & | getClassName () const |
| returns getClass().getName(). | |
| virtual void | error (const char *function_name, const char *format,...) const |
| prints out an error message. More... | |
| virtual void | warning (const char *function_name, const char *format,...) const |
| prints out a warning message: More... | |
| bool | isDeletable () const |
| checks if this object can be destroyed by 'delete'. More... | |
| bool | isConst () const |
| checks whether the content of this object can be modified ( More... | |
| UObject & | setConst () |
| specifies that the content of this object cannot be modified. More... | |
| bool | isAutoUpdate () const |
| return current update policy: More... | |
| UObject & | setAutoUpdate (bool state=true) |
| changes the update policy of this object when its is modified. More... | |
| bool | isIgnoringChangeCallbacks () const |
| return true if change callbacks are fired. | |
| UObject & | ignoreChangeCallbacks (bool state) |
| change callbacks are not fired if argument is true. | |
| virtual UNode * | toNode () |
| dynamic cast: returns this object if it derives from UNode and null otherwise. | |
| virtual const UNode * | toNode () const |
| dynamic cast: returns this object if it derives from UNode and null otherwise. | |
| virtual UAttr * | toAttr () |
| dynamic cast: returns this object if it derives from UAttr and null otherwise. | |
| virtual const UAttr * | toAttr () const |
| dynamic cast: returns this object if it derives from UAttr and null otherwise. | |
| virtual UElem * | toElem () |
| dynamic cast: returns this object if it derives from UElem and null otherwise. | |
| virtual const UElem * | toElem () const |
| dynamic cast: returns this object if it derives from UElem and null otherwise. | |
| virtual UData * | toData () |
| dynamic cast: returns this object if it derives from UData and null otherwise. | |
| virtual const UData * | toData () const |
| dynamic cast: returns this object if it derives from UData and null otherwise. | |
| virtual UStr * | toStr () |
| dynamic cast: returns this object if it derives from UStr and null otherwise. | |
| virtual const UStr * | toStr () const |
| dynamic cast: returns this object if it derives from UStr and null otherwise. | |
| virtual UCall * | toCall () |
| dynamic cast: returns this object if it derives from UCall and null otherwise. | |
| virtual const UCall * | toCall () const |
| dynamic cast: returns this object if it derives from UCall and null otherwise. | |
| virtual UBox * | toBox () |
| dynamic cast: returns this object if it derives from UBox and null otherwise. | |
| virtual const UBox * | toBox () const |
| dynamic cast: returns this object if it derives from UBox and null otherwise. | |
| virtual UWin * | toWin () |
| dynamic cast: returns this object if it derives from UWin and null otherwise. | |
| virtual const UWin * | toWin () const |
| dynamic cast: returns this object if it derives from UWin and null otherwise. | |
| virtual UMenu * | toMenu () |
| dynamic cast: returns this object if it derives from UMenu and null otherwise. | |
| virtual const UMenu * | toMenu () const |
| dynamic cast: returns this object if it derives from UMenu and null otherwise. | |
| State | getState () const |
| returns the current object state. | |
| void | setState (State s) |
| changes the object state. | |
| PtrCount | getPtrCount () const |
| [impl] returns the number of uptr<> smart pointers that are pointing to this object. | |
| bool | checkConst () const |
| [impl] produces an error if this object is logically constant ( More... | |
| bool | isDestructed () const |
| [impl] this object has been destructed (but memory has not been freed yet). | |
| bool | isDestructing () const |
| [impl] this object is being destructed (one of its destructors has been called). | |
| virtual bool | hasSceneGraphParent () const |
| void * | operator new (size_t) |
| < [impl] returns true if there is at least one scene graph parent (redefined by UNode). More... | |
| void | operator delete (void *) |
| delete operator is forbidden on instances that derive from UObject. | |
| void | addPtr () const |
| [Impl] a uptr is added to this object. | |
| void | removePtr () const |
| [Impl] a uptr is removed from this object. | |
Static Public Member Functions | |
| static UPoint | convertPosTo (const UView &to, const UView &from, const UPoint &pos_in_from) |
| converts position in 'from' view to position in 'to' view. More... | |
| static UView * | createView (UBox *, UView *parview, UHardwinImpl *) |
Static Public Member Functions inherited from ubit::UObject | |
| static const char * | getVersion () |
| returns the version of the Ubit package. | |
| static const UClass & | Class () |
| class method that returns the metaclass of this class. More... | |
| static UStyle * | createStyle () |
Static Public Attributes | |
| static UViewStyle | style |
Static Public Attributes inherited from ubit::UObject | |
| static UConst | UCONST |
| UCONST can be given as an argument to some constructors to make the object constant. More... | |
Protected Member Functions | |
| void | setParentView (UView *parent_view) |
| void | setNext (UView *v) |
| virtual void | doLayout2 (UViewLayoutImpl &, UElem &, UUpdateContext &, UViewLayout &) |
| virtual void | doUpdate2 (UViewUpdateImpl &, UElem &, UUpdateContext &, URect &r, URect &clip, UViewUpdate &) |
| virtual bool | updatePos (UViewUpdateImpl &, UElem &, UUpdateContext &curctx, URect &r, URect &clip, UViewUpdate &) |
| virtual void | beginUpdate3d (UViewUpdateImpl &, UElem &, UUpdateContext &curctx) |
| virtual void | endUpdate3d (UViewUpdateImpl &, UElem &, UUpdateContext &curctx) |
| virtual UView * | findInBox (UBox *, const UPoint &winpos, const UUpdateContext &, UViewFind &) |
| virtual UView * | findInGroup (UElem *, const UPoint &winpos, const UUpdateContext &, UViewFind &) |
| virtual UView * | findInChildren (UElem *, const UPoint &winpos, const UUpdateContext &, UViewFind &) |
| virtual bool | findDataV (UUpdateContext &, UChildIter data_iter, UChildIter end_iter, const URect &, UViewUpdate &) |
| virtual bool | findDataH (UUpdateContext &, UChildIter data_iter, UChildIter end_iter, const URect &, UViewUpdate &) |
| virtual bool | findDataPtr (UUpdateContext &, UChildIter data_iter, UChildIter end_iter, const URect &, UViewUpdate &) |
Static Protected Member Functions | |
| static void | initLayoutH (UViewUpdateImpl &vd, const UUpdateContext &curp, const URect &r) |
| static void | initLayoutV (UViewUpdateImpl &vd, const UUpdateContext &curp, const URect &r) |
| static void | initLayoutViewport (UViewUpdateImpl &vd, const UUpdateContext &curp, const URect &r) |
| static void | layoutH (UViewUpdateImpl &vd, const UUpdateContext &curp, UChildIter link, const UDimension &dim, UElem *chgrp, UView *chview) |
| static void | layoutV (UViewUpdateImpl &vd, const UUpdateContext &curp, UChildIter link, const UDimension &dim, UElem *chgrp, UView *chview) |
| static void | layoutViewport (UViewUpdateImpl &vd, const UUpdateContext &curp, UChildIter link, const UDimension &dim, UView *chview) |
Protected Attributes | |
| int | vmodes |
| float | scale |
| float | chwidth |
| float | chheight |
| float | edit_shift |
| unsigned short | hflex_count |
| unsigned short | vflex_count |
| UView * | parview |
| UBox * | box |
| UHardwinImpl * | hardwin |
| UView * | next |
| UViewProps | props |
Protected Attributes inherited from ubit::UObject | |
| PtrCount | ptr_count |
| Modes | omodes |
| State | ostate |
Friends | |
| class | UBox |
| class | UWin |
| class | UHardwinImpl |
| class | USubwin |
| class | UChild |
| class | UViewLayoutImpl |
| class | UViewUpdateImpl |
| class | UAppliImpl |
| class | UInputEvent |
| class | UEventFlow |
| class | U3DcanvasView |
Additional Inherited Members | |
Public Attributes inherited from ubit::URect | |
| float | x |
| float | y |
| float | width |
| float | height |
Box View.
UBox objects (and subclasses except UWin) can have several views. these views can be retrieved by methods UBox::getView(), UBox::getViews(), etc.
Note: UWin objects (and subclasses) have only onse (shared) view that is called the "window view".
|
virtual |
convert a caret position to XY coordinates.
returns false if the conversion did not succeeded.
Reimplemented in ubit::UFlowView.
|
static |
converts position in 'from' view to position in 'to' view.
both views must be on the same UDisp. returns false if the conversion failed.
| UPoint UView::getGLPos | ( | ) | const |
returns the position of the view relatively to its hard window in GL coordinates.
y is relative to the BOTTOM left corner.
| UPoint UView::getHardwinPos | ( | ) | const |
returns the position of the view relatively to its hard window.
y is relative to the TOP left corner
| void UView::setSize | ( | const UDimension & | s | ) |
|
virtual |
[Impl] paints this view or a part of this view.
note that 'region', must be in window coordinates if provided.
|
virtual |
[Impl] updates paint data (but does not paint).
certain coordinates (related to scrolling etc.) are updated while painting. this function updates them without acutally painting
|
virtual |
convert XY coordinates to a caret position.
returns false if the conversion did not succeeded.
Reimplemented in ubit::UFlowView.
1.8.12