guit  0.1
 All Classes Functions Variables Typedefs Enumerations Friends
Public Types | Public Member Functions | List of all members
guit::GStatusBar Class Reference

Status bar. More...

Inheritance diagram for guit::GStatusBar:
guit::GBox guit::Gadget guit::GObject

Public Types

enum  Update
 Layout update modes (see updateLayout()).
 
enum  Place : int8_t
 Placement of the gadget in a GBox parent. More...
 

Public Member Functions

GBoxclone (GClone const &) override
 Clones the gadget according to GClone argument.
 
virtual int nearestChildIndex (GPoint const &wpoint, bool localpos)
 Searches the closest child from this location (in window coordinates). More...
 
int childCount () const
 Returns the number of children.
 
virtual void perform (std::function< void(Gadget &child)> fun)
 Calls a function on all box children. More...
 
virtual void perform (std::function< void(Gadget &child, int index)> fun)
 Calls a function on all box children. More...
 
virtual bool removeAt (int pos)
 Removes a child at a given position or a given place. More...
 
virtual void removeChildren (Remove mode=Remove::InContent)
 Removes all children. More...
 
void cleanup () override
 Removes all Props and children. More...
 
ChoiceBehavior choiceBehavior () const
 Returns the GChoiceBehavior of the box.
 
void setValue (GString const &) override
 Changes the gadget's value. More...
 
void clearValues () override
 Clears the values of the gadget and its descendants. More...
 
void doPaint (GRenderGraphics &, GRender *parent_render) override
 Paints the gadget. More...
 
GadgetdoPick (GPoint const &, class GPickMode &) override
 Returns the gadget the gadget that contains this point. More...
 
void blink (GString const &message="", GTime duration=350)
 Blinks the gadget, optionally showing a message. More...
 
GPropList const & props () const
 Returns all props. More...
 
void cssProps (class GPropMap &)
 Returns the props relative to this gadget in CSSs. More...
 
virtual GString text () const
 Returns the text of the gadget (if any). More...
 
virtual void removeProps ()
 Removes all props (including conditional props and callbacks). More...
 
bool isMultiLine () const
 Returns true if gadget displays multiline text.
 
virtual void update ()
 Notifies the toolkit that this gadget needs to be repainted. More...
 
virtual void updateLayout (Update=Update::IfNeeded)
 Notifies the toolkit that the layout needs to be updated. More...
 
virtual GWindowgetWindow () const
 Returns the GWindow that contains the gadget (if any, null otherwise).
 
virtual bool isTopLevel () const
 Returns true if the gadget is a Window or a Menu.
 
virtual bool hasValue () const
 Returns true if the gadget has a value. More...
 
virtual GString stringValue () const
 Returns the gadget's value as a string. More...
 
int zlayer () const
 Returns the z-layer of the gadget. More...
 
GRect const & wframe ()
 Returns the frame (position and size) of the gadget in window coordinates.
 
virtual void keepInside (GBox &box, GPoint &point)
 Changes point to keep the gadget inside an ancestor when moving or resizing it.
 
virtual GHandle findHandle (GPoint const &wpos)
 Returns the handle that contains this position in window corrdinates.
 
bool isActive () const
 Returns true if the gadget is currently active (eg pressed).
 
GadgetModes const & modes () const
 Returns all gadget modes.
 
GEventType const & eventMask () const
 Returns the events (ORed mask) that the gadget takes into account.
 
virtual void doFire (GEvent &)
 Fires callbacks and conditional props (see GCond) that match this event.
 
virtual void onAdd (GBox *parent)
 Called when the gadget is added to a parent.
 
virtual void onRemove (GBox *parent)
 Called when the gadget is removed from a parent.
 
void removeNotifiers (void *) override
 [Implementation] Notifies this object that it must no longer refer obj.
 
virtual void error (GString const &funname, GString const &message) const
 Prints an error message. More...
 
void operator delete (void *)
 delete does nothing, see GObject class.
 
