UMenuAnchor

The Menu Anchor allows you to specify an location that a popup menu should be anchored to, and should be summoned from.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Components/MenuAnchor.h

Include

#include "Components/MenuAnchor.h"

Syntax

class UMenuAnchor : public UContentWidget

Remarks

The Menu Anchor allows you to specify an location that a popup menu should be anchored to, and should be summoned from.

  • Single Child

  • Popup

Variables

Name Description

Public variable

bool

 

bFitInWindow

Should the menu anchor attempt to fit the menu inside the window.

Public variable

TSubclassOf< cl...

 

MenuClass

The widget class to spawn when the menu is required.

Protected variable

TSharedPtr< SMe...

 

MyMenuAnchor

Public variable

FGetWidget

 

OnGetMenuContentEvent

Called when the menu content is requested to allow a more customized handling over what to display

Public variable

FOnMenuOpenChan...

 

OnMenuOpenChanged

Called when the opened state of the menu changes

Public variable

TEnumAsByte< EM...

 

Placement

The placement location of the summoned widget.

Public variable

bool

 

ShouldDeferPaintingAfterWindowContent

Public variable

bool

 

UseApplicationMenuStack

Does this menu behave like a normal stacked menu? Set it to false to control the menu's lifetime yourself.

Constructors

Name Description

Public function

UMenuAnchor

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

Close()

Closes the menu if it is currently open.

Public function

void

 

FitInWindow

(
    bool bFit
)

Public function Const

FVector2D

 

GetMenuPosition()

Returns the current menu position

Protected function

TSharedRef< ...

 

HandleGetMenuContent()

Protected function

void

 

HandleMenuOpenChanged

(
    bool bIsOpen
)

Public function Const

bool

 

HasOpenSubMenus()

Returns whether this menu has open submenus

Public function Const

bool

 

IsOpen()

Returns true if the popup is open; false otherwise.

Public function

void

 

Open

(
    bool bFocusMenu
)

Opens the menu if it is not already open

Public function

void

 

SetPlacement

(
    TEnumAsByte< EMenuPlacement > InPla...
)

Public function Const

bool

 

ShouldOpenDueToClick()

Returns true if we should open the menu due to a click.

Public function

void

 

ToggleOpen

(
    bool bFocusOnOpen
)

Toggles the menus open state.

Overridden from UPanelWidget

Name Description

Protected function Virtual

void

 

OnSlotAdded

(
    UPanelSlot* Slot
)

UPanelWidget.

Protected function Virtual

void

 

OnSlotRemoved

(
    UPanelSlot* Slot
)

Overridden from UWidget

Name Description

Public function Virtual

const FText

 

GetPaletteCategory()

Gets the palette category of the widget

Protected function Virtual

TSharedRef< ...

 

RebuildWidget()

Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed.

Overridden from UVisual

Name Description

Public function Virtual

void

 

ReleaseSlateResources

(
    bool bReleaseChildren
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss