Class PopupField<T>
Generic popup selection field.
Inherited Members
Namespace: UnityEditor.UIElements
Syntax
public class PopupField<T> : BasePopupField<T, T>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable, INotifyValueChanged<T>, IMixedValueSupport
Type Parameters
Name | Description |
---|---|
T |
Constructors
PopupField()
Construct a PopupField.
Declaration
public PopupField()
PopupField(List<T>, T, Func<T, String>, Func<T, String>)
Construct a PopupField.
Declaration
public PopupField(List<T> choices, T defaultValue, Func<T, string> formatSelectedValueCallback = null, Func<T, string> formatListItemCallback = null)
Parameters
Type | Name | Description |
---|---|---|
List<T> | choices | |
T | defaultValue | |
Func<T, String> | formatSelectedValueCallback | |
Func<T, String> | formatListItemCallback |
PopupField(List<T>, Int32, Func<T, String>, Func<T, String>)
Construct a PopupField.
Declaration
public PopupField(List<T> choices, int defaultIndex, Func<T, string> formatSelectedValueCallback = null, Func<T, string> formatListItemCallback = null)
Parameters
Type | Name | Description |
---|---|---|
List<T> | choices | |
Int32 | defaultIndex | |
Func<T, String> | formatSelectedValueCallback | |
Func<T, String> | formatListItemCallback |
PopupField(String)
Construct a PopupField.
Declaration
public PopupField(string label = null)
Parameters
Type | Name | Description |
---|---|---|
String | label |
PopupField(String, List<T>, T, Func<T, String>, Func<T, String>)
Construct a PopupField.
Declaration
public PopupField(string label, List<T> choices, T defaultValue, Func<T, string> formatSelectedValueCallback = null, Func<T, string> formatListItemCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | label | |
List<T> | choices | |
T | defaultValue | |
Func<T, String> | formatSelectedValueCallback | |
Func<T, String> | formatListItemCallback |
PopupField(String, List<T>, Int32, Func<T, String>, Func<T, String>)
Construct a PopupField.
Declaration
public PopupField(string label, List<T> choices, int defaultIndex, Func<T, string> formatSelectedValueCallback = null, Func<T, string> formatListItemCallback = null)
Parameters
Type | Name | Description |
---|---|---|
String | label | |
List<T> | choices | |
Int32 | defaultIndex | |
Func<T, String> | formatSelectedValueCallback | |
Func<T, String> | formatListItemCallback |
Fields
inputUssClassName
USS class name of input elements in elements of this type.
Declaration
public static readonly string inputUssClassName
Field Value
Type | Description |
---|---|
String |
labelUssClassName
USS class name of labels in elements of this type.
Declaration
public static readonly string labelUssClassName
Field Value
Type | Description |
---|---|
String |
ussClassName
USS class name of elements of this type.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Properties
formatListItemCallback
Callback that provides a string representation used to populate the popup menu.
Declaration
public virtual Func<T, string> formatListItemCallback { get; set; }
Property Value
Type | Description |
---|---|
Func<T, String> |
formatSelectedValueCallback
Callback that provides a string representation used to display the selected value.
Declaration
public virtual Func<T, string> formatSelectedValueCallback { get; set; }
Property Value
Type | Description |
---|---|
Func<T, String> |
index
The currently selected index in the popup menu.
Declaration
public int index { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
value
The currently selected value in the popup menu.
Declaration
public override T value { get; set; }
Property Value
Type | Description |
---|---|
T |
Overrides
UnityEngine.UIElements.BaseField<T>.value
Methods
SetValueWithoutNotify(T)
Declaration
public override void SetValueWithoutNotify(T newValue)
Parameters
Type | Name | Description |
---|---|---|
T | newValue |
Overrides
UnityEditor.UIElements.BasePopupField<T, T>.SetValueWithoutNotify(T)