void forgetSmartPointers ()
 Forgets all smart pointers pointing this object. More...
 
unsigned int useCount () const
 Returns the numbers of smart pointers referencing the object.
 
virtual GChoicechoiceProp ()
 Returns the prop that controls the exclusive selection of children, if any. More...
 
virtual GPropvalueProp () override
 Returns the prop that stores the gadget's value. More...
 
virtual GadgetfindChild (GadgetType &type, bool in_border=false) const
 Searches if the gadget contains a child gadget of (exactly) this class. More...
 
virtual GadgetchildAt (int pos) const
 Returns the child at this position or at this place. More...
 
virtual int childPos (Gadget *child) const
 Returns the position or the place of this child. More...
 
virtual GadgetchildAtPoint (GPoint const &point, bool indirect=false, GPredicate const &={})
 Returns the direct (or indirect) child containing this point. More...
 
GadgetList & children ()
 Returns the content aread child list. More...
 
virtual bool contain (Gadget *child, bool indirect=false) const
 Returns true if the first argument is a direct (or indirect) child of the box. More...
 
virtual bool contain (GProp *prop) const
 Returns true if the gadget contains this prop.
 
virtual void add (Gadget *child, int index=-1)
 Adds a Gadget child. More...
 
void add (GString const &item) override
 Adds a Gadget child that is auto-created. More...
 
void add (class GStateTransition &)
 Adds a callback function or a state transitions. More...
 
virtual void add (GMenu *child)
 Adds a menu, a window, a dialog box to the gadget. More...
 
virtual bool remove (Gadget *child)
 Removes a child. More...
 
bool remove (GProp *prop)
 Removes a prop (including conditional props and callbacks). More...
 
GString typeName () const override
 Returns the name and ID of the gadget's type.
 
GadgettoGadget () override
 Class conversions.
 
virtual GPropfindProp (GPropType &) const
 Searches if the gadget contains a prop of this class or a derived class. More...
 
virtual GPropprop (GPropType &, bool in_css=false)
 Searches a prop of this class in the gadget and the CSS, and creates it if needed. More...
 
bool isRichText () const
 Checks/changes whether HTML-like tags are interpreted when displaying text. More...
 
GadgetcatchEvents (bool=true)
 Checks/changes whether the gadget catches events. More...
 
GadgetignoreEvents (bool=true)
 Checks/changes whether the gadget ignores events. More...
 
virtual Gadgetcheck (bool=true)
 Checks/changes whether the gadget is checked (ie selected). More...
 
GadgetsetCheckable (bool=true)
 Checks/changes whether the gadget is checkable (ie can be selected). More...
 
virtual Gadgetenable (bool=true)
 Checks/change whether the gadget is enabled. More...
 
virtual Gadgetshow (bool=true)
 Checks or change whether the gadget is shown. More...
 
GBoxgetParent () const
 Returns the parent gadget. More...
 
bool read (GString const &filename, GIOMode=GIOMode::Auto)
 Reads the values or the children of this gadget recursively.
 
bool write (GString const &filename, GIOMode) const
 Writes the values or the children of this gadget recursively.
 
bool isColumn () const
 Returns the direction of the gadget. More...
 
virtual void move (GPoint const &)
 Changes the position (in pixels) of the gadget. More...
 
virtual void resize (float w, float h)
 Changes the preferred size (in pixels) of the gadget. More...
 
virtual void reshapeInteractively ()
 Allows reshaping a gadget interactivelly. More...
 
virtual GPoint pos () const
 Returns the position of the gadget in its parent. More...
 
GPoint wpos () const
 Returns the position of the gadget in its containing window. More...
 
GPoint screenPos () const
 Returns the position of the gadget on the screen.
 
float w () const
 Returns the dimension (size) of the gadget.
 
float angleStart () const
 Returns/changes the starting angle and the extent when painting gadgets as pie slices. More...
 
bool isActivable () const
 Ckecks/changes whether the gadget can be active.
 
