Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBValueGroup Class Reference

TBValueGroup is a collection of widget values (TBWidgetValue) that can be fetched by name (using a TBID). More...

#include <tb_widget_value.h>

Public Member Functions

TBWidgetValueCreateValueIfNeeded (const TBID &name, TBValue::TYPE type=TBValue::TYPE_INT)
 Create a TBWidgetValue with the given name if it does not already exist. More...
 
TBWidgetValueGetValue (const TBID &name) const
 Get the TBWidgetValue with the given name, or nullptr if no match is found. More...
 
void AddListener (TBValueGroupListener *listener)
 Add listener to this group. More...
 
void RemoveListener (TBValueGroupListener *listener)
 Remove listener from this group. More...
 

Friends

class TBWidgetValue
 

Detailed Description

TBValueGroup is a collection of widget values (TBWidgetValue) that can be fetched by name (using a TBID).

It also keeps a list of TBValueGroupListener that listens to changes to any of the values.

Member Function Documentation

void tb::TBValueGroup::AddListener ( TBValueGroupListener listener)
inline

Add listener to this group.

It will be removed automatically when deleted, but can also be removed by RemoveListener.

TBWidgetValue * tb::TBValueGroup::CreateValueIfNeeded ( const TBID name,
TBValue::TYPE  type = TBValue::TYPE_INT 
)

Create a TBWidgetValue with the given name if it does not already exist.

Returns nullptr if out of memory.

TBWidgetValue* tb::TBValueGroup::GetValue ( const TBID name) const
inline

Get the TBWidgetValue with the given name, or nullptr if no match is found.

void tb::TBValueGroup::RemoveListener ( TBValueGroupListener listener)
inline

Remove listener from this group.


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