Class EnumComboBox
The custom combobox for enum editing. Supports some special cases for flag enums.
Implements
Namespace: FlaxEditor.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
public class EnumComboBox : ComboBox, IComparable, IDrawable
Constructors
EnumComboBox(Type, EnumComboBox.BuildEntriesDelegate, EnumDisplayAttribute.FormatMode)
Initializes a new instance of the EnumElement class.
Declaration
public EnumComboBox(Type type, EnumComboBox.BuildEntriesDelegate customBuildEntriesDelegate = null, EnumDisplayAttribute.FormatMode formatMode)
Parameters
System.Type
type
The enum type. |
EnumComboBox.BuildEntriesDelegate
customBuildEntriesDelegate
The custom entries layout builder. Allows to hide existing or add different enum values to editor. |
EnumDisplayAttribute.FormatMode
formatMode
The formatting mode. |
Fields
_cachedValue
The cached value from the UI.
Declaration
protected long _cachedValue
Field Value
System.Int64
|
_entries
The enum entries. The same order as items in combo box.
Declaration
protected readonly List<EnumComboBox.Entry> _entries
Field Value
System.Collections.Generic.List<EnumComboBox.Entry>
|
_enumType
The enum type.
Declaration
protected readonly Type _enumType
Field Value
System.Type
|
_hasValueCached
True if has value cached, otherwise false.
Declaration
protected bool _hasValueCached
Field Value
System.Boolean
|
Properties
EnumTypeValue
Gets or sets the value of the enum (may not be int).
Declaration
public object EnumTypeValue { get; set; }
Property Value
System.Object
|
IsFlags
Gets a value indicating whether this enum has flags.
Declaration
public bool IsFlags { get; }
Property Value
System.Boolean
|
Value
Gets or sets the value.
Declaration
public long Value { get; set; }
Property Value
System.Int64
|
Methods
BuildEntriesDefault(Type, List<EnumComboBox.Entry>, EnumDisplayAttribute.FormatMode)
Builds the default entries for the given enum type.
Declaration
public static void BuildEntriesDefault(Type type, List<EnumComboBox.Entry> entries, EnumDisplayAttribute.FormatMode formatMode)
Parameters
System.Type
type
The type. |
System.Collections.Generic.List<EnumComboBox.Entry>
entries
The output entries. |
EnumDisplayAttribute.FormatMode
formatMode
The formatting mode. |
CacheValue()
Caches the selected UI enum value.
Declaration
protected void CacheValue()
OnItemClicked(Int32)
Declaration
protected override void OnItemClicked(int index)
Parameters
System.Int32
index
|
Overrides
OnLayoutMenuButton(ContextMenuButton, Int32, Boolean)
Declaration
protected override void OnLayoutMenuButton(ContextMenuButton button, int index, bool construct = false)
Parameters
FlaxEditor.GUI.ContextMenu.ContextMenuButton
button
|
System.Int32
index
|
System.Boolean
construct
|
Overrides
OnValueChanged()
Called when value gets changed.
Declaration
protected virtual void OnValueChanged()
Events
EnumValueChanged
Occurs when value gets changed.
Declaration
public event Action<EnumComboBox> EnumValueChanged
Event Type
System.Action<EnumComboBox>
|
ValueChanged
Occurs when value gets changed.
Declaration
public event Action ValueChanged
Event Type
System.Action
|