UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SCarouselNavigationBar.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
5#include "Misc/Attribute.h"
7#include "Input/Reply.h"
10#include "WidgetCarouselStyle.h"
11
12#define LOCTEXT_NAMESPACE "WidgetCarousel"
13
14class SHorizontalBox;
15
20{
22
23public:
25 : _Style()
27 , _ItemCount(0)
30
31 {}
32
34
35
36 SLATE_EVENT(FOnSelectedIndexChanged, OnSelectedIndexChanged)
37
38
39 SLATE_ARGUMENT(int32, ItemCount)
40
41
42 SLATE_ATTRIBUTE(int32, CurrentItemIndex)
43
44
45 SLATE_ATTRIBUTE(float, CurrentSlideAmount)
46
48
49 WIDGETCAROUSEL_API int32 GetItemCount();
50
51 WIDGETCAROUSEL_API void SetItemCount(int32 InItemCount);
52
53 WIDGETCAROUSEL_API void Construct(const FArguments& InArgs);
54
55private:
56 void BuildScrollBar();
57
58 FReply HandleItemButtonClicked(int32 ItemIndex);
59
60 FVector2D GetPlaceHolderPosition() const;
61
62private:
64 TSharedPtr<SHorizontalBox> WidgetScrollBox;
65 FOnSelectedIndexChanged OnSelectedIndexChanged;
66 int32 ItemCount;
67 TAttribute<int32> CurrentItemIndex;
68 TAttribute<float> CurrentSlideAmount;
69};
70
71#undef LOCTEXT_NAMESPACE
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_BEGIN_ARGS(InWidgetType)
Definition DeclarativeSyntaxSupport.h:63
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
Definition Reply.h:24
Definition SCarouselNavigationBar.h:20
Definition SCompoundWidget.h:22
Definition SBoxPanel.h:171
Definition Attribute.h:17
Definition SharedPointer.h:692
Definition WidgetCarouselStyle.h:44