UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMenuBuilder Class Reference

#include <MultiBoxBuilder.h>

+ Inheritance diagram for FMenuBuilder:

Public Member Functions

 FMenuBuilder (const bool bInShouldCloseWindowAfterMenuSelection, TSharedPtr< const FUICommandList > InCommandList, TSharedPtr< FExtender > InExtender=TSharedPtr< FExtender >(), const bool bInCloseSelfOnly=false, const ISlateStyle *InStyleSet=&FCoreStyle::Get(), bool bInSearchable=true, FName InMenuName=NAME_None, bool bInRecursivelySearchable=true)
 
virtual SLATE_API TSharedRef< class SWidgetMakeWidget (FMultiBox::FOnMakeMultiBoxBuilderOverride *InMakeMultiBoxBuilderOverride=nullptr) override
 
virtual SLATE_API TSharedRef< class SWidgetMakeWidget (FMultiBox::FOnMakeMultiBoxBuilderOverride *InMakeMultiBoxBuilderOverride, uint32 MaxHeight)
 
SLATE_API void AddMenuSeparator (FName InExtensionHook=NAME_None, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddSeparator (FName InExtensionHook=NAME_None, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void BeginSection (FName InExtensionHook, const TAttribute< FText > &InHeadingText=TAttribute< FText >(), const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >(), const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API void EndSection ()
 
SLATE_API void AddSubMenu (const TAttribute< FText > &InMenuLabel, const TAttribute< FText > &InToolTip, const FNewMenuDelegate &InSubMenu, const FUIAction &InUIAction, FName InExtensionHook, const EUserInterfaceActionType InUserInterfaceActionType, const bool bInOpenSubMenuOnClick=false, const FSlateIcon &InIcon=FSlateIcon(), const bool bInShouldCloseWindowAfterMenuSelection=true, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >(), const TAttribute< FText > &InInputBindingOverride=TAttribute< FText >())
 
SLATE_API void AddSubMenu (const TAttribute< FText > &InMenuLabel, const TAttribute< FText > &InToolTip, const FNewMenuDelegate &InSubMenu, const bool bInOpenSubMenuOnClick=false, const FSlateIcon &InIcon=FSlateIcon(), const bool bInShouldCloseWindowAfterMenuSelection=true, FName InExtensionHook=NAME_None, FName InTutorialHighlightName=NAME_None, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddSubMenu (const TSharedRef< SWidget > Contents, const FNewMenuDelegate &InSubMenu, const bool bInOpenSubMenuOnClick=false, const bool bInShouldCloseWindowAfterMenuSelection=true, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddSubMenu (const FUIAction &UIAction, const TSharedRef< SWidget > Contents, const FNewMenuDelegate &InSubMenu, const bool bInShouldCloseWindowAfterMenuSelection=true, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddWidget (TSharedRef< SWidget > InWidget, const FText &InLabel, bool bInNoIndent=false, bool bInSearchable=true, const TAttribute< FText > &InToolTipText=FText())
 
SLATE_API void AddWidget (const TSharedRef< SWidget > &InWidget, const FText &InLabel, const FMenuEntryStyleParams &InStyleParams, bool bInSearchable=true, const TAttribute< FText > &InToolTipText=FText(), const TAttribute< FSlateIcon > &InIcon=TAttribute< FSlateIcon >(), const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddWidget (const TSharedRef< SWidget > &InWidget, const FText &InLabel, const FMenuEntryStyleParams &InStyleParams, const TAttribute< FMenuEntryResizeParams > &InResizeParams, bool bInSearchable=true, const TAttribute< FText > &InToolTipText=FText(), const TAttribute< FSlateIcon > &InIcon=TAttribute< FSlateIcon >(), const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddSearchWidget ()
 
void SetIsEditing (bool bInIsEditing)
 
SLATE_API void AddWrapperSubMenu (const FText &InMenuLabel, const FText &InToolTip, const FOnGetContent &InSubMenu, const FSlateIcon &InIcon)
 
SLATE_API void AddWrapperSubMenu (const FText &InMenuLabel, const FText &InToolTip, const FOnGetContent &InSubMenu, const FSlateIcon &InIcon, const FUIAction &UIAction)
 
SLATE_API void AddWrapperSubMenu (const FText &InMenuLabel, const FText &InToolTip, const TSharedPtr< SWidget > &InSubMenu, const FSlateIcon &InIcon)
 
void SetSearchable (bool bIsSearchable)
 
- Public Member Functions inherited from FBaseMenuBuilder
SLATE_API FBaseMenuBuilder (const EMultiBoxType InType, const bool bInShouldCloseWindowAfterMenuSelection, TSharedPtr< const FUICommandList > InCommandList, bool bInCloseSelfOnly, TSharedPtr< FExtender > InExtender=TSharedPtr< FExtender >(), const ISlateStyle *InStyleSet=&FCoreStyle::Get(), FName InTutorialHighlightName=NAME_None, FName InMenuName=NAME_None)
 
SLATE_API void AddMenuEntry (const TSharedPtr< const FUICommandInfo > InCommand, FName InExtensionHook=NAME_None, const TAttribute< FText > &InLabelOverride=TAttribute< FText >(), const TAttribute< FText > &InToolTipOverride=TAttribute< FText >(), const FSlateIcon &InIconOverride=FSlateIcon(), FName InTutorialHighlightName=NAME_None, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddMenuEntry (const TAttribute< FText > &InLabel, const TAttribute< FText > &InToolTip, const FSlateIcon &InIcon, const FUIAction &UIAction, FName InExtensionHook=NAME_None, const EUserInterfaceActionType UserInterfaceActionType=EUserInterfaceActionType::Button, FName InTutorialHighlightName=NAME_None, const TAttribute< FText > &InInputBindingOverride=TAttribute< FText >(), const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddMenuEntry (const FUIAction &UIAction, const TSharedRef< SWidget > Contents, const FName &InExtensionHook=NAME_None, const TAttribute< FText > &InToolTip=TAttribute< FText >(), const EUserInterfaceActionType UserInterfaceActionType=EUserInterfaceActionType::Button, FName InTutorialHighlightName=NAME_None, const TAttribute< EVisibility > &InVisibility=TAttribute< EVisibility >())
 
SLATE_API void AddMenuEntry (const FMenuEntryParams &InMenuEntryParams)
 
- Public Member Functions inherited from FMultiBoxBuilder
SLATE_API FMultiBoxBuilder (const EMultiBoxType InType, FMultiBoxCustomization InCustomization, const bool bInShouldCloseWindowAfterMenuSelection, const TSharedPtr< const FUICommandList > &InCommandList, TSharedPtr< FExtender > InExtender=TSharedPtr< FExtender >(), FName InTutorialHighlightName=NAME_None, FName InMenuName=NAME_None)
 
virtual ~FMultiBoxBuilder ()
 
SLATE_API void AddEditableText (const FText &InLabel, const FText &InToolTip, const FSlateIcon &InIcon, const TAttribute< FText > &InTextAttribute, const FOnTextCommitted &InOnTextCommitted=FOnTextCommitted(), const FOnTextChanged &InOnTextChanged=FOnTextChanged(), bool bInReadOnly=false)
 
SLATE_API void AddVerifiedEditableText (const FText &InLabel, const FText &InToolTip, const FSlateIcon &InIcon, const TAttribute< FText > &InTextAttribute, const FOnVerifyTextChanged &InOnVerifyTextChanged, const FOnTextCommitted &InOnTextCommitted=FOnTextCommitted(), const FOnTextChanged &InOnTextChanged=FOnTextChanged(), bool bInReadOnly=false)
 
SLATE_API TSharedRef< class FMultiBoxGetMultiBox ()
 
SLATE_API void PushCommandList (const TSharedRef< const FUICommandList > CommandList)
 
SLATE_API void SetLastSelectedCommandIndex (int32 InLastSelectedCommandIndex)
 
SLATE_API void PopCommandList ()
 
SLATE_API TSharedPtr< const FUICommandListGetTopCommandList ()
 
SLATE_API void PushExtender (TSharedRef< FExtender > InExtender)
 
SLATE_API void PopExtender ()
 
SLATE_API const ISlateStyleGetStyleSet () const
 
SLATE_API const FNameGetStyleName () const
 
SLATE_API void SetCheckBoxStyle (FName InCheckBoxStyle)
 
SLATE_API void SetStyle (const ISlateStyle *InStyleSet, const FName &InStyleName)
 
SLATE_API FMultiBoxCustomization GetCustomization () const
 
void SetExtendersEnabled (bool bEnabled)
 
bool ExtendersEnabled () const
 

Protected Member Functions

virtual SLATE_API void ApplyHook (FName InExtensionHook, EExtensionHook::Position HookPosition) override
 
virtual SLATE_API void ApplySectionBeginning () override
 

Additional Inherited Members

- Protected Attributes inherited from FBaseMenuBuilder
bool bCloseSelfOnly
 
- Protected Attributes inherited from FMultiBoxBuilder
TSharedRef< class FMultiBoxMultiBox
 
TArray< TSharedPtr< const FUICommandList > > CommandListStack
 
TArray< TSharedPtr< class FExtender > > ExtenderStack
 
FName TutorialHighlightName
 
FName MenuName
 
FName CheckBoxStyle
 
bool bExtendersEnabled
 

Detailed Description

Vertical menu builder

Constructor & Destructor Documentation

◆ FMenuBuilder()

FMenuBuilder::FMenuBuilder ( const bool  bInShouldCloseWindowAfterMenuSelection,
TSharedPtr< const FUICommandList InCommandList,
TSharedPtr< FExtender InExtender = TSharedPtr<FExtender>(),
const bool  bInCloseSelfOnly = false,
const ISlateStyle InStyleSet = &FCoreStyle::Get(),
bool  bInSearchable = true,
FName  InMenuName = NAME_None,
bool  bInRecursivelySearchable = true 
)
inline

Constructor

Parameters
bInShouldCloseWindowAfterMenuSelectionSets whether or not the window that contains this multibox should be destroyed after the user clicks on a menu item in this box
InCommandListThe action list that maps command infos to delegates that should be called for each command associated with a multiblock widget
bInCloseSelfOnlyTrue if clicking on a menu entry closes itself only and its children but not the entire stack
bInSearchableTrue if the menu is searchable
bInRecursivelySearchableTrue if search algorithm should go down the sub-menus when searching. If false, the search will not scan the sub-menus. Recursive search is usually disabled on menus that are automatically generated in a way that the menu can expand indefinitely in a circular fashion. For example, the Blueprint API binding reflected on function return type can do that. Think about a function like "A* A::GetParent()". If a root menu expands "A" functions and expands on the function return types, then selecting "GetParent()" will expand another "A" menu. Without simulation, the reflection API don't know when the recursion finishes, nor does the recursive search algorithm.

Member Function Documentation

◆ AddMenuSeparator()

void FMenuBuilder::AddMenuSeparator ( FName  InExtensionHook = NAME_None,
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

Adds a separator

◆ AddSearchWidget()

void FMenuBuilder::AddSearchWidget ( )

Adds the widget the multibox will use for searching

◆ AddSeparator()

void FMenuBuilder::AddSeparator ( FName  InExtensionHook = NAME_None,
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

◆ AddSubMenu() [1/4]

void FMenuBuilder::AddSubMenu ( const FUIAction UIAction,
const TSharedRef< SWidget Contents,
const FNewMenuDelegate InSubMenu,
const bool  bInShouldCloseWindowAfterMenuSelection = true,
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

◆ AddSubMenu() [2/4]

void FMenuBuilder::AddSubMenu ( const TAttribute< FText > &  InMenuLabel,
const TAttribute< FText > &  InToolTip,
const FNewMenuDelegate InSubMenu,
const bool  bInOpenSubMenuOnClick = false,
const FSlateIcon InIcon = FSlateIcon(),
const bool  bInShouldCloseWindowAfterMenuSelection = true,
FName  InExtensionHook = NAME_None,
FName  InTutorialHighlightName = NAME_None,
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

◆ AddSubMenu() [3/4]

void FMenuBuilder::AddSubMenu ( const TAttribute< FText > &  InMenuLabel,
const TAttribute< FText > &  InToolTip,
const FNewMenuDelegate InSubMenu,
const FUIAction InUIAction,
FName  InExtensionHook,
const EUserInterfaceActionType  InUserInterfaceActionType,
const bool  bInOpenSubMenuOnClick = false,
const FSlateIcon InIcon = FSlateIcon(),
const bool  bInShouldCloseWindowAfterMenuSelection = true,
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>(),
const TAttribute< FText > &  InInputBindingOverride = TAttribute<FText>() 
)

Adds a sub-menu which is a menu within a menu

Parameters
InMenuLabelThe text that should be shown for the menu
InToolTipThe tooltip that should be shown when the menu is hovered over
InSubMenuSub-Menu object which creates menu entries for the sub-menu
InUIActionActions to execute on this menu item.
InExtensionHookThe section hook. Can be NAME_None
InUserInterfaceActionTypeType of interface action
bInOpenSubMenuOnClickSub-menu will open only if the sub-menu entry is clicked
InIconThe icon to use
bInShouldCloseWindowAfterMenuSelectionWhether the submenu should close after an item is selected
InVisibilityOptional Visibility Override. Can be used to show/hide this entry dynamically.

◆ AddSubMenu() [4/4]

void FMenuBuilder::AddSubMenu ( const TSharedRef< SWidget Contents,
const FNewMenuDelegate InSubMenu,
const bool  bInOpenSubMenuOnClick = false,
const bool  bInShouldCloseWindowAfterMenuSelection = true,
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

◆ AddWidget() [1/3]

void FMenuBuilder::AddWidget ( const TSharedRef< SWidget > &  InWidget,
const FText InLabel,
const FMenuEntryStyleParams InStyleParams,
bool  bInSearchable = true,
const TAttribute< FText > &  InToolTipText = FText(),
const TAttribute< FSlateIcon > &  InIcon = TAttribute<FSlateIcon>(),
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

Adds any widget to the menu

Parameters
InWidgetThe widget that should be shown in the menu
InLabelOptional label text to be added to the left of the content
InStyleParamsOptional style parameters and overrides,
See also
FMenuEntryStyleParams
Parameters
bInSearchableIf true, widget will be searchable (default == true)
InToolTipTextOptional tooltip text to be added to the widget and label
InIconOptional icon to be shown to the left of the label/content

◆ AddWidget() [2/3]

void FMenuBuilder::AddWidget ( const TSharedRef< SWidget > &  InWidget,
const FText InLabel,
const FMenuEntryStyleParams InStyleParams,
const TAttribute< FMenuEntryResizeParams > &  InResizeParams,
bool  bInSearchable = true,
const TAttribute< FText > &  InToolTipText = FText(),
const TAttribute< FSlateIcon > &  InIcon = TAttribute<FSlateIcon>(),
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>() 
)

Adds any widget to the menu

Parameters
InWidgetThe widget that should be shown in the menu
InLabelOptional label text to be added to the left of the content
InStyleParamsOptional style parameters and overrides,
See also
FMenuEntryStyleParams
Parameters
InResizeParamsOptional resize parameters and overrides,
See also
FMenuEntryResizeParams
Parameters
bInSearchableIf true, widget will be searchable (default == true)
InToolTipTextOptional tooltip text to be added to the widget and label
InIconOptional icon to be shown to the left of the label/content

◆ AddWidget() [3/3]

void FMenuBuilder::AddWidget ( TSharedRef< SWidget InWidget,
const FText InLabel,
bool  bInNoIndent = false,
bool  bInSearchable = true,
const TAttribute< FText > &  InToolTipText = FText() 
)

Adds any widget to the menu

Parameters
InWidgetThe widget that should be shown in the menu
InLabelOptional label text to be added to the left of the content
bInNoIndentIf true, removes the padding from the left of the widget that lines it up with other menu items (default == false)
bInSearchableIf true, widget will be searchable (default == true)
InToolTipTextOptional tooltip text to be added to the widget and label

◆ AddWrapperSubMenu() [1/3]

void FMenuBuilder::AddWrapperSubMenu ( const FText InMenuLabel,
const FText InToolTip,
const FOnGetContent InSubMenu,
const FSlateIcon InIcon 
)

Adds a sub-menu which is a menu within a menu

Parameters
InMenuLabelThe text that should be shown for the menu
InToolTipThe tooltip that should be shown when the menu is hovered over
InSubMenuSub-Menu object which creates the sub-menu

◆ AddWrapperSubMenu() [2/3]

void FMenuBuilder::AddWrapperSubMenu ( const FText InMenuLabel,
const FText InToolTip,
const FOnGetContent InSubMenu,
const FSlateIcon InIcon,
const FUIAction UIAction 
)

◆ AddWrapperSubMenu() [3/3]

void FMenuBuilder::AddWrapperSubMenu ( const FText InMenuLabel,
const FText InToolTip,
const TSharedPtr< SWidget > &  InSubMenu,
const FSlateIcon InIcon 
)

Adds a sub-menu which is a menu within a menu

Parameters
InMenuLabelThe text that should be shown for the menu
InToolTipThe tooltip that should be shown when the menu is hovered over
InSubMenuSub-Menu object

◆ ApplyHook()

void FMenuBuilder::ApplyHook ( FName  InExtensionHook,
EExtensionHook::Position  HookPosition 
)
overrideprotectedvirtual

FMultiBoxBuilder interface

Implements FMultiBoxBuilder.

◆ ApplySectionBeginning()

void FMenuBuilder::ApplySectionBeginning ( )
overrideprotectedvirtual

Applies the beginning of a section, including the header and relevant separator

Reimplemented from FMultiBoxBuilder.

◆ BeginSection()

void FMenuBuilder::BeginSection ( FName  InExtensionHook,
const TAttribute< FText > &  InHeadingText = TAttribute<FText>(),
const TAttribute< EVisibility > &  InVisibility = TAttribute<EVisibility>(),
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Starts a section on to the extender section hook stack

Parameters
InExtensionHookThe section hook. Can be NAME_None
InHeadingTextThe heading text to use. If none, only a separator is used
InVisibilityOptional Visibility Override. Can be used to show/hide this Section dynamically.
InResizeParamsOptional resize parameters and overrides,
See also
FMenuEntryResizeParams

◆ EndSection()

void FMenuBuilder::EndSection ( )

Ends the current section

◆ MakeWidget() [1/2]

TSharedRef< class SWidget > FMenuBuilder::MakeWidget ( FMultiBox::FOnMakeMultiBoxBuilderOverride *  InMakeMultiBoxBuilderOverride,
uint32  MaxHeight 
)
virtual

◆ MakeWidget() [2/2]

TSharedRef< class SWidget > FMenuBuilder::MakeWidget ( FMultiBox::FOnMakeMultiBoxBuilderOverride *  InMakeMultiBoxBuilderOverride = nullptr)
overridevirtual

Creates a widget for this MultiBox

Returns
New widget object

Reimplemented from FMultiBoxBuilder.

◆ SetIsEditing()

void FMenuBuilder::SetIsEditing ( bool  bInIsEditing)
inline

◆ SetSearchable()

void FMenuBuilder::SetSearchable ( bool  bIsSearchable)
inline

The documentation for this class was generated from the following files: