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

#include <MultiBoxBuilder.h>

+ Inheritance diagram for FToolBarBuilder:

Public Member Functions

 FToolBarBuilder (TSharedPtr< const FUICommandList > InCommandList, FMultiBoxCustomization InCustomization, TSharedPtr< FExtender > InExtender, EOrientation Orientation, const bool InForceSmallIcons=false, const bool bUniform=false)
 
 FToolBarBuilder (TSharedPtr< const FUICommandList > InCommandList, FMultiBoxCustomization InCustomization, TSharedPtr< FExtender > InExtender=nullptr, const bool InForceSmallIcons=false)
 
void SetLabelVisibility (EVisibility InLabelVisibility)
 
SLATE_API void SetIsFocusable (bool bInIsFocusable)
 
SLATE_API void SetAllowWrapButton (const TOptional< bool > &bInAllowWrapButton) const
 
virtual SLATE_API void AddToolBarButton (const FButtonArgs &ButtonArgs)
 
SLATE_API TSharedPtr< FToolBarButtonBlockAddToolBarButton (const TSharedPtr< const FUICommandInfo > InCommand, FName InExtensionHook=NAME_None, const TAttribute< FText > &InLabelOverride=TAttribute< FText >(), const TAttribute< FText > &InToolTipOverride=TAttribute< FText >(), const TAttribute< FSlateIcon > &InIconOverride=TAttribute< FSlateIcon >(), FName InTutorialHighlightName=NAME_None, FNewMenuDelegate InCustomMenuDelegate=FNewMenuDelegate(), TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >(), TAttribute< FText > InToolbarLabelOverride=TAttribute< FText >(), const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API TSharedPtr< FToolBarButtonBlockAddToolBarButton (const FUIAction &InAction, FName InExtensionHook=NAME_None, const TAttribute< FText > &InLabelOverride=TAttribute< FText >(), const TAttribute< FText > &InToolTipOverride=TAttribute< FText >(), const TAttribute< FSlateIcon > &InIconOverride=TAttribute< FSlateIcon >(), const EUserInterfaceActionType UserInterfaceActionType=EUserInterfaceActionType::Button, FName InTutorialHighlightName=NAME_None, TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >(), TAttribute< FText > InToolbarLabelOverride=TAttribute< FText >(), const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API void AddComboButton (const FUIAction &InAction, const FOnGetContent &InMenuContentGenerator, const TAttribute< FText > &InLabelOverride=TAttribute< FText >(), const TAttribute< FText > &InToolTipOverride=TAttribute< FText >(), const TAttribute< FSlateIcon > &InIconOverride=TAttribute< FSlateIcon >(), bool bInSimpleComboBox=false, FName InTutorialHighlightName=NAME_None, TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >(), TAttribute< FText > InToolbarLabelOverride=TAttribute< FText >(), TAttribute< EMenuPlacement > InPlacementOverride=TAttribute< EMenuPlacement >(), const EUserInterfaceActionType InUserInterfaceActionType=EUserInterfaceActionType::Button, const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API void AddToolbarStackButton (const TSharedPtr< const FUICommandInfo > InCommand, FName InTutorialHighlightName=NAME_None)
 
SLATE_API void AddToolBarWidget (TSharedRef< SWidget > InWidget, const TAttribute< FText > &InLabel=TAttribute< FText >(), FName InTutorialHighlightName=NAME_None, bool bInSearchable=true, const TAttribute< FText > &InToolTip=TAttribute< FText >())
 
SLATE_API void AddWidget (TSharedRef< SWidget > InWidget, FName InTutorialHighlightName=NAME_None, bool bInSearchable=true, EHorizontalAlignment InAlignment=HAlign_Fill, FNewMenuDelegate InCustomMenuDelegate=FNewMenuDelegate(), TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >())
 
SLATE_API void AddWidget (TSharedRef< SWidget > InWidget, const FMenuEntryStyleParams &InStyleParams, FName InTutorialHighlightName=NAME_None, bool bInSearchable=true, FNewMenuDelegate InCustomMenuDelegate=FNewMenuDelegate(), TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >(), const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API void AddSeparator (FName InExtensionHook=NAME_None, TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >(), const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API void BeginSection (FName InExtensionHook, bool bInSectionShouldHaveSeparator=true, const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 
SLATE_API void EndSection ()
 
SLATE_API void BeginBlockGroup ()
 
SLATE_API void EndBlockGroup ()
 
SLATE_API void BeginStyleOverride (FName StyleOverrideName)
 
SLATE_API void EndStyleOverride ()
 
- 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)
 
virtual SLATE_API TSharedRef< class SWidgetMakeWidget (FMultiBox::FOnMakeMultiBoxBuilderOverride *InMakeMultiBoxBuilderOverride=nullptr)
 
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

 FToolBarBuilder (EMultiBoxType InType, TSharedPtr< const FUICommandList > InCommandList, FMultiBoxCustomization InCustomization, TSharedPtr< FExtender > InExtender=TSharedPtr< FExtender >(), const bool InForceSmallIcons=false)
 
virtual SLATE_API void ApplyHook (FName InExtensionHook, EExtensionHook::Position HookPosition) override
 
virtual SLATE_API void ApplySectionBeginning () override
 
SLATE_API void InitializeToolBarButtonBlock (TSharedPtr< FToolBarButtonBlock > ButtonRowBlock, const FButtonArgs &ButtonArgs)
 
void AddWidgetInternal (TSharedRef< SWidget > InWidget, const FMenuEntryStyleParams &InStyleParams, FName InTutorialHighlightName=NAME_None, bool bInSearchable=true, FNewMenuDelegate InCustomMenuDelegate=FNewMenuDelegate(), TAttribute< EVisibility > InVisibilityOverride=TAttribute< EVisibility >(), const TAttribute< FMenuEntryResizeParams > &InResizeParams=TAttribute< FMenuEntryResizeParams >())
 

Friends

class UToolMenus
 

Additional Inherited Members

- 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

Tool bar builder

Constructor & Destructor Documentation

◆ FToolBarBuilder() [1/3]

FToolBarBuilder::FToolBarBuilder ( TSharedPtr< const FUICommandList InCommandList,
FMultiBoxCustomization  InCustomization,
TSharedPtr< FExtender InExtender,
EOrientation  Orientation,
const bool  InForceSmallIcons = false,
const bool  bUniform = false 
)
inline

◆ FToolBarBuilder() [2/3]

FToolBarBuilder::FToolBarBuilder ( TSharedPtr< const FUICommandList InCommandList,
FMultiBoxCustomization  InCustomization,
TSharedPtr< FExtender InExtender = nullptr,
const bool  InForceSmallIcons = false 
)
inline

Constructor

Parameters
InCommandListThe action list that maps command infos to delegates that should be called for each command associated with a multiblock widget

◆ FToolBarBuilder() [3/3]

FToolBarBuilder::FToolBarBuilder ( EMultiBoxType  InType,
TSharedPtr< const FUICommandList InCommandList,
FMultiBoxCustomization  InCustomization,
TSharedPtr< FExtender InExtender = TSharedPtr<FExtender>(),
const bool  InForceSmallIcons = false 
)
inlineprotected

Member Function Documentation

◆ AddComboButton()

void FToolBarBuilder::AddComboButton ( const FUIAction InAction,
const FOnGetContent InMenuContentGenerator,
const TAttribute< FText > &  InLabelOverride = TAttribute<FText>(),
const TAttribute< FText > &  InToolTipOverride = TAttribute<FText>(),
const TAttribute< FSlateIcon > &  InIconOverride = TAttribute<FSlateIcon>(),
bool  bInSimpleComboBox = false,
FName  InTutorialHighlightName = NAME_None,
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>(),
TAttribute< FText InToolbarLabelOverride = TAttribute<FText>(),
TAttribute< EMenuPlacement InPlacementOverride = TAttribute<EMenuPlacement>(),
const EUserInterfaceActionType  InUserInterfaceActionType = EUserInterfaceActionType::Button,
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Adds a combo button

Parameters
InActionUI action that sets the enabled state for this combo button
InMenuContentGeneratorDelegate that generates a widget for this combo button's menu content. Called when the menu is summoned.
InLabelOverrideOptional label override. If omitted, then the action's label will be used instead.
InToolTipOverrideOptional tool tip override. If omitted, then the action's label will be used instead.
InIconOverrideOptional icon to use for the tool bar image. If omitted, then the action's icon will be used instead.
bInSimpleComboBoxIf true, the icon and label won't be displayed
InTutorialHighlightNameName to identify this widget and highlight during tutorials
InVisibilityOverrideOptional visibility override which, if set and returning anything but Visible, overrides the visibility of the combo button.
InToolbarLabelOverrideOptional label override for when this block appears in a toolbar. If omitted, then the action's label will be used instead.
InPlacementOverrideOptional override placement to customize menu placement once opened via e.g. a toolbar menu button.
InUserInterfaceActionTypeOptional user interface action type to use if a command isn't bound. If a command is bound, we use the action type associated with the command instead.
InResizeParamsOptional resize parameters to control how this entry behaves during toolbar resizing.

◆ AddSeparator()

void FToolBarBuilder::AddSeparator ( FName  InExtensionHook = NAME_None,
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>(),
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Adds a toolbar separator

Parameters
InExtensionHookOptional extensibility hook.
InVisibilityOverrideOptional visibility override which, if set and returning anything but Visible, overrides the visibility of the separator.
InResizeParamsOptional resize parameters to control how this entry behaves during toolbar resizing.

◆ AddToolBarButton() [1/3]

void FToolBarBuilder::AddToolBarButton ( const FButtonArgs ButtonArgs)
virtual

Adds a tool bar button

Parameters
ButtonArgsThe Parameters object which will provide the data to initialize the button

Reimplemented in FSlimHorizontalUniformToolBarBuilder.

◆ AddToolBarButton() [2/3]

TSharedPtr< FToolBarButtonBlock > FToolBarBuilder::AddToolBarButton ( const FUIAction InAction,
FName  InExtensionHook = NAME_None,
const TAttribute< FText > &  InLabelOverride = TAttribute<FText>(),
const TAttribute< FText > &  InToolTipOverride = TAttribute<FText>(),
const TAttribute< FSlateIcon > &  InIconOverride = TAttribute<FSlateIcon>(),
const EUserInterfaceActionType  UserInterfaceActionType = EUserInterfaceActionType::Button,
FName  InTutorialHighlightName = NAME_None,
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>(),
TAttribute< FText InToolbarLabelOverride = TAttribute<FText>(),
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Adds a tool bar button

Parameters
InActionActions to execute on this menu item.
InExtensionHookThe section hook. Can be NAME_None.
InLabelOverrideOptional label override. If omitted, then the action's label will be used instead.
InToolTipOverrideOptional tool tip override. If omitted, then the action's label will be used instead.
InIconOverrideOptional icon to use for the tool bar image. If omitted, then the action's icon will be used instead.
UserInterfaceActionTypeType of interface action
InTutorialHighlightNameName to identify this widget and highlight during tutorials
InVisibilityOverrideOptional visibility override which, if set and returning anything but Visible, overrides the visibility of the toolbar button.
InToolbarLabelOverrideOptional label override for when this block appears in a toolbar. If omitted, then the action's label will be used instead.
InResizeParamsOptional resize parameters to control how this entry behaves during toolbar resizing.

◆ AddToolBarButton() [3/3]

TSharedPtr< FToolBarButtonBlock > FToolBarBuilder::AddToolBarButton ( const TSharedPtr< const FUICommandInfo InCommand,
FName  InExtensionHook = NAME_None,
const TAttribute< FText > &  InLabelOverride = TAttribute<FText>(),
const TAttribute< FText > &  InToolTipOverride = TAttribute<FText>(),
const TAttribute< FSlateIcon > &  InIconOverride = TAttribute<FSlateIcon>(),
FName  InTutorialHighlightName = NAME_None,
FNewMenuDelegate  InCustomMenuDelegate = FNewMenuDelegate(),
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>(),
TAttribute< FText InToolbarLabelOverride = TAttribute<FText>(),
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Adds a tool bar button

Parameters
InCommandThe command associated with this tool bar button
InExtensionHookThe section hook. Can be NAME_None.
InLabelOverrideOptional label override. If omitted, then the action's label will be used instead.
InToolTipOverrideOptional tool tip override. If omitted, then the action's label will be used instead.
InIconOverrideOptional name of the slate brush to use for the tool bar image. If omitted, then the action's icon will be used instead.
InTutorialHighlightNameName to identify this widget and highlight during tutorials
InCustomMenuDelegateOptional custom menu delegate for cases where the toolbar is compressed into a menu
InVisibilityOverrideOptional visibility override which, if set and returning anything but Visible, overrides the visibility of the toolbar button.
InToolbarLabelOverrideOptional label override for when this block appears in a toolbar. If omitted, then the action's label will be used instead.
InResizeParamsOptional resize parameters to control how this entry behaves during toolbar resizing.

◆ AddToolbarStackButton()

void FToolBarBuilder::AddToolbarStackButton ( const TSharedPtr< const FUICommandInfo InCommand,
FName  InTutorialHighlightName = NAME_None 
)

Adds a tool bar stack button

Parameters
InCommandThe command associated with this tool bar button
InTutorialHighlightNameName to identify this widget and highlight during tutorials

◆ AddToolBarWidget()

void FToolBarBuilder::AddToolBarWidget ( TSharedRef< SWidget InWidget,
const TAttribute< FText > &  InLabel = TAttribute<FText>(),
FName  InTutorialHighlightName = NAME_None,
bool  bInSearchable = true,
const TAttribute< FText > &  InToolTip = TAttribute<FText>() 
)

Adds any widget to the toolbar

Parameters
InWidgetThe widget that should be shown in the toolbar
InLabelOptional Label.
InTutorialHighlightNameName to identify this widget and highlight during tutorials
bInSearchableIf true, widget will be searchable (default == true)
InToolTipOptional tool tip

◆ AddWidget() [1/2]

void FToolBarBuilder::AddWidget ( TSharedRef< SWidget InWidget,
const FMenuEntryStyleParams InStyleParams,
FName  InTutorialHighlightName = NAME_None,
bool  bInSearchable = true,
FNewMenuDelegate  InCustomMenuDelegate = FNewMenuDelegate(),
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>(),
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Adds any widget to the toolbar

Parameters
InWidgetThe widget that should be shown in the toolbar
InStyleParamsStyle parameters for the widget inside the toolbar
InTutorialHighlightNameName to identify this widget and highlight during tutorials
bInSearchableIf true, widget will be searchable (default == true)
InCustomMenuDelegateOptional custom menu delegate for cases where the toolbar is compressed into a menu
InVisibilityOverrideOptional visibility override which, if set and returning anything but Visible, overrides the visibility of the widget.
InResizeParamsOptional resize parameters to control how this entry behaves during toolbar resizing.

◆ AddWidget() [2/2]

void FToolBarBuilder::AddWidget ( TSharedRef< SWidget InWidget,
FName  InTutorialHighlightName = NAME_None,
bool  bInSearchable = true,
EHorizontalAlignment  InAlignment = HAlign_Fill,
FNewMenuDelegate  InCustomMenuDelegate = FNewMenuDelegate(),
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>() 
)

Adds any widget to the toolbar

Parameters
InWidgetThe widget that should be shown in the toolbar
InTutorialHighlightNameName to identify this widget and highlight during tutorials
bInSearchableIf true, widget will be searchable (default == true)
InAlignmentHorizontal alignment for the widget inside the toolbar
InCustomMenuDelegateOptional custom menu delegate for cases where the toolbar is compressed into a menu
InVisibilityOverrideOptional visibility override which, if set and returning anything but Visible, overrides the visibility of the widget.

◆ AddWidgetInternal()

void FToolBarBuilder::AddWidgetInternal ( TSharedRef< SWidget InWidget,
const FMenuEntryStyleParams InStyleParams,
FName  InTutorialHighlightName = NAME_None,
bool  bInSearchable = true,
FNewMenuDelegate  InCustomMenuDelegate = FNewMenuDelegate(),
TAttribute< EVisibility InVisibilityOverride = TAttribute<EVisibility>(),
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)
protected

Handles AddWidget calls

◆ ApplyHook()

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

FMultiBoxBuilder interface

Implements FMultiBoxBuilder.

◆ ApplySectionBeginning()

void FToolBarBuilder::ApplySectionBeginning ( )
overrideprotectedvirtual

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

Reimplemented from FMultiBoxBuilder.

◆ BeginBlockGroup()

void FToolBarBuilder::BeginBlockGroup ( )

Starts a new Group block, must be used in conjunction with EndBlockGroup

◆ BeginSection()

void FToolBarBuilder::BeginSection ( FName  InExtensionHook,
bool  bInSectionShouldHaveSeparator = true,
const TAttribute< FMenuEntryResizeParams > &  InResizeParams = TAttribute<FMenuEntryResizeParams>() 
)

Starts a section on to the extender section hook stack

Parameters
InExtensionHookThe section hook. Can be NAME_None
bInSectionShouldHaveSeparatorWhether this section should have a separator to its left (this doesn't apply
InResizeParamsOptional resize parameters to control how this section behaves during toolbar resizing. Note that this currently only supports wrapping options. to the first section added, because that never gets a separator).

◆ BeginStyleOverride()

void FToolBarBuilder::BeginStyleOverride ( FName  StyleOverrideName)

Overrides the style being used by this toolbar with a different one for the The override will be used for any added blocks until EndStyleOverride is called

◆ EndBlockGroup()

void FToolBarBuilder::EndBlockGroup ( )

End a group block, must be used in conjunction with BeginBlockGroup.

◆ EndSection()

void FToolBarBuilder::EndSection ( )

Ends the current section

◆ EndStyleOverride()

void FToolBarBuilder::EndStyleOverride ( )

◆ InitializeToolBarButtonBlock()

void FToolBarBuilder::InitializeToolBarButtonBlock ( TSharedPtr< FToolBarButtonBlock ButtonRowBlock,
const FButtonArgs ButtonArgs 
)
protected

◆ SetAllowWrapButton()

void FToolBarBuilder::SetAllowWrapButton ( const TOptional< bool > &  bInAllowWrapButton) const

Whether to allow the wrap button/overflow menu, if applicable. Defaults to the style.

◆ SetIsFocusable()

void FToolBarBuilder::SetIsFocusable ( bool  bInIsFocusable)

◆ SetLabelVisibility()

void FToolBarBuilder::SetLabelVisibility ( EVisibility  InLabelVisibility)
inline

Friends And Related Symbol Documentation

◆ UToolMenus

friend class UToolMenus
friend

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