bool isDownActivable () const
 Ckecks/changes whether the gadget is active on mouse down rather than mouse up.
 
bool isFocus () const
 Returns true if the gadget has/can have the focus.
 
bool isInternal () const
 Ckecks/changes whether the gadget is an internal (implementation-specific) object. More...
 
template<class Subclass >
Subclass * to ()
 Class conversions.
 
void ignoreSmartPointers ()
 Checks/sets whether this object can be auto-deleted by smart pointers. More...
 

Detailed Description

Status bar.

When added to a Box a StatusBar is placed in the bottom part of the Box' border. Strings added to this gadget are converted into StatusBar items.

auto& status = Text();
auto& sbar = StatusBar << (Label << status);
status << "My Message"; // changes the status
See Also
GBox and Gadget.

Member Enumeration Documentation

enum guit::Gadget::Place : int8_t
stronginherited

Placement of the gadget in a GBox parent.

When adedd to a GBox, the placement of the gadget depends on its place() method:

  • Place::Content means it is added to the content area of the box
  • other values means it is added to the border of the box (e.g. Place::Top for a title or a menubar)

Member Function Documentation

GChoice * guit::GBox::choiceProp ( )
virtualinherited

Returns the prop that controls the exclusive selection of children, if any.

returns null if this box does not enforce exclusive selection.

Reimplemented in guit::GChoiceBox.

GProp * guit::GBox::valueProp ( )
overridevirtualinherited

Returns the prop that stores the gadget's value.

If the gadget has a value (see hasValue()) this method returns the prop storing the value. Otherwise it returns null.

Reimplemented from guit::Gadget.

Reimplemented in guit::GChoiceBox.

Gadget * guit::GBox::findChild ( GadgetType type,
bool  in_border = false 
) const
virtualinherited

Searches if the gadget contains a child gadget of (exactly) this class.

The first version returns the gadget as a Gadget* if it is found, and null otherwise. In addition, the second version casts the returned gadget to the desired type.

Note
This method does not take into account derived types.
Gadget * guit::GBox::childAt ( int  pos) const
virtualinherited

Returns the child at this position or at this place.

  • if pos is one of Gadget::Place, returns the child at this place in the border
  • otherwise, returns the child at this position in in content area (0 is first child, -1 last child).
    Returns
    childAt() returns the corresponding child, or null
    operator[] returns the corresponding child, or throws a GFatalError exception, which resets the event loop.

Reimplemented in guit::GTable.

int guit::GBox::childPos ( Gadget child) const
virtualinherited

Returns the position or the place of this child.

Returns -1 if child does not belong to the child list.

Gadget * guit::GBox::childAtPoint ( GPoint const &  point,
bool  indirect = false,
GPredicate const &  = {} 
)
virtualinherited

Returns the direct (or indirect) child containing this point.

  • returns the direct child containing this point if indirect is false (the default) and the direct or indirect child containing this point otherwise.
  • If pred is not null, only children verifying this predicate are considered
  • with childAtPoint() : point is relative to the box
  • with childAtWPoint() : wpoint is relative to the window containing the box
int guit::GBox::nearestChildIndex ( GPoint const &  wpoint,
bool  localpos 
)
virtualinherited

Searches the closest child from this location (in window coordinates).

Returns the index of the closest direct childt, and -1 if none found.

GadgetList& guit::GBox::children ( )
inlineinherited

Returns the content aread child list.

Note
Gadgets loacted in the borders (e.g. menubars, scrollbars) are stored in the border list.
Windows and Menus are stored in the prop list
bool guit::GBox::contain ( Gadget child,
bool  indirect = false 
) const
virtualinherited

Returns true if the first argument is a direct (or indirect) child of the box.

If indirect is false (the default) searches only for direct children, otherwise searches for direct and indirect children.

virtual void guit::GBox::perform ( std::function< void(Gadget &child)>  fun)
virtualinherited

Calls a function on all box children.

fun(child) is called on each element in the childlist. The operation is not performed on border children (see addToBorder()).

