UCommonButtonBase

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

CommonUI

Header

/Engine/Plugins/Experimental/CommonUI/Source/CommonUI/Public/CommonButtonBase.h

Include

#include "CommonButtonBase.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Abstract, Blueprintable, ClassGroup=UI, Meta=(Category="Common UI", DisableNativeTick))
class UCommonButtonBase : public UCommonUserWidget

Variables

Name Description

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bApplyAlphaOnDisable

The type of mouse action required by the user to trigger the button's 'Click'

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bDisplayInputActionWhenNotInteractable

True if the input action should be displayed when the button is not interactable

Protected variable UProperty Category, EditAnywhere BlueprintReadOnly

bool

 

bHideInputAction

Whether to hide the input action widget at all times (useful for textless small buttons)

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bHideInputActionWithKeyboard

True if the input action should be hidden while the user is using a keyboard

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bInteractableWhenSelected

If true, the button may be clicked while selected.

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bSelectable

True if the button supports being in a "selected" state, which will update the style accordingly

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bShouldSelectUponReceivingFocus

If true, the button will be selected when it receives focus.

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bShouldUseFallbackDefaultInputAction

True if this button should use the default fallback input action (bool is useful for buttons that shouldn't because they are never directly hit via controller)

Public variable UProperty

bool

 

bStyleNoLongerNeedsConversion

Used to track widgets that were created before changing the default style pointer to null

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

uint8: 1

 

bToggleable

True if the button can be deselected by clicking it when selected

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

TEnumAsByte< EB...

 

ClickMethod

The type of mouse action required by the user to trigger the button's 'Click'

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

FSlateSound

 

HoveredSlateSoundOverride

Optional override for the sound to play when this button is hovered

Protected variable

UCommonActionWi...

 

InputActionWidget

Optionally bound widget for visualization behavior of an input action;

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

InputPriority

This is the priority for the TriggeringInputAction.

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

MinHeight

The minimum height of the button (only used if greater than the style's minimum)

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

int32

 

MinWidth

The minimum width of the button (only used if greater than the style's minimum)

Protected variable UProperty Category, Meta BlueprintAssignable

FCommonButtonBa...

 

OnButtonBaseClicked

Protected variable UProperty Category, Meta BlueprintAssignable

FCommonButtonBa...

 

OnButtonBaseDoubleClicked

Protected variable UProperty Category, Meta BlueprintAssignable

FCommonButtonBa...

 

OnButtonBaseHovered

Protected variable UProperty Category, Meta BlueprintAssignable

FCommonButtonBa...

 

OnButtonBaseUnhovered

Protected variable UProperty Category, Meta BlueprintAssignable

FCommonSelected...

 

OnSelectedChangedBase

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

FSlateSound

 

PressedSlateSoundOverride

Optional override for the sound to play when this button is pressed

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< EB...

 

PressMethod

Protected variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

TSubclassOf< UC...

 

Style

References the button style asset that defines a style in multiple sizes

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TEnumAsByte< EB...

 

TouchMethod

Public variable

FDataTableRowHa...

 

TriggeredInputAction

The input action that can be visualized as well as triggered when the user clicks the button.

Protected variable

FUIActionBindin...

 

TriggeringBindingHandle

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

FDataTableRowHa...

 

TriggeringInputAction

The input action that is bound to this button.

Constructors

Name Description

Public function

UCommonButtonBase

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function Virtual

void

 

BindInputMethodChangedDelegate()

Helper function to bind to input method change events

Protected function Virtual

void

 

BindTriggeringInputActionToClick()

Associates this button at its priority with the given key

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnClicked()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnDeselected()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnDisabled()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnDoubleClicked()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnEnabled()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnHovered()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnSelected()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

BP_OnUnhovered()

Public function UFunction BlueprintCallable, Category

void

 

ClearSelection()

Protected function Virtual

UCommonButto...

 

ConstructInternalButton()

Public function UFunction BlueprintCallable, Category

void

 

DisableButtonWithReason

(
    const FText& DisabledReason
)

Disables this button with a reason (use instead of SetIsEnabled)

Protected function Virtual

void

 

ExecuteTriggeredInput()

Protected function Virtual Const

bool

 

GetButtonAnalyticInfo

(
    FString& ButtonName,
    FString& ABTestName,
    FString& ExtraData
)

Public function Const UFunction BlueprintCallable, Category

void

 

GetCurrentButtonPadding

(
    FMargin& OutButtonPadding
)

Public function Const UFunction BlueprintCallable, Category

void

 

GetCurrentCustomPadding

(
    FMargin& OutCustomPadding
)

Public function Const UFunction BlueprintCallable, Category

UCommonTextS...

 

GetCurrentTextStyle()

Public function Const UFunction BlueprintCallable, Category

TSubclassOf<...

 

GetCurrentTextStyleClass()

Public function Const UFunction BlueprintCallable, Category

bool

 

GetInputAction

(
    FDataTableRowHandle& InputActionRo...
)

Gets the appropriate input action that is set

Public function Const UFunction BlueprintCallable, Category

bool

 

GetIsFocusable()

Gets the bIsFocusable flag

Public function Const UFunction BlueprintCallable, Category

bool

 

GetSelected()

Public function Const UFunction BlueprintCallable, Category

bool

 

GetShouldSelectUponReceivingFocus()

Get whether the button should become selected upon receiving focus or not

Public function Const UFunction BlueprintCallable, BlueprintPure, Category

UMaterialIns...

 

GetSingleMaterialStyleMID()

Returns the dynamic instance of the material being used for this button, if it is using a single material style.

Public function Const UFunction BlueprintCallable, Category

UCommonButto...

 

GetStyle()

Current button style

Public function Const

const UCommo...

 

GetStyleCDO()

Protected function UFunction

void

 

HandleButtonClicked()

Handler function registered to the underlying button's click.

Protected function

FReply

 

HandleButtonDoubleClicked()

Handler function registered to the underlying button's double click.

Protected function UFunction

void

 

HandleButtonPressed()

Helper function registered to the underlying button when pressed

Protected function UFunction

void

 

HandleButtonReleased()

Helper function registered to the underlying button when released

Protected function Virtual UFunction

void

 

HandleFocusReceived()

Helper function registered to the underlying button receiving focus

Protected function Virtual UFunction

void

 

HandleTriggeringActionCommited

(
    bool& bPassthrough
)

Public function Const UFunction BlueprintCallable, Category

bool

 

IsInteractionEnabled()

Is this button currently interactable? (use instead of GetIsEnabled)

Public function Const UFunction BlueprintCallable, Category

bool

 

IsPressed()

Is this button currently pressed?

Protected function Virtual UFunction

void

 

NativeOnActionComplete()

Protected function Virtual UFunction

void

 

NativeOnActionProgress

(
    float HeldPercent
)

Protected function Virtual

void

 

NativeOnClicked()

Protected function Virtual

void

 

NativeOnCurrentTextStyleChanged()

Allows derived classes to take action when the current text style has changed

Protected function Virtual

void

 

NativeOnDeselected

(
    bool bBroadcast
)

Protected function Virtual

void

 

NativeOnDisabled()

Protected function Virtual

void

 

NativeOnDoubleClicked()

Protected function Virtual

void

 

NativeOnEnabled()

Protected function Virtual

void

 

NativeOnHovered()

Protected function Virtual

void

 

NativeOnSelected

(
    bool bBroadcast
)

Protected function Virtual

void

 

NativeOnUnhovered()

Protected function UFunction Category, BlueprintImplementableEvent

void

 

OnActionComplete()

Protected function UFunction Category, BlueprintImplementableEvent

void

 

OnActionProgress

(
    float HeldPercent
)

Public function Const

FCommonButto...

 

OnClicked()

Protected function UFunction Category, Meta, BlueprintImplementableEvent

void

 

OnCurrentTextStyleChanged()

Allows derived classes to take action when the current text style has changed

Public function Const

FCommonButto...

 

OnDoubleClicked()

Public function Const

FCommonButto...

 

OnFocusReceived()

Public function Const

FCommonButto...

 

OnHovered()

Protected function Virtual UFunction

void

 

OnInputMethodChanged

(
    ECommonInputType CurrentInputType
)

Called via delegate when the input method changes

Public function Const

FOnIsSelecte...

 

OnIsSelectedChanged()

Protected function UFunction Category, BlueprintImplementableEvent

void

 

OnTriggeredInputActionChanged

(
    const FDataTableRowHandle& NewTrig...
)

Public function Const

FCommonButto...

 

OnUnhovered()

Protected function

void

 

RefreshDimensions()

Public function UFunction BlueprintCallable, Category

void

 

SetClickMethod

(
    EButtonClickMethod::Type InClickMet...
)

Set the click method for mouse interaction

Public function UFunction BlueprintCallable, Category

void

 

SetHoveredSoundOverride

(
    USoundBase* Sound
)

Public function UFunction BlueprintCallable, Category

void

 

SetInputActionProgressMaterial

(
    const FSlateBrush& InProgressMater...,
    const FName& InProgressMaterialPar...
)

Public function UFunction BlueprintCallable, Category

void

 

SetIsFocusable

(
    bool bInIsFocusable
)

Updates the bIsFocusable flag

Public function UFunction BlueprintCallable, Category

void

 

SetIsInteractableWhenSelected

(
    bool bInInteractableWhenSelected
)

Change whether this widget is selectable at all. If false and currently selected, will deselect.

Public function UFunction BlueprintCallable, Category

void

 

SetIsInteractionEnabled

(
    bool bInIsInteractionEnabled
)

Change whether this widget is selectable at all. If false and currently selected, will deselect.

Public function UFunction BlueprintCallable, Category

void

 

SetIsSelectable

(
    bool bInIsSelectable
)

Change whether this widget is selectable at all. If false and currently selected, will deselect.

Public function UFunction BlueprintCallable, Category

void

 

SetIsSelected

(
    bool InSelected,
    bool bGiveClickFeedback
)

Change the selected state manually.

Public function UFunction BlueprintCallable, Category

void

 

SetIsToggleable

(
    bool bInIsToggleable
)

Change whether this widget is toggleable. If toggleable, clicking when selected will deselect.

Public function UFunction BlueprintCallable, Category

void

 

SetMinDimensions

(
    int32 InMinWidth,
    int32 InMinHeight
)

Sets the minimum dimensions of this button

Public function UFunction BlueprintCallable, Category

void

 

SetPressedSoundOverride

(
    USoundBase* Sound
)

Public function UFunction BlueprintCallable, Category

void

 

SetPressMethod

(
    EButtonPressMethod::Type InPressMet...
)

Set the click method for keyboard/gamepad button press interaction

Protected function UFunction BlueprintCallable, Category, Meta

void

 

SetSelectedInternal

(
    bool bInSelected,
    bool bAllowSound,
    bool bBroadcast
)

Internal method to allow the selected state to be set regardless of selectability or toggleability

Public function UFunction BlueprintCallable, Category

void

 

SetShouldSelectUponReceivingFocus

(
    bool bInShouldSelectUponReceivingFo...
)

Set whether the button should become selected upon receiving focus or not; Only settable for buttons that are selectable

Public function UFunction BlueprintCallable, Category

void

 

SetShouldUseFallbackDefaultInputAction

(
    bool bInShouldUseFallbackDefaultInp...
)

Change whether this widget should use the fallback default input action.

Public function UFunction BlueprintCallable, Category

void

 

SetStyle

(
    TSubclassOf< UCommonButtonStyle > I...
)

Sets the style of this button, rebuilds the internal styling

Public function UFunction BlueprintCallable, Category

void

 

SetTouchMethod

(
    EButtonTouchMethod::Type InTouchMet...
)

Set the click method for touch interaction

Public function UFunction BlueprintCallable, Category

void

 

SetTriggeredInputAction

(
    const FDataTableRowHandle& InputAc...
)

Updates the current triggered action

Public function UFunction BlueprintCallable, Category

void

 

SetTriggeringInputAction

(
    const FDataTableRowHandle& InputAc...
)

Updates the current triggering action

Protected function UFunction BlueprintCallable, Category

void

 

StopDoubleClickPropagation()

Unless this is called, we will assume the double click should be converted into a normal click.

Protected function Virtual

void

 

UnbindInputMethodChangedDelegate()

Helper function to unbind from input method change events

Protected function Virtual

void

 

UnbindTriggeringInputActionToClick()

Associates this button at its priority with the given key

Protected function Virtual

void

 

UpdateInputActionWidget()

Helper function to update the associated input action widget, if any, based upon the state of the button

Overridden from UUserWidget

Name Description

Public function Virtual

bool

 

Initialize()

Public function Virtual

void

 

NativeConstruct()

Public function Virtual

void

 

NativeDestruct()

Public function Virtual Const

bool

 

NativeIsInteractable()

Protected function Virtual

FReply

 

NativeOnFocusReceived

(
    const FGeometry& InGeometry,
    const FFocusEvent& InFocusEvent
)

Protected function Virtual

void

 

NativeOnMouseEnter

(
    const FGeometry& InGeometry,
    const FPointerEvent& InMouseEvent
)

Protected function Virtual

void

 

NativeOnMouseLeave

(
    const FPointerEvent& InMouseEvent
)

Overridden from UWidget

Name Description

Protected function Virtual

const FText

 

GetPaletteCategory()

Gets the palette category of the widget

Public function Virtual Const

bool

 

IsHovered()

Returns true if the widget is currently being hovered by a pointer device

Protected function Virtual

void

 

OnCreationFromPalette()

Called by the palette after constructing a new widget, allows the widget to perform interesting default setup that we don't want to be UObject Defaults.

Protected function Virtual

void

 

OnWidgetRebuilt()

Function called after the underlying SWidget is constructed.

Public function Virtual

void

 

SetIsEnabled

(
    bool bInIsEnabled
)

Sets the current enabled status of the widget

Protected function Virtual

void

 

SynchronizeProperties()

Applies all properties to the native widget if possible.

Overridden from UObject

Name Description

Protected function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Classes

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss