AdvancedDropdownWidgetclass

A generic sliding hierarchical selector widget. Build a tree of `Editor.AdvancedDropdownItem` and hand it to this widget.

objectWidgetAdvancedDropdownWidget
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public class Editor.AdvancedDropdownWidget : Editor.Widget

Constructors1

Showing 1 constructors

Methods7

Showing 7 methods

protected virtual void OnBuildSearchResults(Editor.AdvancedDropdownWidget.AdvancedDropdownPanel panel, string searchText)PROTECTEDVIRTUAL

Called after search results are populated. Override to add extra entries (e.g. "New Component" button).

ParameterTypeDescription
panelAdvancedDropdownPanel
searchTextstring
Returns:void

protected virtual void OnKeyRelease(Editor.KeyEvent e)PROTECTEDVIRTUAL

ParameterTypeDescription
eKeyEvent
Returns:void

protected virtual void OnPaint()PROTECTEDVIRTUAL

Returns:void

public void PopPanel()PUBLIC

Pop the current panel (navigate back).

Returns:void

public void Rebuild()PUBLIC

Rebuild the item tree and reset to the root panel.

Returns:void

Properties13

Showing 13 properties

public Editor.Widget Editor.AdvancedDropdownWidget.FilterWidget { get; set; }PUBLICGETSET

Optional filter widget placed next to the search bar (e.g. a settings button).

Returns:Widget

protected bool Editor.AdvancedDropdownWidget.IsSearching { get; set; }PROTECTEDGETSET

Whether the user is currently searching.

Returns:bool

protected bool Editor.AdvancedDropdownWidget.IsTextInputActive { get; set; }PROTECTEDGETSETINGEST

For subclasses that have a text input inside the panel (e.g. a name field) - set to true to prevent Left arrow key from popping the panel.

Returns:bool

public System.Action Editor.AdvancedDropdownWidget.OnFinished { get; set; }PUBLICGETSET

Called after selection to allow the host to close/cleanup.

Returns:Action

public System.Action`1<object> Editor.AdvancedDropdownWidget.OnSelect { get; set; }PUBLICGETSET

Called when a leaf item is selected. Receives the item's `Editor.AdvancedDropdownItem.Value`.

Returns:Action<object>

public string Editor.AdvancedDropdownWidget.RootTitle { get; set; }PUBLICGETSET

Title shown in the root panel header.

Returns:string

public string Editor.AdvancedDropdownWidget.SearchPlaceholderText { get; set; }PUBLICGETSET

Placeholder text shown in the search bar.

Returns:string

public System.Func`3<Editor.AdvancedDropdownItem,string[],int> Editor.AdvancedDropdownWidget.SearchScorer { get; set; }PUBLICGETSET

Optional custom search scorer. Receives an item and the search words, returns a score (0 = no match). If null, the default scorer matches against Title and Description.

Returns:Func<AdvancedDropdownItem,string[],int>

On this page

Constructorspublic AdvancedDropdownWidget(Editor.Widget parent)Methodsprotected virtual System.Void BuildPanel(Editor.AdvancedDropdownWidget.AdvancedDropdownPanel panel)protected virtual System.Void OnBuildSearchResults(Editor.AdvancedDropdownWidget.AdvancedDropdownPanel panel, System.String searchText)protected virtual System.Void OnKeyRelease(Editor.KeyEvent e)protected virtual System.Void OnPaint()public System.Void PopPanel()protected System.Void PushPanel(Editor.AdvancedDropdownWidget.AdvancedDropdownPanel panel)public System.Void Rebuild()Propertiespublic Vector2 Editor.AdvancedDropdownWidget.ContentSize { get; set; }public Editor.Widget Editor.AdvancedDropdownWidget.FilterWidget { get; set; }protected System.Boolean Editor.AdvancedDropdownWidget.IsSearching { get; set; }protected System.Boolean Editor.AdvancedDropdownWidget.IsTextInputActive { get; set; }protected Editor.Widget Editor.AdvancedDropdownWidget.Main { get; set; }public System.Action`1<Editor.AdvancedDropdownItem> Editor.AdvancedDropdownWidget.OnBuildItems { get; set; }public System.Action Editor.AdvancedDropdownWidget.OnFinished { get; set; }public System.Action`1<System.Object> Editor.AdvancedDropdownWidget.OnSelect { get; set; }public Editor.AdvancedDropdownItem Editor.AdvancedDropdownWidget.RootItem { get; set; }public System.String Editor.AdvancedDropdownWidget.RootTitle { get; set; }public Editor.LineEdit Editor.AdvancedDropdownWidget.Search { get; set; }public System.String Editor.AdvancedDropdownWidget.SearchPlaceholderText { get; set; }public System.Func`3<Editor.AdvancedDropdownItem,System.String[],System.Int32> Editor.AdvancedDropdownWidget.SearchScorer { get; set; }Metadata