virtual void guit::GBox::perform ( std::function< void(Gadget &child, int index)>  fun)
virtualinherited

Calls a function on all box children.

fun(child, index) is called on each element in the childlist. index is the cofresponding position in the list. The operation is not performed on border children (see addToBorder()).

void guit::GBox::add ( Gadget child,
int  index = -1 
)
virtualinherited

Adds a Gadget child.

Adding operations are explained in the documentation of the Gadget class.

  • index is the position where child is inserted in the childlist, a negative value means that the child is added to the end of the childlist.
  • << operators (see operator<<()) call add() with an index of -1, thus they provide a simple means for adding children to the end of the childlist
  • If child is a non-window non-menu gadget that belongs to another box, it is removed from this box (as such gadgets cannot have multiple parents); if it already belongs to this box it is moved to the new specified index
  • Window and menu gadgets (i.e. deriving from GWindow or GMenu) have a specific behavior:

    1) they can be added to any gadget, including non-box gadgets

2) they can be added to multiple gadgets

3) they are not added to the childlist but to the proplist

Reimplemented in guit::GWindow, guit::GTabBox, guit::GChartBox, and guit::GOptionBox.

void guit::GBox::add ( GString const &  item)
overridevirtualinherited

Adds a Gadget child that is auto-created.

The string is converted into a gadget that is added to the childlist (see add(Gadget*, int index)). The type of the created gadget depend on the type of the box, for instance:

Ordinary boxes (GHBox, GHPane, etc.) and tables (GTable, GTRow, GTHead) create GLabel gadgets.

GChoiceBox boxes and their subclasses create GItem gadgets

GChart boxes create GChartItem gadgets

Reimplemented from guit::Gadget.

void guit::Gadget::add ( class GStateTransition trans)
inherited

Adds a callback function or a state transitions.

operator<<() provides a more convenient API: a << b << c adds b and c to a. The appropriate adding function is automatically called.

Note
The default on::action triggers of the gadget is used. For instance, the callback will be called if a GButton is clicked, if a GCheckItem is checked or unchecked, if a GRadioItem belonging to a box that performs exclusive selection is checked.
void guit::Gadget::add ( GMenu child)
virtualinherited

Adds a menu, a window, a dialog box to the gadget.

operator<<() provides a more convenient API: a << b << c adds b and c to a. The appropriate adding function is automatically called.

If the gadget is a GItem or GButton, the GMenu, GWindow, GDialog given as an argument will be automatically opened when pressing the mouse on the item (GMenu) or clicking it (GWindow, GDialog).

Note
Only one GMenu can be added to a gadget. If another menu is added, it will replace the previous one.

Reimplemented in guit::GItem, and guit::GMenuBar.

bool guit::GBox::remove ( Gadget child)
virtualinherited

Removes a child.

Returns true if the child was actually removed (i.e. if it was in the child list), and false otherwise.

Note
Removed children are deleted if they are not gptr-pointed elsewhere (see gptr<> smart pointers)

Reimplemented in guit::GOptionBox.

bool guit::Gadget::remove ( GProp prop)
inherited

Removes a prop (including conditional props and callbacks).

Returns true if the prop was actually removed (i.e. if it was belonging to the gadget).

Note
Removing a prop will delete it if it does not belong to another gadget and is not gptr-pointed elsewhere (see gptr<> smart pointer)
See Also
Gadget, GProp, GCond (conditional props).
bool guit::GBox::removeAt ( int  pos)
virtualinherited

Removes a child at a given position or a given place.

  • if pos is one of Gadget::Place, removes the child at this place in the border
  • otherwise, removes the child at this position in in content area (0 is first child, -1 last child).

Reimplemented in guit::GOptionBox.

void guit::GBox::removeChildren ( Remove  mode = Remove::InContent)
virtualinherited

Removes all children.

Remove all children iin the content area and/or in the border depending on argument.

Reimplemented in guit::GOptionBox.

void guit::GBox::cleanup ( )
overridevirtualinherited

