# AdvancedDropdown

> Inherit from this class to implement your own drop-down control.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.6/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public abstract class AdvancedDropdown
```

## Remarks

```csharp
using UnityEditor;
using UnityEngine;
using UnityEditor.IMGUI.Controls;

class WeekdaysDropdown : AdvancedDropdown
{
    public WeekdaysDropdown(AdvancedDropdownState state) : base(state)
    {
    }

    protected override AdvancedDropdownItem BuildRoot()
    {
        var root = new AdvancedDropdownItem("Weekdays");

        var firstHalf = new AdvancedDropdownItem("First half");
        var secondHalf = new AdvancedDropdownItem("Second half");
        var weekend = new AdvancedDropdownItem("Weekend");

        firstHalf.AddChild(new AdvancedDropdownItem("Monday"));
        firstHalf.AddChild(new AdvancedDropdownItem("Tuesday"));
        secondHalf.AddChild(new AdvancedDropdownItem("Wednesday"));
        secondHalf.AddChild(new AdvancedDropdownItem("Thursday"));
        weekend.AddChild(new AdvancedDropdownItem("Friday"));
        weekend.AddChild(new AdvancedDropdownItem("Saturday"));
        weekend.AddChild(new AdvancedDropdownItem("Sunday"));

        root.AddChild(firstHalf);
        root.AddChild(secondHalf);
        root.AddChild(weekend);

        return root;
    }
}

public class AdvancedDropdownTestWindow : EditorWindow
{
    void OnGUI()
    {
        var rect = GUILayoutUtility.GetRect(new GUIContent("Show"), EditorStyles.toolbarButton);
        if (GUI.Button(rect, new GUIContent("Show"), EditorStyles.toolbarButton))
        {
            var dropdown = new WeekdaysDropdown(new AdvancedDropdownState());
            dropdown.Show(rect);
        }
    }
}
```

## Properties

| Property                                                                                                  | Description                                                                                                                            |
| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| [minimumSize](/engine/6000.6/script-reference/unityeditor/imgui/controls/advanceddropdown/minimumsize.md) | Minimum size of the drop-down window. By default, the drop-down will try to match the width of the given rect or the rendered content. |

## Methods

| Method                                                                                                      | Description                                                                                                              |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [BuildRoot](/engine/6000.6/script-reference/unityeditor/imgui/controls/advanceddropdown/buildroot.md)       | Implement this method to generate the content of the drop-down. This method is called when the drop-down is being shown. |
| [ItemSelected](/engine/6000.6/script-reference/unityeditor/imgui/controls/advanceddropdown/itemselected.md) | Override this method to get notified when an item is selected.                                                           |
| [Show](/engine/6000.6/script-reference/unityeditor/imgui/controls/advanceddropdown/show.md)                 | Call this method to show the drop-down at the given position.                                                            |
