UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ComboBoxKey.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 "Components/Widget.h"
9
10#include "ComboBoxKey.generated.h"
11
12
17UCLASS(meta = (DisplayName = "ComboBox (Key)"), MinimalAPI)
18class UComboBoxKey : public UWidget
19{
21
22public:
24
28
31 UPROPERTY(EditAnywhere, Category = Content)
32 TArray<FName> Options;
33
35 UPROPERTY(EditAnywhere, FieldNotify, Category = Content)
37
38public:
39 UE_DEPRECATED(5.2, "Direct access to WidgetStyle is deprecated. Please use the getter or setter.")
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Style, meta = (DisplayName = "Style"))
42 FComboBoxStyle WidgetStyle;
43
44 UE_DEPRECATED(5.2, "Direct access to ItemStyle is deprecated. Please use the getter or setter.")
46 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Style)
47 FTableRowStyle ItemStyle;
48
49 UE_DEPRECATED(5.2, "Direct access to ScrollBarStyle is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
51 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category="Style")
52 FScrollBarStyle ScrollBarStyle;
53
54 UE_DEPRECATED(5.2, "Direct access to ForegroundColor is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
56 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category = Style, meta = (DesignerRebuild))
57 FSlateColor ForegroundColor;
58
59 UE_DEPRECATED(5.2, "Direct access to ContentPadding is deprecated. Please use the getter or setter.")
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Style)
61 FMargin ContentPadding;
62
63 UE_DEPRECATED(5.2, "Direct access to MaxListHeight is deprecated. Please use the getter or setter.")
65 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category = Style, AdvancedDisplay)
66 float MaxListHeight;
67
68 UE_DEPRECATED(5.2, "Direct access to bHasDownArrow is deprecated. Please use the getter or setter.")
73 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "IsHasDownArrow", Setter = "SetHasDownArrow", Category = Style, AdvancedDisplay)
74 bool bHasDownArrow;
75
76 UE_DEPRECATED(5.2, "Direct access to bEnableGamepadNavigationMode is deprecated. Please use the getter or setter.")
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "IsEnableGamepadNavigationMode", Setter = "SetEnableGamepadNavigationMode", Category = Style, AdvancedDisplay)
83
84 UE_DEPRECATED(5.2, "Direct access to bIsFocusable is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
86 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter = "IsFocusable", Category = Style)
87 bool bIsFocusable;
88
89public: // Events
90
92 UPROPERTY(EditAnywhere, Category = Events, meta = (IsBindableEvent = "True"))
94
96 UPROPERTY(EditAnywhere, Category = Events, meta = (IsBindableEvent = "True"))
98
100 UPROPERTY(BlueprintAssignable, Category = Events)
101 FOnSelectionChangedEvent OnSelectionChanged;
102
104 UPROPERTY(BlueprintAssignable, Category = Events)
105 FOnOpeningEvent OnOpening;
106
107public:
108
109
110
112 UFUNCTION(BlueprintCallable, Category = "ComboBox")
113 UMG_API void AddOption(FName Option);
114
116 UFUNCTION(BlueprintCallable, Category = "ComboBox")
117 UMG_API bool RemoveOption(FName Option);
118
120 UFUNCTION(BlueprintCallable, Category = "ComboBox")
121 UMG_API void ClearOptions();
122
124 UFUNCTION(BlueprintCallable, Category = "ComboBox")
125 UMG_API void ClearSelection();
126
128 UFUNCTION(BlueprintCallable, Category = "ComboBox")
130
132 UFUNCTION(BlueprintCallable, Category = "ComboBox")
134
136 UFUNCTION(BlueprintCallable, Category = "ComboBox", Meta = (ReturnDisplayName = "bOpen"))
137 UMG_API bool IsOpen() const;
138
139 //~ Begin UVisual Interface
140 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
141 //~ End UVisual Interface
142
144 UMG_API void SetContentPadding(FMargin InPadding);
145
147 UMG_API FMargin GetContentPadding() const;
148
151
153 UMG_API void SetEnableGamepadNavigationMode(bool InEnableGamepadNavigationMode);
154
156 UMG_API bool IsHasDownArrow() const;
157
159 UMG_API void SetHasDownArrow(bool InHasDownArrow);
160
162 UMG_API float GetMaxListHeight() const;
163
166
168 UMG_API const FComboBoxStyle& GetWidgetStyle() const;
169
171 UMG_API void SetWidgetStyle(const FComboBoxStyle& InWidgetStyle);
172
174 UMG_API const FTableRowStyle& GetItemStyle() const;
175
177 UMG_API void SetItemStyle(const FTableRowStyle& InItemStyle);
178
180 UMG_API const FScrollBarStyle& GetScrollBarStyle() const;
181
183 UMG_API bool IsFocusable() const;
184
186 UMG_API FSlateColor GetForegroundColor() const;
187
188#if WITH_EDITOR
189 UMG_API virtual const FText GetPaletteCategory() override;
190#endif
191
192protected:
193
196
198 UMG_API void InitIsFocusable(bool InIsFocusable);
199
202
203private:
205 void GenerateContent();
206
209
211 void HandleSelectionChanged(FName Item, ESelectInfo::Type SelectionType);
212
214 void HandleOpening();
215
216 //~ Begin UWidget Interface
217 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
218 //~ End UWidget Interface
219
220private:
223
226};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(DelegateName, Param1Type, Param1Name, Param2Type, Param2Name)
Definition DelegateCombinations.h:62
#define DECLARE_DYNAMIC_MULTICAST_DELEGATE(DelegateName)
Definition DelegateCombinations.h:38
#define DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(ReturnValueType, DelegateName, Param1Type, Param1Name)
Definition DelegateCombinations.h:55
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition NameTypes.h:617
Definition Text.h:385
Definition Array.h:670
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition Widget.h:217
virtual UMG_API TSharedRef< SWidget > RebuildWidget()
Definition Widget.cpp:1452
Definition SlateEnums.h:309
Type
Definition SlateEnums.h:311
Definition SlateTypes.h:742
Definition Margin.h:17
Definition SlateTypes.h:932
Definition SlateColor.h:42
Definition SlateTypes.h:1641