Removes all Props and children.

Calls removeProps() then removeChidren()

Reimplemented from guit::Gadget.

void guit::GBox::setValue ( GString const &  value)
overridevirtualinherited

Changes the gadget's value.

If the gadget has a value (see hasValue()) this method changes the gadget value after converting value to the appropriate type. Otherwise it has no effect.

Reimplemented from guit::Gadget.

Reimplemented in guit::GChoiceBox.

void guit::GBox::clearValues ( )
overridevirtualinherited

Clears the values of the gadget and its descendants.

Clearing means setting to the default value (0 for numbers, the empty string for strings, etc.)

Reimplemented from guit::Gadget.

void guit::GBox::doPaint ( GRenderGraphics &  gr,
GRender *  parent_render 
)
overridevirtualinherited

Paints the gadget.

Repaints the gadget then fires on::paint callbacks. For instance, mycallback can be called to draw on the gadget as follows;

mygadget << on::paint / [this](GEvent& e){mycallback(e);};
See Also
Graphics.

Reimplemented from guit::Gadget.

Gadget * guit::GBox::doPick ( GPoint const &  wpos,
class GPickMode &  pm 
)
overridevirtualinherited

Returns the gadget the gadget that contains this point.

The point is in window coordinates.

See Also
GBox::childAtPos() and GBox::childAtWPos()

Reimplemented from guit::Gadget.

void guit::Gadget::blink ( GString const &  message = "",
GTime  duration = 350 
)
inherited

Blinks the gadget, optionally showing a message.

Shows a message if message is not empty. The duration is in ms.

GProp * guit::Gadget::findProp ( GPropType t) const
virtualinherited

Searches if the gadget contains a prop of this class or a derived class.

The first version returns the prop as a GProp* if it is found, and null otherwise. In addition, the second version casts the returned prop to the desired type.

