![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MenuStack.h>
Represents a stack of open menus. The last item in the stack is the top most menu Menus are described as IMenus. Implementations of IMenu can control how the menus are created and presented (e.g. in their own window)
|
inline |
Constructor
| void FMenuStack::DismissAll | ( | ) |
Dismisses the entire menu stack
| void FMenuStack::DismissFrom | ( | const TSharedPtr< IMenu > & | InFromMenu | ) |
Dismisses the menu stack including InFromMenu and all its child menus Dismisses in reverse order (children first)
| InFromMenu | The menu to remove along with its children |
| TSharedPtr< IMenu > FMenuStack::FindMenuFromWindow | ( | TSharedRef< SWindow > | InWindow | ) | const |
Finds a menu in the stack that owns InWindow. Although this method isn't deprecated, it is intended for private use inside FMenuStack and its use as a public method should be avoided. Menus should be identified in client code as IMenu interfaces.
| InWindow | The window to look for |
| TSharedPtr< IMenu > FMenuStack::FindMenuInWidgetPath | ( | const FWidgetPath & | PathToQuery | ) | const |
Searches from bottom to top of the widget path for a menu in the stack. If the widget at the end of PathToQuery is inside a menu, there will be a menu content wrapper widget in the path.
| PathToQuery | The widget path to search for a menu |
| TSharedPtr< SWidget > FMenuStack::GetHostWidget | ( | ) | const |
| TSharedPtr< SWindow > FMenuStack::GetHostWindow | ( | ) | const |
| bool FMenuStack::GetToolTipForceFieldRect | ( | const TSharedRef< IMenu > & | InMenu, |
| const FWidgetPath & | InPathContainingMenu, | ||
| FSlateRect & | OutSlateRect | ||
| ) | const |
Called by the application when showing tooltips. It prevents tooltips from drawing over menu items. If the resulting bool is false, the resulting OutSlateRect will be [0,0,0,0] and should not be used.
| InMenu | A menu in the stack, used to generate the force field rect |
| InPathContainingMenu | A widget path containing InMenu. This could be generated but the application has the path so it helps performance to pass it in here. |
| OutSlateRect | The output rectangle enclosing the menu's children (created from the clipping rects in the geometry in PathContainingMenu) |
| bool FMenuStack::HasMenus | ( | ) | const |
| bool FMenuStack::HasOpenSubMenus | ( | TSharedPtr< IMenu > | InMenu | ) | const |
|
inline |
Delegate called when a menu is dismissed and destroyed
| void FMenuStack::OnWindowActivated | ( | TSharedRef< SWindow > | ActivatedWindow | ) |
Notifies the stack that a new window was activated. The menu stack will be dismissed if the activated window is not a menu in the stack
| ActivatedWindow | The window that was just activated |
| void FMenuStack::OnWindowDestroyed | ( | TSharedRef< SWindow > | InWindow | ) |
Called by the application when any window is destroyed.
| InWindow | The window that was destroyed |
| TSharedRef< IMenu > FMenuStack::Push | ( | const FWidgetPath & | InOwnerPath, |
| const TSharedRef< SWidget > & | InContent, | ||
| const UE::Slate::FDeprecateVector2DParameter & | SummonLocation, | ||
| const FPopupTransitionEffect & | TransitionEffect, | ||
| const bool | bFocusImmediately = true, |
||
| const UE::Slate::FDeprecateVector2DParameter & | SummonLocationSize = FVector2f::ZeroVector, |
||
| TOptional< EPopupMethod > | InMethod = TOptional<EPopupMethod>(), |
||
| const bool | bIsCollapsedByParent = true, |
||
| const bool | bEnablePerPixelTransparency = false, |
||
| const int32 | FocusUserIndex = INDEX_NONE |
||
| ) |
Pushes a new menu onto the stack. The widget path will be searched for existing menus and the new menu will be parented appropriately. Menus are always auto-sized. Use fixed-size content if a fixed size is required.
| InOwnerPath | The widget path for the parent widget of this menu. |
| InContent | The menu's content |
| SummonLocation | Location in screen-space where the menu should appear |
| TransitionEffect | Animation to use when the popup appears |
| bFocusImmediately | Should the popup steal focus when shown? |
| SummonLocationSize | An optional size around the summon location which describes an area in which the menu may not appear |
| InMethod | An optional popup method that will override the default method for the widgets in InOwnerPath |
| bIsCollapsedByParent | Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it. |
| bEnablePerPixelTransparency | Does the menu's content require per pixel transparency? |
| FocusUserIndex | The index of the user that should focus the menu. INDEX_NONE for all users. |
| TSharedRef< IMenu > FMenuStack::Push | ( | const TSharedPtr< IMenu > & | InParentMenu, |
| const TSharedRef< SWidget > & | InContent, | ||
| const UE::Slate::FDeprecateVector2DParameter & | SummonLocation, | ||
| const FPopupTransitionEffect & | TransitionEffect, | ||
| const bool | bFocusImmediately = true, |
||
| const UE::Slate::FDeprecateVector2DParameter & | SummonLocationSize = FVector2f::ZeroVector, |
||
| const bool | bIsCollapsedByParent = true, |
||
| const bool | bEnablePerPixelTransparency = false, |
||
| const int32 | FocusUserIndex = INDEX_NONE |
||
| ) |
Pushes a new child menu onto the stack. Menus are always auto-sized. Use fixed-size content if a fixed size is required.
| InParentMenu | The parent menu for this menu |
| InContent | The menu's content |
| SummonLocation | Location in screen-space where the menu should appear |
| TransitionEffect | Animation to use when the popup appears |
| bFocusImmediately | Should the popup steal focus when shown? |
| SummonLocationSize | An optional size around the summon location which describes an area in which the menu may not appear |
| bIsCollapsedByParent | Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it. |
| bEnablePerPixelTransparency | Does the menu's content require per pixel transparency? |
| FocusUserIndex | The index of the user that should focus the menu. INDEX_NONE for all users. |
| TSharedRef< IMenu > FMenuStack::PushHosted | ( | const FWidgetPath & | InOwnerPath, |
| const TSharedRef< IMenuHost > & | InMenuHost, | ||
| const TSharedRef< SWidget > & | InContent, | ||
| TSharedPtr< SWidget > & | OutWrappedContent, | ||
| const FPopupTransitionEffect & | TransitionEffect, | ||
| EShouldThrottle | ShouldThrottle, | ||
| const bool | bIsCollapsedByParent = true |
||
| ) |
Pushes a new menu onto the stack that is drawn by an external host widget. The widget path will be searched for existing menus and the new menu will be parented appropriately. Menus are always auto-sized. Use fixed-size content if a fixed size is required.
| InOwnerPath | The widget path for the parent widget of this menu |
| InMenuHost | The host widget that draws the menu's content |
| InContent | The menu's content |
| OutWrappedContent | Returns the InContent wrapped with widgets needed by the menu stack system. This is what should be drawn by the host after this call. |
| TransitionEffect | Animation to use when the popup appears |
| bIsCollapsedByParent | Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it. |
| TSharedRef< IMenu > FMenuStack::PushHosted | ( | const TSharedPtr< IMenu > & | InParentMenu, |
| const TSharedRef< IMenuHost > & | InMenuHost, | ||
| const TSharedRef< SWidget > & | InContent, | ||
| TSharedPtr< SWidget > & | OutWrappedContent, | ||
| const FPopupTransitionEffect & | TransitionEffect, | ||
| EShouldThrottle | ShouldThrottle, | ||
| const bool | bIsCollapsedByParent = true |
||
| ) |
Pushes a new child menu onto the stack that is drawn by an external host widget. Menus are always auto-sized. Use fixed-size content if a fixed size is required.
| InParentMenu | The parent menu for this menu |
| InMenuHost | The host widget that draws the menu's content |
| InContent | The menu's content |
| OutWrappedContent | Returns the InContent wrapped with widgets needed by the menu stack system. This is what should be drawn by the host after this call. |
| TransitionEffect | Animation to use when the popup appears |
| bIsCollapsedByParent | Is this menu collapsed when a parent menu receives focus/activation? If false, only focus/activation outside the entire stack will auto collapse it. |