Navigation
API > API/Plugins > API/Plugins/CommonUI
The base for widgets that are capable of being "activated" and "deactivated" during their lifetime without being otherwise modified or destroyed.
This is generally desired for one or more of the following purposes:
- This widget can turn on/off without being removed from the hierarchy (or otherwise reconstructing the underlying SWidgets), so Construct/Destruct are insufficient
- You'd like to be able to "go back" from this widget, whether that means back a breadcrumb, closing a modal, or something else. This is built-in here.
- This widget's place in the hierarchy is such that it defines a meaningful node-point in the tree of activatable widgets through which input is routed to all widgets.
By default, an activatable widget:
- Is not automatically activated upon construction
- Does not register to receive back actions (or any other actions, for that matter)
- If classified as a back handler, is automatically deactivated (but not destroyed) when it receives a back action
Note that removing an activatable widget from the UI (i.e. triggering Destruct()) will always deactivate it, even if the UWidget is not destroyed. Re-constructing the underlying SWidget will only result in re-activation if auto-activate is enabled.
| Name | UCommonActivatableWidget |
| Type | class |
| Header File | /Engine/Plugins/Runtime/CommonUI/Source/CommonUI/Public/CommonActivatableWidget.h |
| Include Path | #include "CommonActivatableWidget.h" |
Syntax
UCLASS (MinimalAPI, Meta=(DisableNativeTick))
class UCommonActivatableWidget : public UCommonUserWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UUserWidget → UCommonUserWidget → UCommonActivatableWidget
Implements Interfaces
Derived Classes
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FActivatableWidgetRebuildEvent | TMulticastDelegate_OneParam< void, UCommonActivatableWidget & > | CommonActivatableWidget.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| OnRebuilding | FActivatableWidgetRebuildEvent | CommonActivatableWidget.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActivatedBindVisibility | ESlateVisibility | Visibility to use when widgets we are bound to are activated | CommonActivatableWidget.h | |
| bAllActive | bool | True if we should switch to activated visibility only when all bound widgets are active | CommonActivatableWidget.h | |
| bIsActive | bool | CommonActivatableWidget.h |
|
|
| BP_OnWidgetActivated | FOnWidgetActivationChanged | Fires when the widget is activated. | CommonActivatableWidget.h |
|
| BP_OnWidgetDeactivated | FOnWidgetActivationChanged | Fires when the widget is deactivated. | CommonActivatableWidget.h |
|
| CalculatedActionDomainCache | TOptional< TSoftObjectPtr< UCommonInputActionDomain > > | CommonActivatableWidget.h | ||
| DeactivatedBindVisibility | ESlateVisibility | Visibility to use when widgets we are bound to are deactivated, not used if widget has activation / deactivation visibilities | CommonActivatableWidget.h | |
| DefaultBackActionHandle | FUIActionBindingHandle | Handle to default back action, if bound | CommonActivatableWidget.h | |
| InputTreeNode | TWeakPtr< FActivatableTreeNode > | Input tree node referencing this widget | CommonActivatableWidget.h | |
| OnActivatedEvent | FSimpleMulticastDelegate | CommonActivatableWidget.h | ||
| OnDeactivatedEvent | FSimpleMulticastDelegate | CommonActivatableWidget.h | ||
| OnRequestRefreshFocusEvent | FSimpleMulticastDelegate | CommonActivatableWidget.h | ||
| OnSlateReleasedEvent | FSimpleMulticastDelegate | CommonActivatableWidget.h | ||
| VisibilityBoundWidgets | TArray< TWeakObjectPtr< UCommonActivatableWidget > > | List of widgets whose collective activation controls our visibility. | CommonActivatableWidget.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ActivateWidget() |
CommonActivatableWidget.h |
|
|
bool AutoRestoresFocus() |
CommonActivatableWidget.h | ||
void BindVisibilityToActivation
(
UCommonActivatableWidget* ActivatableWidget |
Bind our visibility to the activation of another widget, useful for making mouse collisions behave similiar to console navigation w.r.t activation Will immediately update visibility based on the bound widget activation & visibilites set by SetBindVisibilities. | CommonActivatableWidget.h |
|
void ClearActiveHoldInputs() |
CommonActivatableWidget.h | ||
void ClearFocusRestorationTarget() |
Clears the cached focus target that's set when bAutoRestoreFocus is true | CommonActivatableWidget.h |
|
void DeactivateWidget() |
CommonActivatableWidget.h |
|
|
virtual TOptional< FActivationMetadata > GetActivationMetadata () |
Gets custom game-specific activation metadata for this widget. | CommonActivatableWidget.h | |
TObjectPtr< UCommonInputActionDomain > GetCalculatedActionDomain() |
Returns the widget's ActionDomain, respecting any inheritance requirements. | CommonActivatableWidget.h | |
UWidget * GetDesiredFocusTarget() |
Returns the desired widget to focus when this Widget Activates. | CommonActivatableWidget.h |
|
virtual TOptional< FUIInputConfig > GetDesiredInputConfig () |
Gets the desired input configuration to establish when this widget activates and can receive input (i.e. all parents are also active). | CommonActivatableWidget.h | |
TWeakPtr< FActivatableTreeNode > GetInputTreeNode() |
CommonActivatableWidget.h | ||
bool IsActivated() |
CommonActivatableWidget.h |
|
|
bool IsModal() |
CommonActivatableWidget.h | ||
FSimpleMulticastDelegate & OnActivated() |
CommonActivatableWidget.h | ||
FSimpleMulticastDelegate & OnDeactivated() |
CommonActivatableWidget.h | ||
FSimpleMulticastDelegate & OnRequestRefreshFocus() |
CommonActivatableWidget.h | ||
FSimpleMulticastDelegate & OnSlateReleased() |
CommonActivatableWidget.h | ||
void RegisterInputTreeNode
(
const TSharedPtr< FActivatableTreeNode >& OwnerNode |
CommonActivatableWidget.h | ||
void ResetCalculatedActionDomainCache() |
Reset the Action Domain cached by GetCalculatedActionDomain() Call this when updating this widget or a parent widget's action domain | CommonActivatableWidget.h | |
void SetBindVisibilities
(
ESlateVisibility OnActivatedVisibility, |
Visibilities to use for when bound widgets in BindVisibilityToActivation are activated. | CommonActivatableWidget.h |
|
bool SetsVisibilityOnActivated() |
CommonActivatableWidget.h | ||
bool SetsVisibilityOnDeactivated() |
CommonActivatableWidget.h | ||
bool SupportsActivationFocus() |
CommonActivatableWidget.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ActivateMappingContext() |
CommonActivatableWidget.h | ||
| Implement to provide the desired widget to focus if/when this activatable becomes the primary active widget. | CommonActivatableWidget.h |
|
|
| Implement to provide the input config to use when this widget is activated. | CommonActivatableWidget.h |
|
|
void BP_OnActivated() |
CommonActivatableWidget.h |
|
|
void BP_OnDeactivated() |
CommonActivatableWidget.h |
|
|
bool BP_OnHandleBackAction() |
Override in BP implementations to provide custom behavior when receiving a back action Note: Only called if native code in the base class hasn't handled it in NativeOnHandleBackAction | CommonActivatableWidget.h |
|
virtual void DeactivateMappingContext() |
CommonActivatableWidget.h | ||
void HandleBackAction() |
CommonActivatableWidget.h | ||
virtual void InternalProcessActivation() |
CommonActivatableWidget.h | ||
virtual void InternalProcessDeactivation() |
CommonActivatableWidget.h | ||
virtual UWidget * NativeGetDesiredFocusTarget () |
Override to provide the desired widget that should receive focus when this becomes the primary active widget. | CommonActivatableWidget.h | |
virtual void NativeOnActivated() |
CommonActivatableWidget.h |
|
|
virtual void NativeOnDeactivated() |
CommonActivatableWidget.h |
|
|
virtual bool NativeOnHandleBackAction() |
CommonActivatableWidget.h |
|
|
void RequestRefreshFocus () |
Ask for focus to be re-set to our current DesiredFocusTarget, but only if our node is currently the leaf-most active node (no stealing!). | CommonActivatableWidget.h |
|
void Reset() |
CommonActivatableWidget.h |
Overridden from UUserWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void NativeConstruct() |
CommonActivatableWidget.h | ||
virtual void NativeDestruct() |
CommonActivatableWidget.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnWidgetRebuilt() |
CommonActivatableWidget.h | ||
virtual TSharedRef< SWidget > RebuildWidget() |
CommonActivatableWidget.h |
Overridden from UVisual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ReleaseSlateResources
(
bool bReleaseChildren |
CommonActivatableWidget.h |