Note
The returned prop may be immutable (ie if GVarProp::isMutable() return false). For instance, predefined variables such as GColor::red or GFont::bold are immutable.
Props in inline styles (e.g. Button( "{color:red; font:bold} DoIt" ) belong to the gadget, they are added to it in the same way as if using operator<<().
GProp & guit::Gadget::prop ( GPropType t,
bool  in_css = false 
)
virtualinherited

Searches a prop of this class in the gadget and the CSS, and creates it if needed.

This method always returns a mutable prop of the desired type:

  • first it searches if the gadget contains this prop by calling find()
  • then, if 'in_css' is true, it also searches in CSSs (not the default because somewhat CPU intensive)
  • finally, if no corresponding prop is found, it created it and adds it to the gadget
Note
If the found prop is immutable (see find()), it is duplicated and the copy is added to the gadget then returned
See Also
findProp() and cssProps()
GPropList const& guit::Gadget::props ( ) const
inlineinherited

Returns all props.

Note
Does not return the props relative to the gadget that are defined in CSS styles (see cssProps() for this purpose), except those that are defined in inline styles, eg in: Button( "{color:red; font:bold} DoIt" )
void guit::Gadget::cssProps ( class GPropMap &  props)
inherited

Returns the props relative to this gadget in CSSs.

Note
Does not return the props that belong to the gadget (see props() for this purpose), except those that are defined in inline styles, eg in: Button( "{color:red; font:bold} DoIt" )
GString guit::Gadget::text ( ) const
virtualinherited

Returns the text of the gadget (if any).

Returns the text of gadgets that display text, e.g. Item, Label, Button, TextField, etc., and an empty string otherwise.

Reimplemented in guit::GItem, and guit::GTextItem.

void guit::Gadget::removeProps ( )
virtualinherited

Removes all props (including conditional props and callbacks).

Note
Beware that the removed props will be auto-deleted if not gptr-referenced elsewhere (see Gadget).
bool guit::Gadget::isRichText ( ) const
inlineinherited

Checks/changes whether HTML-like tags are interpreted when displaying text.

HTML-like tags such as <b>, <i>, etc. will be interpreted when rendering text. This option is true by default, except for gadgets that edit text (e.g. TextField and TextArea).

Gadget & guit::Gadget::catchEvents ( bool  val = true)
inherited

Checks/changes whether the gadget catches events.

The gadget will receive events that should have been received by its descendants. The received GEvent will be set so that:

  • GEvent::gadget() will return the gadget
  • GEvent::item() will return the descendant that should have received the event.
Gadget & guit::Gadget::ignoreEvents ( bool  val = true)
inherited

Checks/changes whether the gadget ignores events.

The gadget and its descendants will then ignore all events.

Gadget & guit::Gadget::check ( bool  state = true)
virtualinherited

Checks/changes whether the gadget is checked (ie selected).

check() has not effect if isCheckable() is false; see setCheckable().

Gadget & guit::Gadget::setCheckable ( bool  s = true)
inherited

Checks/changes whether the gadget is checkable (ie can be selected).

setCheckable(true) makes any gadget checkable. Some gadgets (e.g. GCheckItem, GRadioItem) are checkable by default, but most others are not.

Gadget & guit::Gadget::enable ( bool  state = true)
virtualinherited

Checks/change whether the gadget is enabled.

  • enable() sets isSelfEnabled() to true or false
  • isTrulyEnabled() is true if the gadget and all its ancestors ar isSelfEnabled().
Gadget & guit::Gadget::show ( bool  state = true)
virtualinherited

Checks or change whether the gadget is shown.

isShown() does mean that the gadget is shown, but that it will be shown if all its ancesters are shown

Reimplemented in guit::GInfoDialog, guit::GWindow, guit::GDialog, guit::GFileDialog, guit::GInspector, and guit::GMenu.

void guit::Gadget::update ( )
virtualinherited

Notifies the toolkit that this gadget needs to be repainted.

The gadget is not repainted immediately, but after executing callback functions. The doPaint() method is then called.

Reimplemented in guit::GWindow.

void guit::Gadget::updateLayout ( Update  mode = Update::IfNeeded)
virtualinherited

Notifies the toolkit that the layout needs to be updated.

By default (UpdateIfNeeded mode) the layout is not updated immediately, but after executing callback functions, and before repainting the gadget by calling doPaint().

Possible arguments are:

  • IfNeeded (default): the layout is updated if the toolkit thinks this is needed
  • Needed: the layout is always updated
  • Now: the layout is updated immediately. Sometimes needed but CPU inefficient

Reimplemented in guit::GWindow.

GBox* guit::Gadget::getParent ( ) const
inlineinherited

Returns the parent gadget.

  • getParent() returns the gadget's parent if it derives from GBox, and null if no parent or not a box.
  • getPseudoParent() returns the gadget's parent whatever its type. Displayed gadgets have a non-null parent that derives from GBox, except toplevel gadgets (GMenu, GWindow, GDialog, etc.) which parent can be null or can be any gadget.
virtual bool guit::Gadget::hasValue ( ) const
inlinevirtualinherited

Returns true if the gadget has a value.

Gadgets such as TextField, Slider, ChartItem, ChoiceBox, OptionBox, ComboBox have a value. This methods then returns true, and false otherwise.

See Also
stringValue() and setValue().

Reimplemented in guit::GTextItem, guit::GChoiceBox, guit::GItem, and guit::GValueItem.

virtual GString guit::Gadget::stringValue ( ) const
inlinevirtualinherited

Returns the gadget's value as a string.

If the gadget has a value (see hasValue()) this method returns the gadget value converted to a string. Otherwise it returns the empty string.

Reimplemented in guit::GChoiceBox, guit::GItem, guit::GTextItem, guit::GValueItem, and guit::GFileDialog.

bool guit::Gadget::isColumn ( ) const
inlineinherited

Returns the direction of the gadget.

The direction can be changed by adding a GFlow prop to the gadget.

void guit::Gadget::move ( GPoint const &  p)
virtualinherited

Changes the position (in pixels) of the gadget.

This function is a shortcut that changes the value of the gadget's GPos prop (and adds a GPos to the gadget if it doesn't already have one). Importantly, the gadget won't be auto laid-out any longer if this function is called (or a GPos is directly added to the gadget).

