UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TCommands< CommandContextType > Class Template Referenceabstract

#include <Commands.h>

+ Inheritance diagram for TCommands< CommandContextType >:

Static Public Member Functions

static void Register ()
 
static bool IsRegistered ()
 
static CommandContextTypeGet ()
 
static void Unregister ()
 
static const FBindingContextGetContext ()
 

Protected Member Functions

 TCommands (const FName InContextName, const FText &InContextDesc, const FName InContextParent, const FName InStyleSetName)
 
virtual ~TCommands ()
 
virtual void RegisterCommands ()=0
 
- Protected Member Functions inherited from TSharedFromThis< FBindingContext >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Static Protected Member Functions

static TWeakPtr< CommandContextType > & GetInstance ()
 
- Static Protected Member Functions inherited from TSharedFromThis< FBindingContext >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Additional Inherited Members

- Public Member Functions inherited from FBindingContext
 FBindingContext (const FName InContextName, const FText &InContextDesc, const FName InContextParent, const FName InStyleSetName)
 
 FBindingContext (const FBindingContext &)=default
 
 FBindingContext (FBindingContext &&)=default
 
FBindingContextoperator= (const FBindingContext &)=default
 
FBindingContextoperator= (FBindingContext &&)=default
 
SLATE_API FUICommandInfoDecl NewCommand (const FName InCommandName, const FText &InCommandLabel, const FText &InCommandDesc)
 
FName GetContextName () const
 
FName GetContextParent () const
 
FName GetStyleSetName () const
 
const FTextGetContextDesc () const
 
SLATE_API void AddBundle (const FName Name, const FText &Desc)
 
SLATE_API const FTextGetBundleLabel (const FName Name)
 
bool operator== (const FBindingContext &Other) const
 
- Public Member Functions inherited from TSharedFromThis< FBindingContext >
TSharedRef< FBindingContext, Mode > AsShared ()
 
TSharedRef< FBindingContext const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FBindingContext, Mode > AsWeak ()
 
TWeakPtr< FBindingContext const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 
- Static Public Attributes inherited from FBindingContext
static SLATE_API FOnBindingContextChanged CommandsChanged
 

Detailed Description

template<typename CommandContextType>
class TCommands< CommandContextType >

A base class for a set of commands. Inherit from it to make a set of commands. See MainFrameActions for an example.

Constructor & Destructor Documentation

◆ TCommands()

TCommands< CommandContextType >::TCommands ( const FName  InContextName,
const FText InContextDesc,
const FName  InContextParent,
const FName  InStyleSetName 
)
inlineprotected

Construct a set of commands; call this from your custom commands class.

◆ ~TCommands()

virtual TCommands< CommandContextType >::~TCommands ( )
inlineprotectedvirtual

Member Function Documentation

◆ Get()

Get the singleton instance of this set of commands.

◆ GetContext()

static const FBindingContext & TCommands< CommandContextType >::GetContext ( )
inlinestatic

Get the BindingContext for this set of commands.

◆ GetInstance()

static TWeakPtr< CommandContextType > & TCommands< CommandContextType >::GetInstance ( )
inlinestaticprotected

A static instance of the command set.

◆ IsRegistered()

static bool TCommands< CommandContextType >::IsRegistered ( )
inlinestatic

◆ Register()

static void TCommands< CommandContextType >::Register ( )
inlinestatic

Use this method to register commands. Usually done in StartupModule().

◆ RegisterCommands()

virtual void TCommands< CommandContextType >::RegisterCommands ( )
protectedpure virtual

Pure virtual to override; describe and instantiate the commands in here by using the UI COMMAND macro.

Implemented in FMultiBoxTestCommandList, FMacMenuCommands, FGenericCommands, and FTabCommands.

◆ Unregister()

static void TCommands< CommandContextType >::Unregister ( )
inlinestatic

Use this method to clean up any resources used by the command set. Usually done in ShutdownModule()


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