class IdCtrls
IdCtrls utility class is useful in situation when there is some relation between widgets and text identifiers. IdCtrls is basically a simple mapping between identifiers and widgets.
void Reset()
Removes all entries from IdCtrls.
void Add(Id id, Ctrl& ctrl)
IdCtrls& operator()(Id id, Ctrl& ctrl)
Adds a new entry of widget reference and identifier.
int GetCount() const
Returns a number of entries.
Ctrl& operator[](int i)
const Ctrl& operator[](int i) const
Returns the widget of entry i. .
Id GetKey(int i) const
Id operator()(int i) const
Returns the identifier of entry i.
bool Accept()
Calls Accept of all widgets. If any widget returns false, returns false. Otherwise returns true.
void ClearModify()
Clear the 'modified' flag of all widgets.
bool IsModified()
Returns true if any widget has 'modified' flag set.
Enables/disable.
void Enable(bool b = true)
Enables/disables all widgets.
void Disable()
Same as Enable(false).
void SetNull()
Sets Null (using SetData) to all widgets.
Event<> operator<<(Event<> action)
Adds action to WhenAction events of all widgets.
Event<> operator^=(Event<> action)
Sets action as WhenAction event of all widgets.
ValueMap Get() const
Creates a map, where keys are identifiers of entries and values are obtained from respective widgets using GetData method.
void Set(const ValueMap& m)
Sets value of widgets using SetData to values in map, using keys of map to identify the target widgets.
ValueMap operator~() const
Same as Get().
const ValueMap& operator<<=(const ValueMap& m)
Same as Set(m).
|