Class PopupMenu
Utility class to show and hide a Popup menu panel. Taken from Render Studio.
Namespace: Unity.Industrial.Forma.StandardUI
Syntax
public class PopupMenu
Constructors
PopupMenu(VisualElement, VisualElement, VisualElement, Vector2)
Create a PopupMenu instance.
Declaration
public PopupMenu(VisualElement content, VisualElement treeRoot, VisualElement anchor = null, Vector2 offset = default(Vector2))
Parameters
Type | Name | Description |
---|---|---|
VisualElement | content | The content that should be displayed as a popup. |
VisualElement | treeRoot | The popup hierarchy root. The PopupMenu hierarchy is added as a child to this element. |
VisualElement | anchor | The anchor for the element. If null, the PopupMenu will appear in the center of the screen |
Vector2 | offset | Offset from the anchor if any, or the center of the screen. |
Fields
exitOnClickOut
Close this menu if the user clicks outside it
Declaration
public bool exitOnClickOut
Field Value
Type | Description |
---|---|
Boolean |
Properties
backDrop
Backdrop UI element. This is a transparent element that covers the entire screen to catch clicks outside the menu.
Declaration
public VisualElement backDrop { get; }
Property Value
Type | Description |
---|---|
VisualElement |
bubbleTail
Bubbletail VisualElement
Declaration
public VisualElement bubbleTail { get; }
Property Value
Type | Description |
---|---|
VisualElement |
bubbleTailPosition
Bubble tail position
Declaration
public PopupMenu.BubbleTailPosition bubbleTailPosition { get; }
Property Value
Type | Description |
---|---|
PopupMenu.BubbleTailPosition |
container
UI container
Declaration
public VisualElement container { get; }
Property Value
Type | Description |
---|---|
VisualElement |
isVisible
Is menu visible?
Declaration
public bool isVisible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
treeRoot
Visual tree root
Declaration
public VisualElement treeRoot { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Methods
Hide()
Hide the Popup Menu.
Declaration
public void Hide()
Show()
Show the Popup Menu.
Declaration
public void Show()
Events
visibilityChanged
Visibility changed
Declaration
public event Action<bool> visibilityChanged
Event Type
Type | Description |
---|---|
Action<Boolean> |