UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SProgressBar.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"
7#include "Misc/Attribute.h"
11#include "Widgets/SLeafWidget.h"
12#include "Styling/SlateTypes.h"
13#include "Styling/CoreStyle.h"
14#include "SProgressBar.generated.h"
15
17class FPaintArgs;
19
23UENUM(BlueprintType)
25{
26 enum Type : int
27 {
28 // will fill up from the left side to the right
30 // will fill up from the right side to the left side
32 // will scale up from the midpoint to the outer edges both vertically and horizontally
34 // will fill up from the centerline to the outer edges horizontally
36 // will fill up from the centerline to the outer edges vertically
38 // will fill up from the top to the the bottom
40 // will fill up from the bottom to the the top
42 };
43}
44
48UENUM(BlueprintType)
50{
51 enum Type : int
52 {
53 // a mask is used to paint the fill image
55 // the fill image is scaled to the fill percentage
57 };
58}
59
62{
63
64public:
79
82
83
85
86
88
89
91
92
93 SLATE_ATTRIBUTE( FSlateColor, FillColorAndOpacity )
94
95
96 SLATE_ATTRIBUTE( FVector2D, BorderPadding )
97
98
99 SLATE_ARGUMENT(const FSlateBrush*, BackgroundImage)
100
101
102 SLATE_ARGUMENT(const FSlateBrush*, FillImage)
103
104
105 SLATE_ARGUMENT(const FSlateBrush*, MarqueeImage)
106
107
108 SLATE_ARGUMENT(float, RefreshRate)
109
111
112
117 SLATE_API void Construct(const FArguments& InArgs);
118
119 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;
122
125
128
131
134
137
140
143
146
149
150private:
151
153 void SetActiveTimerTickRate(float TickRate);
154
155 void UpdateMarqueeActiveTimer();
156
158 EActiveTimerReturnType ActiveTick(double InCurrentTime, float InDeltaTime);
159
161 const FSlateBrush* GetBackgroundImage() const;
163 const FSlateBrush* GetFillImage() const;
165 const FSlateBrush* GetMarqueeImage() const;
166
167private:
168
170 const FProgressBarStyle* Style;
171
173 TAttribute< TOptional<float> > Percent;
174
175 EProgressBarFillType::Type BarFillType;
176
177 EProgressBarFillStyle::Type BarFillStyle;
178
180 const FSlateBrush* BackgroundImage;
181
183 const FSlateBrush* FillImage;
184
186 const FSlateBrush* MarqueeImage;
187
189 TAttribute<FSlateColor> FillColorAndOpacity;
190
192 TAttribute<FVector2D> BorderPadding;
193
195 float MarqueeOffset;
196
198 TWeakPtr<FActiveTimerHandle> ActiveTimerHandle;
199
201 float CurrentTickRate;
202
204 float MinimumTickRate;
205};
206
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_STYLE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:280
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
#define UENUM(...)
Definition ObjectMacros.h:749
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
EActiveTimerReturnType
Definition SlateEnums.h:329
Definition ActiveTimerHandle.h:12
Definition AppStyle.h:24
Definition PaintArgs.h:23
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition WidgetStyle.h:15
Definition SLeafWidget.h:29
Definition SProgressBar.h:62
SLATE_API void SetFillImage(const FSlateBrush *InFillImage)
Definition SProgressBar.cpp:107
virtual SLATE_API FVector2D ComputeDesiredSize(float) const override
Definition SProgressBar.cpp:499
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 SProgressBar.cpp:161
SLATE_API void SetMarqueeImage(const FSlateBrush *InMarqueeImage)
Definition SProgressBar.cpp:116
SLATE_API void SetFillColorAndOpacity(TAttribute< FSlateColor > InFillColorAndOpacity)
Definition SProgressBar.cpp:80
virtual SLATE_API bool ComputeVolatility() const override
Definition SProgressBar.cpp:504
SLATE_API void SetBarFillType(EProgressBarFillType::Type InBarFillType)
Definition SProgressBar.cpp:62
SLATE_API void SetBackgroundImage(const FSlateBrush *InBackgroundImage)
Definition SProgressBar.cpp:98
SLATE_API void Construct(const FArguments &InArgs)
Definition SProgressBar.cpp:9
SLATE_API void SetStyle(const FProgressBarStyle *InStyle)
Definition SProgressBar.cpp:46
SLATE_API void SetBorderPadding(TAttribute< FVector2D > InBorderPadding)
Definition SProgressBar.cpp:89
SLATE_BEGIN_ARGS(SProgressBar)
Definition SProgressBar.h:65
SLATE_API void SetPercent(TAttribute< TOptional< float > > InPercent)
Definition SProgressBar.cpp:36
SLATE_API void SetBarFillStyle(EProgressBarFillStyle::Type InBarFillStyle)
Definition SProgressBar.cpp:71
Definition Attribute.h:17
Definition SharedPointer.h:1295
Definition SProgressBar.h:50
Type
Definition SProgressBar.h:52
Definition SProgressBar.h:25
Type
Definition SProgressBar.h:27
@ TopToBottom
Definition SProgressBar.h:39
@ BottomToTop
Definition SProgressBar.h:41
@ FillFromCenterHorizontal
Definition SProgressBar.h:35
@ FillFromCenter
Definition SProgressBar.h:33
@ FillFromCenterVertical
Definition SProgressBar.h:37
static SLATECORE_API const EVisibility SelfHitTestInvisible
Definition Visibility.h:26
Definition Geometry.h:40
Definition Color.h:48
Definition SlateTypes.h:1165
Definition SlateBrush.h:239
Definition SlateColor.h:42
Definition Optional.h:131