This documents an old version of bs::framework. Click here to see the latest release.
GUIFixedSpace Class Reference

Description

GUI element that may be inserted into layouts in order to make a space of a fixed size.

Inherits GUIElementBase.

Methods

 GUIFixedSpace (UINT32 size)
 
UINT32 getSize () const
 Returns the size of the space in pixels. More...
 
void setSize (UINT32 size)
 Changes the size of the space to the specified value, in pixels. More...
 
Internal
Type _getType () const override
 Returns specific sub-type of this object. More...
 
Vector2I _getOptimalSize () const override
 Returns previously calculated optimal size for this element. More...
 
LayoutSizeRange _calculateLayoutSizeRange () const override
 Calculates element size range constrained by its layout options. More...
 
const RectOffset_getPadding () const override
 Returns element padding that determines how far apart to space out this element from other elements in a layout. More...
 
- Methods inherited from GUIElementBase
 GUIElementBase (const GUIDimensions &dimensions)
 
void setPosition (INT32 x, INT32 y)
 Sets element position relative to parent GUI panel. More...
 
void setWidth (UINT32 width)
 Sets element width in pixels. More...
 
void setFlexibleWidth (UINT32 minWidth=0, UINT32 maxWidth=0)
 Sets element width in pixels. More...
 
void setHeight (UINT32 height)
 Sets element height in pixels. More...
 
void setSize (UINT32 width, UINT32 height)
 Sets width and height of a GUI element in pixels. More...
 
void setFlexibleHeight (UINT32 minHeight=0, UINT32 maxHeight=0)
 Sets element height in pixels. More...
 
virtual void resetDimensions ()
 Resets element dimensions to their initial values dictated by the element's style. More...
 
void setVisible (bool visible)
 Hides or shows this element and recursively applies the same state to all the child elements. More...
 
void setActive (bool active)
 Activates or deactives this element and recursively applies the same state to all the child elements. More...
 
void setDisabled (bool disabled)
 Disables or enables the element. More...
 
Rect2I getBounds (GUIPanel *relativeTo=nullptr)
 Returns non-clipped bounds of the GUI element. More...
 
void setBounds (const Rect2I &bounds)
 Sets the bounds of the GUI element. More...
 
Rect2I getGlobalBounds ()
 Returns non-clipped bounds of the GUI element. More...
 
Rect2I getScreenBounds () const
 Returns non-clipped bounds of the GUI element in screenspace. More...
 
virtual Rect2I getVisibleBounds ()
 Returns non-clipped visible bounds of the GUI element (bounds exclude the margins). More...
 
virtual void _updateLayout (const GUILayoutData &data)
 Updates child elements positions, sizes, clip rectangles and depths so they fit into the provided bounds, while respecting their layout options. More...
 
virtual void _updateOptimalLayoutSizes ()
 Calculates optimal sizes of all child elements, as determined by their style and layout options. More...
 
virtual void _updateLayoutInternal (const GUILayoutData &data)
 Updates child elements positions, sizes, clip rectangles and depths so they fit into the provided bounds, while respecting their layout options. More...
 
virtual void _getElementAreas (const Rect2I &layoutArea, Rect2I *elementAreas, UINT32 numElements, const Vector< LayoutSizeRange > &sizeRanges, const LayoutSizeRange &mySizeRange) const
 Calculates positions & sizes of all elements in the layout. More...
 
virtual void _setLayoutData (const GUILayoutData &data)
 Updates layout data that determines GUI elements final position & depth in the GUI widget. More...
 
const GUILayoutData_getLayoutData () const
 Retrieves layout data that determines GUI elements final position & depth in the GUI widget. More...
 
void _setParent (GUIElementBase *parent)
 Sets a new parent for this element. More...
 
UINT32 _getNumChildren () const
 Returns number of child elements. More...
 
GUIElementBase_getChild (UINT32 idx) const
 Return the child element at the specified index. More...
 
const GUIDimensions_getDimensions () const
 Returns layout options that determine how is the element positioned and sized. More...
 
