A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
ButtonListWidget.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "BasicWidget.h"
7#include "Components/VerticalBox.h"
8#include "ButtonListWidget.generated.h"
9
11
15UCLASS()
16class PIXOCORE_API UButtonListWidget : public UBasicWidget
17{
18 GENERATED_BODY()
19
20public:
21 virtual void NativeOnInitialized() override;
22
23 virtual void Init(UBasicWidgetInfo* WidgetInfo) override;
24
29 UFUNCTION(BlueprintCallable, Category = "Buttons")
30 virtual void SelectButtonEvent(FText SelectedButtonName);
31
36 UFUNCTION(BlueprintCallable, Category = "Buttons")
37 virtual void SpawnButtons(const UDataTable* DTButtonsList);
38
39protected:
44 UFUNCTION(Category = "Buttons")
45 virtual void OnClickConfirmEvent(FText ButtonName);
46
52 UFUNCTION(BlueprintCallable, Category = "Buttons")
53 virtual void SpawnButtonInstance(FText ButtonName, bool Checked);
54
55#pragma region Variables
56public:
57 FConfirmEventDelegate OnConfirmEventDelegate;
58
59protected:
60 UPROPERTY(BlueprintReadOnly, Category = "Buttons", meta = (BindWidget))
61 UButtonWidget* ConfirmButton;
62
63 UPROPERTY(BlueprintReadOnly, meta = (BindWidget))
64 UVerticalBox* VerticalBoxButtons;
65
67 UPROPERTY(BlueprintReadWrite, Category = "Buttons")
68 TArray<UButtonWidget*> ButtonsArray;
69
71 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")
72 TSubclassOf<class UButtonWidget> ButtonWidgetClass;
73
74 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")
75 TSubclassOf<class UButtonWidget> CheckButtonWidgetClass;
76
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")
78 FMargin ButtonPadding = {0.0, 10.0, 0.0, 10.0};
79
81 UPROPERTY(BlueprintReadWrite, Category = "Buttons")
82 UButtonWidget* SelectedButton;
84 TSet<FString> SelectedButtonsLabels;
85
86private:
88 bool bConfirmSelection;
89};
DECLARE_DELEGATE_OneParam(FConfirmEventDelegate, UBasicResponseData *)
UObject class representing basic response data.
Definition UIData.h:24
Base class for user widgets in the PixoCore module.
Definition BasicWidget.h:24
virtual void NativeOnInitialized() override
virtual void Init(UBasicWidgetInfo *WidgetInfo)
Initializes the widget with the provided widget information.
UDataAsset class representing basic widget information.
Definition UIData.h:56
Custom widget class representing a list of buttons.
bool bConfirmSelection
Should we check for any selected option before accept confirmation.
TSet< FString > SelectedButtonsLabels
TArray< UButtonWidget * > ButtonsArray
Holds all buttons which were spawned from Data Table.
FConfirmEventDelegate OnConfirmEventDelegate
UVerticalBox * VerticalBoxButtons
UPROPERTY(BlueprintReadOnly, meta = (BindWidget))
UButtonWidget * SelectedButton
Holds the last selected button.
UButtonWidget * ConfirmButton
UPROPERTY(BlueprintReadOnly, Category = "Buttons", meta = (BindWidget))
TSubclassOf< class UButtonWidget > CheckButtonWidgetClass
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Buttons")
TSubclassOf< class UButtonWidget > ButtonWidgetClass
The class that will be used to spawning the buttons.
Custom widget class representing a button.