Class YauiDropdown
A selectable that picks one of its options from a list, like uGUI's Dropdown. The list is a copy of Yaui.YauiDropdown.Template (an inactive element, typically a scroll view) shown on top of the panel below the dropdown, with a copy of the template's item (the toggle around Yaui.YauiDropdown.ItemText) for each option. Presses outside the list close it.
Assembly: Yaui.dll
View Source
public class YauiDropdown : YauiSelectable, IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IMoveHandler, IPointerClickHandler, ISubmitHandler, ICancelHandler
Inheritance: System.Object -> Yaui.YauiSelectable
Implements:
Expand
IPointerEnterHandler, IPointerExitHandler, IPointerDownHandler, IPointerUpHandler, ISelectHandler, IDeselectHandler, IMoveHandler, IPointerClickHandler, ISubmitHandler, ICancelHandler
Properties
Template
View Source
public YauiElement Template { get; set; }
CaptionText
View Source
public YauiText CaptionText { get; set; }
CaptionImage
View Source
public YauiImage CaptionImage { get; set; }
ItemText
View Source
public YauiText ItemText { get; set; }
ItemImage
View Source
public YauiImage ItemImage { get; set; }
Options
The options. Call Yaui.YauiDropdown.RefreshShownValue() after changing them in place.
View Source
public List<YauiDropdown.OptionData> Options { get; set; }
Value
The index of the selected option.
View Source
public int Value { get; set; }
OnValueChanged
View Source
public YauiDropdown.DropdownEvent OnValueChanged { get; set; }
IsExpanded
Whether the list is shown.
View Source
public bool IsExpanded { get; }
Methods
SetValueWithoutNotify(int)
View Source
public void SetValueWithoutNotify(int input)
Parameters
| Type | Name |
|---|---|
System.Int32 | input |
AddOptions(IEnumerable<string>)
View Source
public void AddOptions(IEnumerable<string> texts)
Parameters
| Type | Name |
|---|---|
System.Collections.Generic.IEnumerable<System.String> | texts |
AddOptions(IEnumerable<OptionData>)
View Source
public void AddOptions(IEnumerable<YauiDropdown.OptionData> data)
Parameters
| Type | Name |
|---|---|
System.Collections.Generic.IEnumerable<Yaui.YauiDropdown.OptionData> | data |
ClearOptions()
View Source
public void ClearOptions()
OnEnable()
View Source
protected override void OnEnable()
OnDisable()
View Source
protected override void OnDisable()
OnValidate()
View Source
protected override void OnValidate()
RefreshShownValue()
Shows the selected option in the caption.
View Source
public void RefreshShownValue()
OnPointerClick(PointerEventData)
View Source
public virtual void OnPointerClick(PointerEventData eventData)
Parameters
| Type | Name |
|---|---|
PointerEventData | eventData |
OnSubmit(BaseEventData)
View Source
public virtual void OnSubmit(BaseEventData eventData)
Parameters
| Type | Name |
|---|---|
BaseEventData | eventData |
OnCancel(BaseEventData)
View Source
public virtual void OnCancel(BaseEventData eventData)
Parameters
| Type | Name |
|---|---|
BaseEventData | eventData |
Show()
Shows the list below the dropdown (above it if there is no room below).
View Source
public void Show()
Hide()
Hides the list.
View Source
public void Hide()
Implements
IPointerEnterHandlerIPointerExitHandlerIPointerDownHandlerIPointerUpHandlerISelectHandlerIDeselectHandlerIMoveHandlerIPointerClickHandlerISubmitHandlerICancelHandler