Navigation
API > API/Runtime > API/Runtime/UMG
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
| Name | UMenuAnchor |
| Type | class |
| Header File | /Engine/Source/Runtime/UMG/Public/Components/MenuAnchor.h |
| Include Path | #include "Components/MenuAnchor.h" |
Syntax
UCLASS (MinimalAPI)
class UMenuAnchor : public UContentWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UPanelWidget → UContentWidget → UMenuAnchor
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMenuAnchor
(
const FObjectInitializer& ObjectInitializer |
Components/MenuAnchor.h |
Classes
| Name | Remarks |
|---|---|
| FGetUserWidget |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bFitInWindow | bool | Should the menu anchor attempt to fit the menu inside the window. | Components/MenuAnchor.h |
|
| MenuClass | TSubclassOf< class UUserWidget > | The widget class to spawn when the menu is required. | Components/MenuAnchor.h |
|
| OnGetMenuContentEvent | FGetWidget | Deprecated. | Components/MenuAnchor.h |
|
| OnGetUserMenuContentEvent | FGetUserWidget | Called when the menu content is requested to allow a more customized handling over what to display | Components/MenuAnchor.h |
|
| OnMenuOpenChanged | FOnMenuOpenChangedEvent | Called when the opened state of the menu changes | Components/MenuAnchor.h |
|
| Placement | TEnumAsByte< EMenuPlacement > | The placement location of the summoned widget. | Components/MenuAnchor.h |
|
| ShouldDeferPaintingAfterWindowContent | bool | Components/MenuAnchor.h |
|
|
| ShowMenuBackground | bool | For menus using the application menu stack, should the window background be visible? | Components/MenuAnchor.h |
|
| UseApplicationMenuStack | bool | Does this menu behave like a normal stacked menu? Set it to false to control the menu's lifetime yourself. | Components/MenuAnchor.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Close() |
Closes the menu if it is currently open. | Components/MenuAnchor.h |
|
void FitInWindow
(
bool bFit |
Components/MenuAnchor.h |
|
|
FVector2D GetMenuPosition() |
Returns the current menu position | Components/MenuAnchor.h |
|
EMenuPlacement GetPlacement() |
Components/MenuAnchor.h | ||
bool HasOpenSubMenus() |
Returns whether this menu has open submenus | Components/MenuAnchor.h |
|
bool IsDeferPaintingAfterWindowContent() |
Components/MenuAnchor.h | ||
bool IsFitInWindow() |
Components/MenuAnchor.h | ||
bool IsOpen() |
Returns true if the popup is open; false otherwise. | Components/MenuAnchor.h |
|
bool IsShowMenuBackground() |
Components/MenuAnchor.h | ||
bool IsUseApplicationMenuStack() |
Components/MenuAnchor.h | ||
void Open
(
bool bFocusMenu |
Opens the menu if it is not already open | Components/MenuAnchor.h |
|
void SetPlacement
(
EMenuPlacement InPlacement |
Components/MenuAnchor.h |
|
|
bool ShouldOpenDueToClick () |
Returns true if we should open the menu due to a click. | Components/MenuAnchor.h |
|
void ToggleOpen
(
bool bFocusOnOpen |
Toggles the menus open state. | Components/MenuAnchor.h |
|
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FText GetPaletteCategory() |
Gets the palette category of the widget | Components/MenuAnchor.h |
Overridden from UVisual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ReleaseSlateResources
(
bool bReleaseChildren |
Components/MenuAnchor.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSharedRef< SWidget > HandleGetMenuContent() |
Components/MenuAnchor.h | ||
void HandleMenuOpenChanged
(
bool bIsOpen |
Components/MenuAnchor.h | ||
void InitShouldDeferPaintingAfterWindowContent
(
bool InShouldDeferPaintingAfterWindowContent |
Initialize ShouldDeferPaintingAfterWindowContent in the constructor before the SWidget is constructed. | Components/MenuAnchor.h | |
void InitShowMenuBackground
(
bool InShowMenuBackground |
Initialize ShowMenuBackground in the constructor before the SWidget is constructed. | Components/MenuAnchor.h | |
void InitUseApplicationMenuStack
(
bool InUseApplicationMenuStack |
Initialize UseApplicationMenuStack in the constructor before the SWidget is constructed. | Components/MenuAnchor.h |
Overridden from UPanelWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnSlotAdded
(
UPanelSlot* Slot |
UPanelWidget. | Components/MenuAnchor.h | |
virtual void OnSlotRemoved
(
UPanelSlot* Slot |
Components/MenuAnchor.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< SWidget > RebuildWidget() |
Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed. | Components/MenuAnchor.h |