PropertyInterface
Nectunia.Utility.AdvancedReorderableList Class Reference

Detailed Description

ReaorderableList with advanced options.

Inheritance diagram for Nectunia.Utility.AdvancedReorderableList:

Properties

string ListName [get, set]
 Name of the list. More...
 

Public Member Functions

 AdvancedReorderableList (IList list, Type elementsType, UnityEngine.Object owner, string listName="AdvancedReorderableList")
 Constructor with a list not serialized. More...
 
new void DoLayoutList ()
 Call base DoLayoutList() with new handler. More...
 
new void DoList (Rect rect)
 Call base DoList() with new handler. More...
 
void AddItemWithUndo (ReorderableList list)
 Add a new empty element. More...
 
void RemoveItemWithUndoAndWarning (ReorderableList list)
 Delete the selected element after a warning message. More...
 
void NameNextControl (int index, string fieldName="")
 Set next control name with a formatted name used in OnElementFocusedHandler(). More...
 
void Focus (int index=0)
 Set the focus of the window to the first element's field of the list if one have been Named. More...
 

Protected Attributes

string _listName
 Name of the list. More...
 
UnityEngine.Object _owner
 The Object wich own the list. More...
 
string _baseElementName = ""
 Base name of the element. More...
 
string _baseFirstFieldName = ""
 Base name for the first field of the list. More...
 
string _nextFocusName = ""
 Name of the next element to focus. More...
 
bool _fieldHasBeenNamed = false
 Have the fields been named. More...
 
bool _keyHeld = false
 Say if allowed input are held or not. More...
 

Protected Member Functions

void OnInputHandler ()
 Handler to input.Have to be call in an update function. More...
 
void OnElementFocusedHandler ()
 According list index to the focused element. More...
 
void OnFocusHasToChangedHandler ()
 If a new focus has been defined by the function Focus(), update the Controle Focus in the list. More...
 
string ElementName (int index)
 Return the given index element name formatted to be read by the OnElementFocusedHandler(). More...
 

Property Documentation

◆ ListName

string Nectunia.Utility.AdvancedReorderableList.ListName
getset

Name of the list.

Constructor & Destructor Documentation

◆ AdvancedReorderableList()

Nectunia.Utility.AdvancedReorderableList.AdvancedReorderableList ( IList  list,
Type  elementsType,
UnityEngine.Object  owner,
string  listName = "AdvancedReorderableList" 
)

Constructor with a list not serialized.

Parameters
listThe list to draw.
elementsTypeType of the list elements.
ownerThe Object in wich the list is.
listNameThe name of the list.

"-" is forbiden for this value.

Member Function Documentation

◆ AddItemWithUndo()

void Nectunia.Utility.AdvancedReorderableList.AddItemWithUndo ( ReorderableList  list)

Add a new empty element.

Parameters
listThe list to update.

◆ DoLayoutList()

new void Nectunia.Utility.AdvancedReorderableList.DoLayoutList ( )

Call base DoLayoutList() with new handler.

◆ DoList()

new void Nectunia.Utility.AdvancedReorderableList.DoList ( Rect  rect)

Call base DoList() with new handler.

◆ ElementName()

string Nectunia.Utility.AdvancedReorderableList.ElementName ( int  index)
protected

Return the given index element name formatted to be read by the OnElementFocusedHandler().

Parameters
indexThe element index to return the name.
Returns
The given index element name formatted.

◆ Focus()

void Nectunia.Utility.AdvancedReorderableList.Focus ( int  index = 0)

Set the focus of the window to the first element's field of the list if one have been Named.

Parameters
indexThe element index to focus.

◆ NameNextControl()

void Nectunia.Utility.AdvancedReorderableList.NameNextControl ( int  index,
string  fieldName = "" 
)

Set next control name with a formatted name used in OnElementFocusedHandler().

Parameters
indexThe element index to return the name.
fieldNameCurrent field name for the element.

◆ OnElementFocusedHandler()

void Nectunia.Utility.AdvancedReorderableList.OnElementFocusedHandler ( )
protected

According list index to the focused element.

◆ OnFocusHasToChangedHandler()

void Nectunia.Utility.AdvancedReorderableList.OnFocusHasToChangedHandler ( )
protected

If a new focus has been defined by the function Focus(), update the Controle Focus in the list.

◆ OnInputHandler()

void Nectunia.Utility.AdvancedReorderableList.OnInputHandler ( )
protected

Handler to input.Have to be call in an update function.

Ctrl+ => Add an new item in the list.
Ctrl- => Delete the selected item.

◆ RemoveItemWithUndoAndWarning()

void Nectunia.Utility.AdvancedReorderableList.RemoveItemWithUndoAndWarning ( ReorderableList  list)

Delete the selected element after a warning message.

Parameters
listThe list to update.

Member Data Documentation

◆ _baseElementName

string Nectunia.Utility.AdvancedReorderableList._baseElementName = ""
protected

Base name of the element.

◆ _baseFirstFieldName

string Nectunia.Utility.AdvancedReorderableList._baseFirstFieldName = ""
protected

Base name for the first field of the list.

◆ _fieldHasBeenNamed

bool Nectunia.Utility.AdvancedReorderableList._fieldHasBeenNamed = false
protected

Have the fields been named.

◆ _keyHeld

bool Nectunia.Utility.AdvancedReorderableList._keyHeld = false
protected

Say if allowed input are held or not.

◆ _listName

string Nectunia.Utility.AdvancedReorderableList._listName
protected

Name of the list.

◆ _nextFocusName

string Nectunia.Utility.AdvancedReorderableList._nextFocusName = ""
protected

Name of the next element to focus.

◆ _owner

UnityEngine.Object Nectunia.Utility.AdvancedReorderableList._owner
protected

The Object wich own the list.