UIStateGroupControl

CJFinc.UItools.UIStateGroupControl

UIStateGroupControl extends UIStateGroup into the group of items with only one item selected.

UIStateGroupControl works with active and inactive states of UIStateItem.  It reacts to any UIStateItem state change and controls that only one item should be selected at the same time.

There are two modes available

  • one active
  • one inactive

In “one active” UIStateGroupControl controls that only one item is active.

And “one inactive” has an inverse behavior when only one item could be inactive.

Summary
UIStateGroupControlUIStateGroupControl extends UIStateGroup into the group of items with only one item selected.
Enumerations
STATE_GROUP_CONTROL_MODEEnumeration of possible group modes
Properties
ModeCurrent group mode STATE_GROUP_CONTROL_MODE
SelectedItemCurrently selected UIStateItem item
SelectedItemNameCurrently selected UIStateItem item name
Functions
SetMode (newMode)Change group mode and set items to initial states
ItemStateChanged (itemName)Internal function.
SetItemActive(itemName)Change item with given name to state UIStateItem.STATE_ACTIVE
SetItemInactive(itemName)Change item with given name to state UIStateItem.STATE_INACTIVE
Flush()Flush all items for default state according to current Mode

Enumerations

STATE_GROUP_CONTROL_MODE

public enum STATE_GROUP_CONTROL_MODE

Enumeration of possible group modes

  • OneActive
  • OneInActive

Properties

Mode

public STATE_GROUP_CONTROL_MODE Mode { get }

Current group mode STATE_GROUP_CONTROL_MODE

SelectedItem

public UIStateItem SelectedItem { get }

Currently selected UIStateItem item

SelectedItemName

public string SelectedItemName { get }

Currently selected UIStateItem item name

Functions

SetMode (newMode)

public void SetMode(STATE_GROUP_CONTROL_MODE newMode)

Change group mode and set items to initial states

GetComponent<UIStateGroupControl>().SetMode(STATE_GROUP_CONTROL_MODE.OneInActive);

Parameters

newModeSTATE_GROUP_CONTROL_MODE new group mode

ItemStateChanged (itemName)

public override void ItemStateChanged(string itemName)

Internal function.  Called automatically from UIStateItem for each state change

See UIStateGroup.ItemStateChanged (itemName) for details.

Parameters

itemNameitem name

SetItemActive(itemName)

public void SetItemActive(string itemName)

Change item with given name to state UIStateItem.STATE_ACTIVE

GetComponent<UIStateGroupControl>().SetItemActive("item (2)");

Parameters

itemNameUIStateItem item name

SetItemInactive(itemName)

public void SetItemInactive(string itemName)

Change item with given name to state UIStateItem.STATE_INACTIVE

GetComponent<UIStateGroupControl>().SetItemInactive("item (2)");

Parameters

itemNameUIStateItem item name

Flush()

public void Flush()

Flush all items for default state according to current Mode

GetComponent<UIStateGroupControl>().Flush();
UIStateGroup allows to manage group of UIStateItem items and perform bulk state change
UIStateGroupControl extends UIStateGroup into the group of items with only one item selected.
public enum STATE_GROUP_CONTROL_MODE
Enumeration of possible group modes
public STATE_GROUP_CONTROL_MODE Mode { get }
Current group mode STATE_GROUP_CONTROL_MODE
public UIStateItem SelectedItem { get }
Currently selected UIStateItem item
UIStateItem implements different UI item states and provides API to switch between them.
public string SelectedItemName { get }
Currently selected UIStateItem item name
public void SetMode(STATE_GROUP_CONTROL_MODE newMode)
Change group mode and set items to initial states
public override void ItemStateChanged(string itemName)
Internal function.
public void SetItemActive(string itemName)
Change item with given name to state UIStateItem.STATE_ACTIVE
public void SetItemInactive(string itemName)
Change item with given name to state UIStateItem.STATE_INACTIVE
public void Flush()
Flush all items for default state according to current Mode
public virtual void ItemStateChanged(string itemName)
Internal function.
Close