Drag[en]gine Script Module DragonScript
1.23
|
ToggleModel synchronized against a ListModel containing an object. More...
Public Member Functions | |
void | contentChanged (ListModel listModel, int fromIndex, int toIndex) |
Content of the model changed. More... | |
void | elementsAdded (ListModel listModel, int fromIndex, int toIndex) |
Elements have been added. More... | |
void | elementsRemoved (ListModel listModel, int fromIndex, int toIndex) |
Elements have been removed. More... | |
TogglePresentModel | new (ListModel listModel, Object trackPresence) |
Create toggle model synchronized against presence of object in list model. More... | |
void | selectionChanged (ListModel listModel) |
Selection in the model changed. More... | |
Public Member Functions inherited from Dragengine.Gui.DefaultToggleModel | |
void | addListener (ToggleModelListener listener) |
Add listener. More... | |
bool | getToggled () |
Get toggled state. More... | |
DefaultToggleModel | new () |
Create toggle model with false toggled state. More... | |
DefaultToggleModel | new (bool toggled) |
Create toggle model. More... | |
void | removeListener (ToggleModelListener listener) |
Remove listener. More... | |
void | setToggled (bool toggled) |
Set toggled state. More... | |
Protected Member Functions | |
void | updateToggleModel (ListModel listModel) |
Update toggle model. More... | |
ToggleModel synchronized against a ListModel containing an object.
Synchronizes toggle state of a ToggleModel with the presence of an object in a ListModel. Typically the object to check presence for is an Enumeration. This allows to use a ListModel to store boolean game states that can be activated or deactivated. Each game state is represented by a constant from an enumeration list. Changeing game states modifies the enumerations present in the list. This class tracks a specific enumeration constants and uses it to toggle a ToggleModel. This way ToggleModel supporting widgets can easily track a ListModel to build UIs in a simple and understandable way.
An example use looks like this:
void Dragengine.Gui.TogglePresentModel.contentChanged | ( | ListModel | listModel, |
int | fromIndex, | ||
int | toIndex | ||
) |
Content of the model changed.
Implements Dragengine.Gui.ListModelListener.
void Dragengine.Gui.TogglePresentModel.elementsAdded | ( | ListModel | listModel, |
int | fromIndex, | ||
int | toIndex | ||
) |
Elements have been added.
Implements Dragengine.Gui.ListModelListener.
void Dragengine.Gui.TogglePresentModel.elementsRemoved | ( | ListModel | listModel, |
int | fromIndex, | ||
int | toIndex | ||
) |
Elements have been removed.
Implements Dragengine.Gui.ListModelListener.
TogglePresentModel Dragengine.Gui.TogglePresentModel.new | ( | ListModel | listModel, |
Object | trackPresence | ||
) |
Create toggle model synchronized against presence of object in list model.
void Dragengine.Gui.TogglePresentModel.selectionChanged | ( | ListModel | listModel | ) |
Selection in the model changed.
Implements Dragengine.Gui.ListModelListener.
|
protected |
Update toggle model.