UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SColorWheel.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Misc/Attribute.h"
7#include "Input/Reply.h"
11#include "Styling/CoreStyle.h"
12
13class FPaintArgs;
15struct FSlateBrush;
16
21 : public SLeafWidget
22{
23public:
24
27 , _ColorWheelBrush(FCoreStyle::Get().GetBrush("ColorWheel.HueValueCircle"))
31 , _CtrlMultiplier(0.1f)
32 { }
33
35 SLATE_ATTRIBUTE(FLinearColor, SelectedColor)
36
37
38 SLATE_ATTRIBUTE(const FSlateBrush*, ColorWheelBrush)
39
40
41 SLATE_EVENT(FSimpleDelegate, OnMouseCaptureBegin)
42
43
44 SLATE_EVENT(FSimpleDelegate, OnMouseCaptureEnd)
45
46
48
49
50 SLATE_ATTRIBUTE(float, CtrlMultiplier)
51
53
54public:
57
63 SLATE_API void Construct(const FArguments& InArgs);
64
70 void ShowSelector(bool bShow = true) { bShouldDrawSelector = bShow; }
71
72public:
73
74 //~ SWidget overrides
75
76 SLATE_API virtual FVector2D ComputeDesiredSize(float) const override;
81 SLATE_API virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
83
84protected:
85
92
99
100private:
101
103 const FSlateBrush* Image;
104
107
109 TAttribute<float> CtrlMultiplier;
110
112 const FSlateBrush* SelectorImage;
113
115 bool bShouldDrawSelector;
116
118 bool bDragging = false;
119
121 FVector2f LastWheelPosition;
122
123private:
124
126 FSimpleDelegate OnMouseCaptureBegin;
127
129 FSimpleDelegate OnMouseCaptureEnd;
130
132 FOnLinearColorValueChanged OnValueChanged;
133};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
return true
Definition ExternalRpcRegistry.cpp:601
Definition CoreStyle.h:15
Definition CursorReply.h:16
Definition PaintArgs.h:23
Definition Reply.h:24
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition WidgetStyle.h:15
Definition SColorWheel.h:22
SLATE_BEGIN_ARGS(SColorWheel)
Definition SColorWheel.h:25
virtual SLATE_API FReply OnMouseButtonDoubleClick(const FGeometry &InMyGeometry, const FPointerEvent &InMouseEvent) override
Definition SColorWheel.cpp:39
SLATE_API void Construct(const FArguments &InArgs)
Definition SColorWheel.cpp:16
virtual SLATE_API FReply OnMouseMove(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SColorWheel.cpp:83
virtual SLATE_API FReply OnMouseButtonUp(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SColorWheel.cpp:64
virtual SLATE_API FCursorReply OnCursorQuery(const FGeometry &MyGeometry, const FPointerEvent &CursorEvent) const override
Definition SColorWheel.cpp:212
virtual SLATE_API FVector2D ComputeDesiredSize(float) const override
Definition SColorWheel.cpp:33
SLATE_API bool ProcessMouseAction(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent, bool bProcessWhenOutsideColorWheel)
Definition SColorWheel.cpp:154
virtual SLATE_API FReply OnMouseButtonDown(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SColorWheel.cpp:45
void ShowSelector(bool bShow=true)
Definition SColorWheel.h:70
SLATE_API UE::Slate::FDeprecateVector2DResult CalcRelativePositionFromCenter() const
Definition SColorWheel.cpp:143
virtual SLATE_API int32 OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override
Definition SColorWheel.cpp:102
Definition SLeafWidget.h:29
Definition Attribute.h:17
FDeprecateSlateVector2D FDeprecateVector2DResult
Definition SlateVector2.h:469
Definition Geometry.h:40
Definition Color.h:48
Definition Events.h:695
Definition SlateBrush.h:239