Vixen
02b45cc4
csharp
public abstract class SelectBase

What every list of choices has in common: the options, and which of them are chosen.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ The options live in a popover that is a root child, not inside the control. A dropdown inside the field that opens it would be clipped by every scrolling ancestor between the two — which for a field in an inspector in a docked panel is three of them. The list is therefore an Overlay, and the field keeps a reference to it.

Fields and properties (5)

  • public UiElement Field

    The field that opens the list.

  • public Icon Chevron

    The chevron on the right of the field.

  • public Popover List

    The floating list.

  • public IReadOnlyList<Option> Options

    The options, in order.

  • public bool IsOpen

    Whether the list is showing.

Methods (9)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • protected override void OnRemoved()
  • public Option AddOption(string value, string? label = null)

    Adds a choice.

  • public void ClearOptions()

    Removes every choice.

  • public void Open()

    Shows the list.

  • public void CloseList(CloseReason reason = Code)

    Hides it.

  • protected virtual void OnOptionAdded(Option option)

    Called after an option is added, so a subclass can set its initial state.

  • protected abstract void OnOptionChosen(Option option)

    Called when an option in the list is activated.

  • protected void Highlight(int step)

    Moves the highlight through the list, opening it first if it is shut.

Used by (30)

  • ShellHelloUi
  • ControlVisualTestsVixen.Ui.Controls.Tests
  • GradientEditorVixen.Ui.Controls.Advanced
  • MultiSelectVixen.Ui.Controls
  • OverlayLifetimeTestsVixen.Ui.Controls.Tests
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • SelectVixen.Ui.Controls
  • SelectionTestsVixen.Ui.Controls.Tests
  • AnimationClipViewVixen.Editor.AssetEditors
  • AnimationGraphViewVixen.Editor.AssetEditors
  • AudioMixerViewVixen.Editor.AssetEditors
  • AudioMixerViewTestsVixen.Editor.AssetEditors.Tests
  • BuildSettingsTestsVixen.Editor.App.Tests
  • BuildSettingsViewVixen.Editor.App
  • CompositorViewVixen.Editor.AssetEditors
  • ConsoleViewVixen.Editor.Ui
  • ConsoleViewTestsVixen.Editor.Ui.Tests
  • EditorApplicationVixen.Editor.App
  • EnumDrawerVixen.Editor.Inspector
  • FontViewVixen.Editor.AssetEditors
  • InputActionsViewVixen.Editor.AssetEditors
  • KeyBindingsViewVixen.Editor.Ui
  • MaterialViewVixen.Editor.AssetEditors
  • MessageLogViewVixen.Editor.Ui
  • ProfilerViewVixen.Editor.Profiler
  • ProjectBrowserVixen.Editor.App
  • ProxyShapeViewVixen.Editor.AssetEditors
  • ShapeVocabularyViewVixen.Editor.AssetEditors
  • UiClassesVixen.Editor.AssetEditors