Hasty Badger
Small UI library (a branch of Turbo Badger)
|
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 | |
TBWidgetValue * | CreateValueIfNeeded (const TBID &name, TBValue::TYPE type=TBValue::TYPE_INT) |
Create a TBWidgetValue with the given name if it does not already exist. More... | |
TBWidgetValue * | GetValue (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 |
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.
|
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.
|
inline |
Get the TBWidgetValue with the given name, or nullptr if no match is found.
|
inline |
Remove listener from this group.