{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class MenuBuilder | App UI | 0.5.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MenuBuilder

    A utility class to build a Menu programmatically.

    Inheritance
    object
    Popup
    Popup<MenuBuilder>
    AnchorPopup<MenuBuilder>
    MenuBuilder
    Inherited Members
    AnchorPopup<MenuBuilder>.placement
    AnchorPopup<MenuBuilder>.currentPlacement
    AnchorPopup<MenuBuilder>.offset
    AnchorPopup<MenuBuilder>.crossOffset
    AnchorPopup<MenuBuilder>.containerPadding
    AnchorPopup<MenuBuilder>.shouldFlip
    AnchorPopup<MenuBuilder>.arrowVisible
    AnchorPopup<MenuBuilder>.outsideClickDismissEnabled
    AnchorPopup<MenuBuilder>.outsideClickStrategy
    AnchorPopup<MenuBuilder>.anchor
    AnchorPopup<MenuBuilder>.SetPlacement(PopoverPlacement)
    AnchorPopup<MenuBuilder>.SetOffset(int)
    AnchorPopup<MenuBuilder>.SetCrossOffset(int)
    AnchorPopup<MenuBuilder>.SetContainerPadding(int)
    AnchorPopup<MenuBuilder>.SetShouldFlip(bool)
    AnchorPopup<MenuBuilder>.SetArrowVisible(bool)
    AnchorPopup<MenuBuilder>.SetAnchor(VisualElement)
    AnchorPopup<MenuBuilder>.SetOutsideClickDismiss(bool)
    AnchorPopup<MenuBuilder>.SetOutsideClickStrategy(OutsideClickStrategy)
    AnchorPopup<MenuBuilder>.ShowView()
    AnchorPopup<MenuBuilder>.AnimateViewIn()
    AnchorPopup<MenuBuilder>.ShouldDismiss(DismissType)
    AnchorPopup<MenuBuilder>.HideView(DismissType)
    AnchorPopup<MenuBuilder>.AnimateViewOut(DismissType)
    AnchorPopup<MenuBuilder>.RefreshPosition()
    Popup<MenuBuilder>.m_LastFocusedElement
    Popup<MenuBuilder>.shown
    Popup<MenuBuilder>.dismissed
    Popup<MenuBuilder>.SetKeyboardDismiss(bool)
    Popup<MenuBuilder>.SetLastFocusedElement(Focusable)
    Popup<MenuBuilder>.InvokeShownEventHandlers()
    Popup.k_NextFrameDurationMs
    Popup.k_PopupShow
    Popup.k_PopupDismiss
    Popup.handler
    Popup.keyboardDismissEnabled
    Popup.view
    Popup.targetParent
    Popup.contentView
    Popup.context
    Popup.Dismiss()
    Popup.Dismiss(DismissType)
    Popup.Show()
    Popup.OnViewKeyDown(KeyDownEvent)
    Popup.FindSuitableParent(VisualElement)
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.AppUI.UI
    Assembly: solution.dll
    Syntax
    public class MenuBuilder : AnchorPopup<MenuBuilder>

    Constructors

    Name Description
    MenuBuilder(VisualElement, ApplicationContext, VisualElement, VisualElement)

    Constructor.

    Properties

    Name Description
    closeOnSelection

    Close the menu automatically when an item is selected.

    currentMenu

    The last menu in the stack.

    Methods

    Name Description
    AddAction(int, Action<MenuItem>)

    Add an Action menu item to the current menu.

    AddAction(int, string, string, string, EventCallback<ClickEvent>)

    Add an Action menu item to the current menu.

    AddAction(int, string, string, EventCallback<ClickEvent>)

    Add an Action menu item to the current menu.

    AddDivider(Action<MenuDivider>)

    Add a Menu Divider to the current menu.

    AddSection(Action<MenuSection>)

    Add a Section to the current menu.

    Build(VisualElement, Menu)

    Create a MenuBuilder instance.

    GetFocusableElement()

    Returns the element that will be focused when the view will become visible.

    The default value is `null`.

    GetMovableElement()

    Method which must return the visual element that needs to be moved, based on the anchor position and size.

    InvokeDismissedEventHandlers(DismissType)

    Called when the popup has been dismissed. This method will invoke any handlers attached to the dismissed event.

    Pop()

    Go back to the parent menu and make it the current menu.

    PushSubMenu(int, string, string)

    Create an action menu item, add a sub-menu to the current menu, and make it the current menu.

    SetCloseOnSelection(bool)

    Close the menu automatically when an item is selected.

    ShouldAnimate()

    Implement this method to know if the popup should call AnimateViewIn() and AnimateViewOut(DismissType) methods or not.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)