A Demo Project for the UnrealEngineSDK
Loading...
Searching...
No Matches
SDlgDataPropertyValues.h
Go to the documentation of this file.
1// Copyright Csaba Molnar, Daniel Butum. All Rights Reserved.
2#pragma once
3#include "Widgets/DeclarativeSyntaxSupport.h"
4#include "Widgets/SCompoundWidget.h"
5
8
9class SEditableTextBox;
10class SCheckBox;
11
12
14class DLGSYSTEM_API SDlgDataPropertyValue : public SCompoundWidget
15{
18public:
20 SLATE_END_ARGS()
21
22 void Construct(const FArguments& InArgs, const TSharedPtr<FDlgDataDisplayTreeVariableNode>& InVariableNode);
23
24 // SWidget Interface
25
33 void Tick(const FGeometry& AllottedGeometry, double InCurrentTime, float InDeltaTime) override;
34
40 bool SupportsKeyboardFocus() const override
41 {
42 return VariableNode.IsValid() && PrimaryWidget.IsValid() && PrimaryWidget->SupportsKeyboardFocus();
43 }
44
52 FReply OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent) override
53 {
54 if (PrimaryWidget.IsValid())
55 {
56 return FReply::Handled().SetUserFocus(PrimaryWidget.ToSharedRef(), InFocusEvent.GetCause());
57 }
58
59 return Super::OnFocusReceived(MyGeometry, InFocusEvent);
60 }
61
62 // Own functions
63
65 FText GetTextValue() const { return FText::FromString(VariableNode->GetVariableValue()); }
66
67protected:
69 void UpdateVariableNodeFromActor();
70
71protected:
73 TSharedPtr<FDlgDataDisplayTreeVariableNode> VariableNode;
74
76 TSharedPtr<SWidget> PrimaryWidget;
77
79 float TickPassedDeltaTimeSeconds = 0.f;
80
81 static constexpr float TickUpdateTimeSeconds = 1.0f;
82};
83
84
87{
89public:
91 SLATE_END_ARGS()
92
93 void Construct(const FArguments& InArgs, const TSharedPtr<FDlgDataDisplayTreeVariableNode>& InVariableNode);
94
95protected:
96 void HandleTextCommitted(const FText& NewText, ETextCommit::Type CommitInfo);
97 void HandleTextChanged(const FText& NewText);
98
99 bool IsReadOnly() const { return !VariableNode.IsValid(); }
100
101protected:
103 TSharedPtr<SEditableTextBox> TextBoxWidget;
104
106 bool bIsFNameProperty = false;
107};
108
109
112{
114public:
116 SLATE_END_ARGS()
117
118 void Construct(const FArguments& InArgs, const TSharedPtr<FDlgDataDisplayTreeVariableNode>& InVariableNode);
119
120 // SWidget Interface
121 void Tick(const FGeometry& AllottedGeometry, double InCurrentTime, float InDeltaTime) override
122 {
123 SCompoundWidget::Tick(AllottedGeometry, InCurrentTime, InDeltaTime);
124 }
125
126protected:
128};
129
130
133{
135public:
137 SLATE_END_ARGS()
138
139 void Construct(const FArguments& InArgs, const TSharedPtr<FDlgDataDisplayTreeVariableNode>& InVariableNode);
140
141 // SWidget interface
142 bool HasKeyboardFocus() const override;
143
151 FReply OnMouseButtonDoubleClick(const FGeometry& InMyGeometry, const FPointerEvent& InMouseEvent) override;
152
153protected:
154 ECheckBoxState IsChecked() const;
155 void HandleCheckStateChanged(ECheckBoxState InNewState);
158
159protected:
160 TSharedPtr<SCheckBox> CheckBoxWidget;
161};
FReply OnMouseButtonDoubleClick(const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent) override
TSharedPtr< SCheckBox > CheckBoxWidget
void HandleCheckStateChanged(ECheckBoxState InNewState)
bool HasKeyboardFocus() const override
SDlgDataBoolPropertyValue Self
void Construct(const FArguments &InArgs, const TSharedPtr< FDlgDataDisplayTreeVariableNode > &InVariableNode)
void Tick(const FGeometry &AllottedGeometry, double InCurrentTime, float InDeltaTime) override
void Construct(const FArguments &InArgs, const TSharedPtr< FDlgDataDisplayTreeVariableNode > &InVariableNode)
SDlgDataEventPropertyValue Self
SDlgDataPropertyValue Self
TSharedPtr< FDlgDataDisplayTreeVariableNode > VariableNode
TSharedPtr< SWidget > PrimaryWidget
FReply OnFocusReceived(const FGeometry &MyGeometry, const FFocusEvent &InFocusEvent) override
SDlgDataTextPropertyValue Self
TSharedPtr< SEditableTextBox > TextBoxWidget
void Construct(const FArguments &InArgs, const TSharedPtr< FDlgDataDisplayTreeVariableNode > &InVariableNode)
void HandleTextCommitted(const FText &NewText, ETextCommit::Type CommitInfo)
void HandleTextChanged(const FText &NewText)