virtual LayoutSizeRange _getLayoutSizeRange () const
 Returns element size range constrained by its layout options. More...
 
GUIElementBase_getParent () const
 Returns parent GUI base element. More...
 
GUIElementBase_getUpdateParent () const
 Returns the parent element whose layout needs to be updated when this elements contents change. More...
 
GUIWidget_getParentWidget () const
 Returns parent GUI widget, can be null. More...
 
bool _isVisible () const
 Checks if element is visible or hidden. More...
 
bool _isActive () const
 Checks if element is active or inactive. More...
 
bool _isDisabled () const
 Checks if element is disabled. More...
 
void _setVisible (bool visible)
 Internal version of setVisible() that doesn't modify local visibility, instead it is only meant to be called on child elements of the element whose visibility was modified.
 
void _setActive (bool active)
 Internal version of setActive() that doesn't modify local state, instead it is only meant to be called on child elements of the element whose state was modified. More...
 
void _setDisabled (bool disabled)
 Internal version of setDisabled() that doesn't modify local state, instead it is only meant to be called on child elements of the element whose state was modified. More...
 
virtual void _changeParentWidget (GUIWidget *widget)
 Changes the active GUI element widget. More...
 
void _registerChildElement (GUIElementBase *element)
 Registers a new child element. More...
 
void _unregisterChildElement (GUIElementBase *element)
 Unregisters an existing child element. More...
 
virtual bool _isDestroyed () const
 Checks if element has been destroyed and is queued for deletion. More...
 
void _markLayoutAsDirty ()
 Marks the element's dimensions as dirty, triggering a layout rebuild. More...
 
void _markContentAsDirty ()
 Marks the element's contents as dirty, which causes the sprite meshes to be recreated from scratch. More...
 
void _markMeshAsDirty ()
 Mark only the elements that operate directly on the sprite mesh without requiring the mesh to be recreated as dirty. More...
 
bool _isDirty () const
 Returns true if elements contents have changed since last update. More...
 
void _markAsClean ()
 Marks the element contents to be up to date (meaning it's processed by the GUI system). More...
 

Static methods

static GUIFixedSpacecreate (UINT32 size)
 Creates a new fixed space GUI element. More...
 
static void destroy (GUIFixedSpace *space)
 Destroys the space and removes it from its parent. More...
 

Additional Inherited Members

- Public Types inherited from GUIElementBase
enum  Type {
  Layout, Element, FixedSpace, FlexibleSpace,
  Panel
}
 Valid types of GUI base elements. More...
 
- Protected Types inherited from GUIElementBase
enum  GUIElementFlags {
  GUIElem_Dirty = 0x01, GUIElem_Hidden = 0x02, GUIElem_Inactive = 0x04, GUIElem_HiddenSelf = 0x08,
  GUIElem_InactiveSelf = 0x10, GUIElem_Disabled = 0x20, GUIElem_DisabledSelf = 0x40
}
 Flags that signal the state of the GUI element. More...
 

Method documentation

◆ _calculateLayoutSizeRange()

LayoutSizeRange _calculateLayoutSizeRange ( ) const
overridevirtual

Calculates element size range constrained by its layout options.

Reimplemented from GUIElementBase.

◆ _getOptimalSize()

Vector2I _getOptimalSize ( ) const
overridevirtual

Returns previously calculated optimal size for this element.

Implements GUIElementBase.

◆ _getPadding()

const RectOffset& _getPadding ( ) const
overridevirtual

Returns element padding that determines how far apart to space out this element from other elements in a layout.

Implements GUIElementBase.

◆ _getType()

Type _getType ( ) const
overridevirtual

Returns specific sub-type of this object.

Implements GUIElementBase.

◆ create()

static GUIFixedSpace* create ( UINT32  size)
static

Creates a new fixed space GUI element.

◆ destroy()

static void destroy ( GUIFixedSpace space)
static

Destroys the space and removes it from its parent.

◆ getSize()

UINT32 getSize ( ) const

Returns the size of the space in pixels.

◆ setSize()

void setSize ( UINT32  size)

Changes the size of the space to the specified value, in pixels.