6 #ifndef TB_WIDGET_VALUE_H
7 #define TB_WIDGET_VALUE_H
10 #include "tb_linklist.h"
11 #include "tb_hashtable.h"
87 long GetInt()
const {
return m_value.GetInt(); }
90 bool GetText(
TBStr &text)
const { text = m_value.GetString();
return true; }
96 double GetDouble()
const {
return m_value.GetFloat(); }
111 bool SyncToWidget(
TBWidget *dst_widget);
112 bool SyncToWidgets(
TBWidget *exclude_widget);
159 #endif // TB_WIDGET_VALUE_H
TBWidgetValue * CreateValueIfNeeded(const TBID &name, TBValue::TYPE type=TBValue::TYPE_INT)
Create a TBWidgetValue with the given name if it does not already exist.
Definition: tb_widget_value.cpp:170
TBLinkListOf is a double linked linklist.
Definition: tb_linklist.h:122
TYPE
The current type of the value.
Definition: tb_value.h:64
TBHashTableOf is a TBHashTable with the given class type as content.
Definition: tb_hashtable.h:112
void RemoveListener(TBValueGroupListener *listener)
Remove listener from this group.
Definition: tb_widget_value.h:145
TBWidgetValue * GetValue(const TBID &name) const
Get the TBWidgetValue with the given name, or nullptr if no match is found.
Definition: tb_widget_value.h:138
TBID is a wrapper for a uint32_t to be used as ID.
Definition: tb_id.h:18
TBStr is a simple string class.
Definition: tb_str.h:62
TBValue holds value of a specific type.
Definition: tb_value.h:59
TBValueGroup is a collection of widget values (TBWidgetValue) that can be fetched by name (using a TB...
Definition: tb_widget_value.h:130
Definition: tb_linklist.h:83
virtual void OnValueChanged(const TBValueGroup *group, const TBWidgetValue *value)=0
Called when a value has changed and all widgets connected to it has been updated. ...
Listener that will be notified when any of the values in a TBValueGroup is changed.
Definition: tb_widget_value.h:117
TBValueGroup g_value_group
The global value group.
Definition: tb_widget_value.cpp:168
void AddListener(TBValueGroupListener *listener)
Add listener to this group.
Definition: tb_widget_value.h:142