Gadgets that are automatically laid out don't need a GPos. Gadgets that are positioned manually need a GPos that specifies their position and (optionally) their zlayer().

The position is relative to the parent gadget, or to the screen if the gadget is a GWindow. The zlayer() of auto-laid out gadgets is 0, the zlayer() of other gadgets is > 0 (see GPos).

A GPos prop can be directly added to a gadget as follows:

auto& pos = Pos();
auto& win = Window("My Window") << pos;
pos.set(100,100);
...
pos.set(200,200);

Adding a GPos rather than calling move() allows:

  • controlling the zlayer of the gadget
  • better performance if the gadget is frequently moved
  • sharing the GPos with other gadgets (which are then synced)

Reimplemented in guit::GLineShape.

void guit::Gadget::resize ( float  w,
float  h 
)
virtualinherited

Changes the preferred size (in pixels) of the gadget.

This function is a shortcut that changes the value of the gadgte's GSIze prop (and adds a GSize to the gadget if it doesn't already have one). The actual size of the gadget also depends on its GFlex prop and the GAlign prop of its parent.

The GSize prop can also be added directly by using the << operator (see move() for an example). Adding a GSize rather than calling resize() allows:

  • specifying the unit of w and h, or if they are computed automatically
  • better performance if the gadget is frequently resized
  • sharing the GSize with other gadgets (which are then synced)
void guit::Gadget::reshapeInteractively ( )
virtualinherited

Allows reshaping a gadget interactivelly.

Adds the appropriate GPos and GSize props to the gadget so that it will display handles allowing to reshape it when it is checked. "Reshaping" both means changing the position and the size (e.g. when dragging left-side handles). The second version of this function allows reshaping a gadget just after instantiating it. The GMouseEvent argument typically corresponds to a mouse down event in a gadget that serves as a canvas for drawing other gadgets (or geometrical shapes, see GShape).

Reimplemented in guit::GLineShape.

GPoint guit::Gadget::pos ( ) const
virtualinherited

Returns the position of the gadget in its parent.

Return the position on the screen if the gadget is a GWindow,

Reimplemented in guit::GWindow, and guit::GMenu.

int guit::Gadget::zlayer ( ) const
inlineinherited

Returns the z-layer of the gadget.

The z-layer is 0 if the gadget is auto laid-out and > 0 otherwise (see GPos prop).

GPoint guit::Gadget::wpos ( ) const
inlineinherited

Returns the position of the gadget in its containing window.

Return 0 if the gadget is a GWindow.

float guit::Gadget::angleStart ( ) const
inherited

Returns/changes the starting angle and the extent when painting gadgets as pie slices.

GItem gadgets are drawn as pie slices when contained in a box with a GFlow::pie prop. This is typically used in pie charts (see GChart) and pie menus (see GPieMenu).

bool guit::Gadget::isInternal ( ) const
inlineinherited

Ckecks/changes whether the gadget is an internal (implementation-specific) object.

internal objects are ignored when inspecting, reading or writting gadgets.

void guit::GObject::error ( GString const &  funname,
GString const &  message 
) const
virtualinherited

Prints an error message.

See Also
GApp::onError() to change error management.
void guit::GObject::ignoreSmartPointers ( )
inlineinherited

Checks/sets whether this object can be auto-deleted by smart pointers.

ignoreSmartPointers() has a permanent effect, contrary to forgetSmartPointers(). Objects not created by calling new are never auto-deleted by smart pointers.

void guit::GObject::forgetSmartPointers ( )
inlineinherited

Forgets all smart pointers pointing this object.

The smart pointers that are currently pointing to the object won't auto-delete it. forgetSmartPointers() has a temporary effect, contrary to ignoreSmartPointers().


The documentation for this class was generated from the following files: