Repository navigation
Expand file tree
/
Copy pathPyUserWidget.h
More file actions
70 lines (49 loc) · 2.47 KB
/
Copy pathPyUserWidget.h
File metadata and controls
70 lines (49 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
#include "UnrealEnginePython.h"
#include "PyUserWidget.generated.h"
UCLASS(BlueprintType, Blueprintable)
class UNREALENGINEPYTHON_API UPyUserWidget : public UUserWidget
{
GENERATED_BODY()
public:
UPyUserWidget(const FObjectInitializer& ObjectInitializer);
~UPyUserWidget();
virtual void NativeConstruct() override;
virtual void NativeDestruct() override;
// Called every frame
virtual void NativeTick(const FGeometry & MyGeometry, float InDeltaTime) override;
virtual void NativePaint(FPaintContext & InContext) const override;
virtual bool NativeIsInteractable() const override;
virtual FReply NativeOnMouseButtonDown(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent) override;
virtual FReply NativeOnMouseButtonUp(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent) override;
virtual FReply NativeOnMouseWheel(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent) override;
virtual FReply NativeOnMouseMove(const FGeometry & InGeometry, const FPointerEvent & InMouseEvent) override;
virtual FReply NativeOnKeyUp(const FGeometry & InGeometry, const FKeyEvent & InKeyEvent) override;
virtual FReply NativeOnKeyDown(const FGeometry & InGeometry, const FKeyEvent & InKeyEvent) override;
UPROPERTY(EditAnywhere, Category = "Python", BlueprintReadWrite, meta = (ExposeOnSpawn = true))
FString PythonModule;
UPROPERTY(EditAnywhere, Category = "Python", BlueprintReadWrite, meta = (ExposeOnSpawn = true))
FString PythonClass;
UPROPERTY(EditAnywhere, Category = "Python", BlueprintReadWrite, meta = (ExposeOnSpawn = true))
bool PythonTickForceDisabled;
UPROPERTY(EditAnywhere, Category = "Python", BlueprintReadWrite, meta = (ExposeOnSpawn = true))
bool PythonPaintForceDisabled;
UFUNCTION(BlueprintCallable, Category = "Python")
void CallPythonUserWidgetMethod(FString method_name, FString args);
UPROPERTY(EditAnywhere, Category = "Python", BlueprintReadWrite)
TWeakObjectPtr<class UPyNativeWidgetHost> PyNativeWidgetHost;
#if WITH_EDITOR
virtual const FText GetPaletteCategory() override;
#endif
void SetSlateWidget(TSharedRef<SWidget> InContent);
virtual void ReleaseSlateResources(bool bReleaseChildren) override;
protected:
// UWidget interface
virtual TSharedRef<SWidget> RebuildWidget() override;
// End of UWidget interface
private:
PyObject * py_user_widget_instance;
// mapped uobject, required for debug and advanced reflection
ue_PyUObject *py_uobject;
};