Skip to content

Custom menus

This section describes how to build custom editor menus.

FUICommandsList

+MapAction(FUICommandInfo*, FExecuteAction, FCanExecuteAction)

+Append(FUICommandList&)

+UnmapAction(FUICommandInfo*)

+IsActionMapped(FUICommandInfo*) : bool

+ExecuteAction(FUICommandInfo*) : bool

+CanExecuteAction(FUICommandInfo*) : bool

FBindingContext

+FBindingContext(ContextName, Description, FName Parent, FName StyleSet)

NewCommand(CommandName, CommandLabel, CommandDescription) : FUICommandInfoDecl

TCommands<FCommandsClass>

+Register() static, calls FCommandsClass RegisterCommands(CRTP)

+Unregsiter()

FCommandsClass

-FUICommandInfo* CommandAInfo;

-FUICommandInfo* CommandBInfo;

+RegisterCommands() : ;

FUICommandInfo

-FText Label

-FText Description

-TArray<...> Chords

-FSlateIcon Icon

-FName BindingContext

-FName Bundle

+MakeCommandInfo(...Args) : static

FUICommandsList

+MapAction(FUICommandInfo*, FExecuteAction, FCanExecuteAction)

+Append(FUICommandList&)

+UnmapAction(FUICommandInfo*)

+IsActionMapped(FUICommandInfo*) : bool

+ExecuteAction(FUICommandInfo*) : bool

+CanExecuteAction(FUICommandInfo*) : bool

FBindingContext

+FBindingContext(ContextName, Description, FName Parent, FName StyleSet)

NewCommand(CommandName, CommandLabel, CommandDescription) : FUICommandInfoDecl

TCommands<FCommandsClass>

+Register() static, calls FCommandsClass RegisterCommands(CRTP)

+Unregsiter()

FCommandsClass

-FUICommandInfo* CommandAInfo;

-FUICommandInfo* CommandBInfo;

+RegisterCommands() : ;

FUICommandInfo

-FText Label

-FText Description

-TArray<...> Chords

-FSlateIcon Icon

-FName BindingContext

-FName Bundle

+MakeCommandInfo(...Args) : static



  • FUICommandInfo contains meta about the command such as its name and description, what key combinations (chords) are valid for it etc. FUICommandInfo can be created with its static method MakeCommandInfo or with the UI_COMMAND macro
  • TCommands<FCommandsClass> is a manager for FCommandsClass, it will create and keep a singleton of FCommandsClass
  • an FCommandsClass is usually just a singleton container (managed by TCommand via CRTP) having the FUICommandInfo* command infos, they are populated in RegisterCommands() either with FUICommandInfo::MakeCommandInfo() or with the UI_COMMAND macro