Navigation
API > API/Plugins > API/Plugins/CommonUI
Button that disables itself when not active. Also updates actions for CommonActionWidget if bound to display platform-specific icons.
| Name | UCommonButtonBase |
| Type | class |
| Header File | /Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Public/CommonButtonBase.h |
| Include Path | #include "CommonButtonBase.h" |
Syntax
UCLASS (Abstract, Blueprintable, MinimalAPI, ClassGroup=UI,
Meta=(Category="Common UI", DisableNativeTick))
class UCommonButtonBase : public UCommonUserWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UUserWidget → UCommonUserWidget → UCommonButtonBase
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UCommonButtonBase
(
const FObjectInitializer& ObjectInitializer |
CommonButtonBase.h |
Classes
| Name | Remarks |
|---|---|
| FCommonButtonEvent | |
| FOnIsSelectedChanged |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bNavigateToNextWidgetOnDisable | uint8 | If this button is currently in focus, and is disabled, hidden, or collapsed then focus will be routed to the next available widget | CommonButtonBase.h |
|
| bStyleNoLongerNeedsConversion | bool | Used to track widgets that were created before changing the default style pointer to null | CommonButtonBase.h | |
| ClickEvent | FWidgetEventField | CommonButtonBase.h |
|
|
| ClickMethod | TEnumAsByte< EButtonClickMethod::Type > | The type of mouse action required by the user to trigger the button's 'Click' | CommonButtonBase.h |
|
| InputPriority | int32 | This is the priority for the TriggeringInputAction. | CommonButtonBase.h |
|
| PressMethod | TEnumAsByte< EButtonPressMethod::Type > | CommonButtonBase.h |
|
|
| TouchMethod | TEnumAsByte< EButtonTouchMethod::Type > | CommonButtonBase.h |
|
|
| TriggeredInputAction | FDataTableRowHandle | The input action that can be visualized as well as triggered when the user clicks the button. | CommonButtonBase.h | |
| TriggeringEnhancedInputAction | TObjectPtr< UInputAction > | The enhanced input action that is bound to this button. | CommonButtonBase.h |
|
| TriggeringInputAction | FDataTableRowHandle | The input action that is bound to this button. | CommonButtonBase.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bButtonEnabled | uint8 | True if this button is currently enabled | CommonButtonBase.h | |
| bInteractionEnabled | uint8 | True if interaction with this button is currently enabled | CommonButtonBase.h | |
| bIsPersistentBinding | bool | DANGER! Be very, very careful with this. | CommonButtonBase.h |
|
| bSelected | uint8 | True if this button is currently selected | CommonButtonBase.h | |
| bStopDoubleClickPropagation | uint32 | CommonButtonBase.h |
|
|
| DisabledStyle | FButtonStyle | Internally managed and applied style to use when disabled | CommonButtonBase.h | |
| DisabledTooltipText | FText | CommonButtonBase.h | ||
| EnabledTooltipText | FText | CommonButtonBase.h | ||
| InputModeOverride | ECommonInputMode | Set this to Game for special cases where an input action needs to be set for an in-game button. | CommonButtonBase.h |
|
| LockedStyle | FButtonStyle | Internally managed and applied style to use when locked | CommonButtonBase.h | |
| NormalStyle | FButtonStyle | Internally managed and applied style to use when not selected | CommonButtonBase.h | |
| OnClickedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnDoubleClickedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnFocusLostEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnFocusReceivedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnHoveredEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnIsSelectedChangedEvent | FOnIsSelectedChanged | CommonButtonBase.h | ||
| OnLockClickedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnLockDoubleClickedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnPressedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnReleasedEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| OnUnhoveredEvent | FCommonButtonEvent | CommonButtonBase.h | ||
| RootButton | TWeakObjectPtr< class UCommonButtonInternalBase > | The actual UButton that we wrap this user widget into. | CommonButtonBase.h | |
| SelectedStyle | FButtonStyle | Internally managed and applied style to use when selected | CommonButtonBase.h | |
| SingleMaterialStyleMID | TObjectPtr< UMaterialInstanceDynamic > | The dynamic material instance of the material set by the single material style, if specified. | CommonButtonBase.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearSelection() |
CommonButtonBase.h |
|
|
void DisableButtonWithReason
(
const FText& DisabledReason |
Disables this button with a reason (use instead of SetIsEnabled) | CommonButtonBase.h |
|
void GetCurrentButtonPadding
(
FMargin& OutButtonPadding |
CommonButtonBase.h |
|
|
void GetCurrentCustomPadding
(
FMargin& OutCustomPadding |
CommonButtonBase.h |
|
|
UCommonTextStyle * GetCurrentTextStyle() |
CommonButtonBase.h |
|
|
TSubclassOf< UCommonTextStyle > GetCurrentTextStyleClass() |
CommonButtonBase.h |
|
|
UInputAction * GetEnhancedInputAction() |
Gets the appropriate enhanced input action that is set | CommonButtonBase.h |
|
bool GetInputAction
(
FDataTableRowHandle& InputActionRow |
Gets the appropriate input action that is set | CommonButtonBase.h |
|
bool GetIsFocusable() |
Gets the bIsFocusable flag | CommonButtonBase.h |
|
bool GetLocked() |
CommonButtonBase.h |
|
|
float GetRequiredHoldTime() |
Returns required hold time for performing a triggering action. | CommonButtonBase.h |
|
bool GetRequiresHold() |
Returns true if this button has a hold behavior, even if the triggering action is not holdable. | CommonButtonBase.h |
|
bool GetSelected() |
CommonButtonBase.h |
|
|
bool GetShouldSelectUponReceivingFocus() |
Get whether the button should become selected upon receiving focus or not | CommonButtonBase.h |
|
UMaterialInstanceDynamic * GetSingleMaterialStyleMID() |
Returns the dynamic instance of the material being used for this button, if it is using a single material style. | CommonButtonBase.h |
|
UCommonButtonStyle * GetStyle() |
@Returns Current button style | CommonButtonBase.h |
|
const UCommonButtonStyle * GetStyleCDO() |
CommonButtonBase.h | ||
bool IsInteractionEnabled() |
Is this button currently interactable? (use instead of GetIsEnabled) | CommonButtonBase.h |
|
bool IsPressed() |
Is this button currently pressed? | CommonButtonBase.h |
|
FCommonButtonEvent & OnClicked() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnDoubleClicked() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnFocusLost() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnFocusReceived() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnHovered() |
CommonButtonBase.h | ||
FOnIsSelectedChanged & OnIsSelectedChanged() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnLockClicked() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnLockDoubleClicked() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnPressed() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnReleased() |
CommonButtonBase.h | ||
FCommonButtonEvent & OnUnhovered() |
CommonButtonBase.h | ||
void SetClickedSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetClickMethod
(
EButtonClickMethod::Type InClickMethod |
Set the click method for mouse interaction | CommonButtonBase.h |
|
void SetHideInputAction
(
bool bInHideInputAction |
CommonButtonBase.h |
|
|
void SetHoveredSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetInputActionProgressMaterial
(
const FSlateBrush& InProgressMaterialBrush, |
CommonButtonBase.h |
|
|
void SetIsFocusable
(
bool bInIsFocusable |
Updates the bIsFocusable flag | CommonButtonBase.h |
|
void SetIsInteractableWhenSelected
(
bool bInInteractableWhenSelected |
Change whether this widget is selectable at all. If false and currently selected, will deselect. | CommonButtonBase.h |
|
void SetIsInteractionEnabled
(
bool bInIsInteractionEnabled |
Change whether this widget is selectable at all. If false and currently selected, will deselect. | CommonButtonBase.h |
|
void SetIsLocked
(
bool bInIsLocked |
Change whether this widget is locked. | CommonButtonBase.h |
|
void SetIsSelectable
(
bool bInIsSelectable |
Change whether this widget is selectable at all. If false and currently selected, will deselect. | CommonButtonBase.h |
|
void SetIsSelected
(
bool InSelected, |
Change the selected state manually. | CommonButtonBase.h |
|
void SetIsToggleable
(
bool bInIsToggleable |
Change whether this widget is toggleable. If toggleable, clicking when selected will deselect. | CommonButtonBase.h |
|
void SetLockedClickedSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetLockedHoveredSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetLockedPressedSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetMaxDimensions
(
int32 InMaxWidth, |
Sets the maximum dimensions of this button | CommonButtonBase.h |
|
void SetMinDimensions
(
int32 InMinWidth, |
Sets the minimum dimensions of this button | CommonButtonBase.h |
|
void SetPressedSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetPressMethod
(
EButtonPressMethod::Type InPressMethod |
Set the click method for keyboard/gamepad button press interaction | CommonButtonBase.h |
|
void SetRequiresHold
(
bool bInRequiresHold |
Change whether this button should have a hold behavior even if the triggering action is not holdable. | CommonButtonBase.h |
|
void SetSelectedClickedSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetSelectedHoveredSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetSelectedPressedSoundOverride
(
USoundBase* Sound |
CommonButtonBase.h |
|
|
void SetShouldSelectUponReceivingFocus
(
bool bInShouldSelectUponReceivingFocus |
Set whether the button should become selected upon receiving focus or not; Only settable for buttons that are selectable | CommonButtonBase.h |
|
void SetShouldUseFallbackDefaultInputAction
(
bool bInShouldUseFallbackDefaultInputAction |
Change whether this widget should use the fallback default input action. | CommonButtonBase.h |
|
void SetStyle
(
TSubclassOf< UCommonButtonStyle > InStyle |
Sets the style of this button, rebuilds the internal styling | CommonButtonBase.h |
|
void SetTouchMethod
(
EButtonTouchMethod::Type InTouchMethod |
Set the click method for touch interaction | CommonButtonBase.h |
|
void SetTriggeredInputAction
(
const FDataTableRowHandle& InputActionRow |
Updates the current triggered action | CommonButtonBase.h |
|
void SetTriggeringEnhancedInputAction
(
UInputAction* InInputAction |
Updates the current triggering enhanced input action, requires enhanced input enabled in CommonUI settings | CommonButtonBase.h |
|
void SetTriggeringInputAction
(
const FDataTableRowHandle& InputActionRow |
Updates the current triggering action | CommonButtonBase.h |
|
Overridden from UUserWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool Initialize() |
CommonButtonBase.h | ||
virtual void NativeConstruct() |
CommonButtonBase.h | ||
virtual void NativeDestruct() |
CommonButtonBase.h | ||
virtual bool NativeIsInteractable() |
CommonButtonBase.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsHovered() |
CommonButtonBase.h | ||
virtual void SetIsEnabled
(
bool bInIsEnabled |
CommonButtonBase.h | ||
virtual void SetVisibility
(
ESlateVisibility InVisibility |
CommonButtonBase.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BindInputMethodChangedDelegate() |
Helper function to bind to input method change events | CommonButtonBase.h | |
virtual void BindTriggeringInputActionToClick() |
Associates this button at its priority with the given key | CommonButtonBase.h | |
void BP_OnClicked() |
CommonButtonBase.h |
|
|
void BP_OnDeselected() |
CommonButtonBase.h |
|
|
void BP_OnDisabled() |
CommonButtonBase.h |
|
|
void BP_OnDoubleClicked() |
CommonButtonBase.h |
|
|
void BP_OnEnabled() |
CommonButtonBase.h |
|
|
void BP_OnFocusLost() |
CommonButtonBase.h |
|
|
void BP_OnFocusReceived() |
CommonButtonBase.h |
|
|
void BP_OnHovered() |
CommonButtonBase.h |
|
|
void BP_OnInputActionTriggered() |
CommonButtonBase.h |
|
|
void BP_OnInputMethodChanged
(
ECommonInputType CurrentInputType |
CommonButtonBase.h |
|
|
void BP_OnLockClicked() |
CommonButtonBase.h |
|
|
void BP_OnLockDoubleClicked() |
CommonButtonBase.h |
|
|
void BP_OnLockedChanged
(
bool bIsLocked |
CommonButtonBase.h |
|
|
void BP_OnPressed() |
CommonButtonBase.h |
|
|
void BP_OnReleased() |
CommonButtonBase.h |
|
|
void BP_OnRequiresHoldChanged() |
CommonButtonBase.h |
|
|
void BP_OnSelected() |
CommonButtonBase.h |
|
|
void BP_OnUnhovered() |
CommonButtonBase.h |
|
|
virtual UCommonButtonInternalBase * ConstructInternalButton() |
CommonButtonBase.h | ||
virtual void ExecuteTriggeredInput() |
@TODO: DarenC - API decision, consider removing | CommonButtonBase.h | |
virtual bool GetButtonAnalyticInfo
(
FString& ButtonName, |
CommonButtonBase.h | ||
virtual bool GetConvertInputActionToHold () |
By default, if bRequiresHold is true, the bound Input Action will be forced to require hold as well. | CommonButtonBase.h | |
ECommonInputMode GetInputModeOverride() |
CommonButtonBase.h | ||
virtual void HandleButtonClicked() |
Handler function registered to the underlying button's click. | CommonButtonBase.h | |
virtual FReply HandleButtonDoubleClicked() |
Handler function registered to the underlying button's double click. | CommonButtonBase.h | |
virtual void HandleButtonPressed() |
Helper function registered to the underlying button when pressed | CommonButtonBase.h | |
virtual void HandleButtonReleased() |
Helper function registered to the underlying button when released | CommonButtonBase.h | |
virtual void HandleFocusLost() |
Helper function registered to the underlying button losing focus | CommonButtonBase.h | |
virtual void HandleFocusReceived() |
Helper function registered to the underlying button receiving focus | CommonButtonBase.h | |
virtual void HandleTriggeringActionCommited () |
CommonButtonBase.h | ||
virtual void HandleTriggeringActionCommited
(
bool& bPassthrough |
CommonButtonBase.h | ||
virtual void HoldReset() |
CommonButtonBase.h | ||
bool IsPersistentBinding() |
CommonButtonBase.h | ||
virtual void NativeOnActionComplete() |
CommonButtonBase.h | ||
virtual void NativeOnActionProgress
(
float HeldPercent |
Bound to the hold progress of the bound key from the input action | CommonButtonBase.h | |
virtual void NativeOnClicked() |
CommonButtonBase.h |
|
|
virtual void NativeOnCurrentTextStyleChanged() |
CommonButtonBase.h |
|
|
virtual void NativeOnDeselected
(
bool bBroadcast |
CommonButtonBase.h |
|
|
virtual void NativeOnDisabled() |
CommonButtonBase.h |
|
|
virtual void NativeOnDoubleClicked() |
CommonButtonBase.h |
|
|
virtual void NativeOnEnabled() |
CommonButtonBase.h |
|
|
virtual bool NativeOnHoldProgress
(
float DeltaTime |
Bound to the hold progress not related to the bound key | CommonButtonBase.h | |
virtual bool NativeOnHoldProgressRollback
(
float DeltaTime |
Bound to the hold progress rollback not related to the bound key | CommonButtonBase.h | |
virtual void NativeOnHovered() |
CommonButtonBase.h |
|
|
virtual void NativeOnPressed() |
CommonButtonBase.h |
|
|
virtual void NativeOnReleased() |
CommonButtonBase.h |
|
|
virtual void NativeOnSelected
(
bool bBroadcast |
CommonButtonBase.h |
|
|
virtual void NativeOnUnhovered() |
CommonButtonBase.h |
|
|
void OnActionComplete() |
Callback fired when hold events complete | CommonButtonBase.h |
|
void OnActionProgress
(
float HeldPercent |
Callback fired continously during hold interactions | CommonButtonBase.h |
|
void OnCurrentTextStyleChanged() |
Allows derived classes to take action when the current text style has changed | CommonButtonBase.h |
|
virtual void OnInputMethodChanged
(
ECommonInputType CurrentInputType |
Called via delegate when the input method changes | CommonButtonBase.h | |
void OnTriggeredInputActionChanged
(
const FDataTableRowHandle& NewTriggeredAction |
Callback fired when input action datatable row changes | CommonButtonBase.h |
|
void OnTriggeringEnhancedInputActionChanged
(
const UInputAction* InInputAction |
Callback fired when enhanced input action changes | CommonButtonBase.h |
|
void OnTriggeringInputActionChanged
(
const FDataTableRowHandle& NewTriggeredAction |
Callback fired when triggered input action datatable row changes | CommonButtonBase.h |
|
void RefreshDimensions() |
CommonButtonBase.h | ||
void SetClickedSlateSoundOverride
(
const FSlateSound& InClickedSlateSoundOverride |
CommonButtonBase.h | ||
void SetHoveredSlateSoundOverride
(
const FSlateSound& InHoveredSlateSoundOverride |
CommonButtonBase.h | ||
void SetLockedClickedSlateSoundOverride
(
const FSlateSound& InLockedClickedSlateSoundOverride |
CommonButtonBase.h | ||
void SetLockedHoveredSlateSoundOverride
(
const FSlateSound& InLockedHoveredSlateSoundOverride |
CommonButtonBase.h | ||
void SetLockedPressedSlateSoundOverride
(
const FSlateSound& InLockedPressedSlateSoundOverride |
CommonButtonBase.h | ||
void SetPressedSlateSoundOverride
(
const FSlateSound& InPressedSlateSoundOverride |
In some scenarios, USoundBase* setters are bypassed, so standard setters must also be provided for sound override properties. | CommonButtonBase.h | |
void SetSelectedClickedSlateSoundOverride
(
const FSlateSound& InSelectedClickedSlateSoundOverride |
CommonButtonBase.h | ||
void SetSelectedHoveredSlateSoundOverride
(
const FSlateSound& InSelectedHoveredSlateSoundOverride |
CommonButtonBase.h | ||
void SetSelectedInternal
(
bool bInSelected, |
Internal method to allow the selected state to be set regardless of selectability or toggleability | CommonButtonBase.h |
|
void SetSelectedPressedSlateSoundOverride
(
const FSlateSound& InSelectedPressedSlateSoundOverride |
CommonButtonBase.h | ||
bool ShouldProcessHoverEvent
(
EHoverEventSource HoverReason |
This should be used as a check before calling NativeOnHovered and NativeOnUnhovered. | CommonButtonBase.h | |
void StopDoubleClickPropagation() |
Unless this is called, we will assume the double click should be converted into a normal click. | CommonButtonBase.h |
|
virtual void UnbindInputMethodChangedDelegate() |
Helper function to unbind from input method change events | CommonButtonBase.h | |
virtual void UnbindTriggeringInputActionToClick() |
Associates this button at its priority with the given key | CommonButtonBase.h | |
virtual void UpdateHoldData
(
ECommonInputType CurrentInputType |
If HoldData is valid, assigns its values to Keyboard and Mouse, Gamepad and Touch, based off the Current Input Type. | CommonButtonBase.h | |
virtual void UpdateInputActionWidget() |
Helper function to update the associated input action widget, if any, based upon the state of the button | CommonButtonBase.h | |
void UpdateInputActionWidgetVisibility() |
CommonButtonBase.h |
Overridden from UUserWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FReply NativeOnFocusReceived
(
const FGeometry& InGeometry, |
CommonButtonBase.h | ||
virtual void NativeOnMouseEnter
(
const FGeometry& InGeometry, |
CommonButtonBase.h | ||
virtual void NativeOnMouseLeave
(
const FPointerEvent& InMouseEvent |
CommonButtonBase.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FText GetPaletteCategory() |
CommonButtonBase.h | ||
virtual void OnCreationFromPalette() |
CommonButtonBase.h | ||
virtual void OnWidgetRebuilt() |
CommonButtonBase.h | ||
virtual void SynchronizeProperties() |
CommonButtonBase.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostLoad() |
CommonButtonBase.h |