UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ComboBoxString.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"
8#include "Layout/Margin.h"
10#include "Styling/SlateTypes.h"
11#include "Widgets/SWidget.h"
13#include "Components/Widget.h"
14
15#include "ComboBoxString.generated.h"
16
20UCLASS(meta=( DisplayName="ComboBox (String)"), MinimalAPI)
21class UComboBoxString : public UWidget
22{
24
25 DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnSelectionChangedEvent, FString, SelectedItem, ESelectInfo::Type, SelectionType);
27
29
31 UPROPERTY(EditAnywhere, Category=Content)
32 TArray<FString> DefaultOptions;
33
35 UPROPERTY(EditAnywhere, FieldNotify, Category=Content)
36 FString SelectedOption;
37
38public:
39
40 UE_DEPRECATED(5.2, "Direct access to WidgetStyle is deprecated. Please use the getter or setter.")
42 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Style, meta=( DisplayName="Style" ))
43 FComboBoxStyle WidgetStyle;
44
45 UE_DEPRECATED(5.2, "Direct access to ItemStyle is deprecated. Please use the getter or setter.")
47 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Style)
48 FTableRowStyle ItemStyle;
49
50 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.")
52 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category="Style")
53 FScrollBarStyle ScrollBarStyle;
54
55 UE_DEPRECATED(5.2, "Direct access to ContentPadding is deprecated. Please use the getter or setter.")
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Content)
57 FMargin ContentPadding;
58
59 UE_DEPRECATED(5.2, "Direct access to MaxListHeight is deprecated. Please use the getter or setter.")
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter, Setter, Category=Content, AdvancedDisplay)
62 float MaxListHeight;
63
64 UE_DEPRECATED(5.2, "Direct access to HasDownArrow is deprecated. Please use the getter or setter.")
69 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "IsHasDownArrow", Setter = "SetHasDownArrow", Category = Content, AdvancedDisplay)
70 bool HasDownArrow;
71
72 UE_DEPRECATED(5.2, "Direct access to EnableGamepadNavigationMode is deprecated. Please use the getter or setter.")
77 UPROPERTY(EditAnywhere, BlueprintReadWrite, Getter = "IsEnableGamepadNavigationMode", Setter = "SetEnableGamepadNavigationMode", Category = Content, AdvancedDisplay)
78 bool EnableGamepadNavigationMode;
79
80 UE_DEPRECATED(5.2, "Direct access to Font is deprecated. Please use the getter. Note that this property is only set at construction and is not modifiable at runtime.")
85 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category=Style)
87
88 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.")
90 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter, Category=Style, meta=(DesignerRebuild))
91 FSlateColor ForegroundColor;
92
93 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.")
94 UPROPERTY(EditAnywhere, BlueprintReadOnly, Getter= "IsFocusable", Category=Interaction)
95 bool bIsFocusable;
96
97public: // Events
98
100 UPROPERTY(EditAnywhere, Category=Events, meta=( IsBindableEvent="True" ))
102
104 UPROPERTY(BlueprintAssignable, Category=Events)
105 FOnSelectionChangedEvent OnSelectionChanged;
106
108 UPROPERTY(BlueprintAssignable, Category=Events)
109 FOnOpeningEvent OnOpening;
110
111public:
112
113 UFUNCTION(BlueprintCallable, Category="ComboBox")
114 UMG_API void AddOption(const FString& Option);
115
116 UFUNCTION(BlueprintCallable, Category="ComboBox")
117 UMG_API bool RemoveOption(const FString& Option);
118
119 UFUNCTION(BlueprintCallable, Category="ComboBox")
120 UMG_API int32 FindOptionIndex(const FString& Option) const;
121
122 UFUNCTION(BlueprintCallable, Category="ComboBox")
123 UMG_API FString GetOptionAtIndex(int32 Index) const;
124
125 UFUNCTION(BlueprintCallable, Category="ComboBox")
126 UMG_API void ClearOptions();
127
128 UFUNCTION(BlueprintCallable, Category="ComboBox")
129 UMG_API void ClearSelection();
130
135 UFUNCTION(BlueprintCallable, Category="ComboBox")
136 UMG_API void RefreshOptions();
137
138 UFUNCTION(BlueprintCallable, Category="ComboBox")
139 UMG_API void SetSelectedOption(FString Option);
140
141 UFUNCTION(BlueprintCallable, Category = "ComboBox")
142 UMG_API void SetSelectedIndex(const int32 Index);
143
144 UFUNCTION(BlueprintCallable, Category="ComboBox")
145 UMG_API FString GetSelectedOption() const;
146
147 UFUNCTION(BlueprintCallable, Category="ComboBox")
149
151 UFUNCTION(BlueprintCallable, Category="ComboBox")
153
154 UFUNCTION(BlueprintCallable, Category="ComboBox", Meta = (ReturnDisplayName = "bOpen"))
155 UMG_API bool IsOpen() const;
156
157 //~ Begin UVisual Interface
158 UMG_API virtual void ReleaseSlateResources(bool bReleaseChildren) override;
159 //~ End UVisual Interface
160
162 UMG_API void SetContentPadding(FMargin InPadding);
163
165 UMG_API FMargin GetContentPadding() const;
166
169
171 UMG_API void SetEnableGamepadNavigationMode(bool InEnableGamepadNavigationMode);
172
174 UMG_API bool IsHasDownArrow() const;
175
177 UMG_API void SetHasDownArrow(bool InHasDownArrow);
178
180 UMG_API float GetMaxListHeight() const;
181
184
186 UMG_API const FSlateFontInfo& GetFont() const;
187
189 UMG_API const FComboBoxStyle& GetWidgetStyle() const;
190
192 UMG_API void SetWidgetStyle(const FComboBoxStyle& InWidgetStyle);
193
195 UMG_API const FTableRowStyle& GetItemStyle() const;
196
198 UMG_API void SetItemStyle(const FTableRowStyle& InItemStyle);
199
201 UMG_API const FScrollBarStyle& GetScrollBarStyle() const;
202
204 UMG_API bool IsFocusable() const;
205
207 UMG_API FSlateColor GetForegroundColor() const;
208
209 //~ Begin UObject Interface
210 UMG_API virtual void PostInitProperties() override;
213 //~ End UObject Interface
214
215#if WITH_EDITOR
216 UMG_API virtual const FText GetPaletteCategory() override;
217#endif
218
219protected:
222
225
227 UMG_API virtual void HandleSelectionChanged(TSharedPtr<FString> Item, ESelectInfo::Type SelectionType);
228
230 UMG_API virtual void HandleOpening();
231
232 //~ Begin UWidget Interface
233 UMG_API virtual TSharedRef<SWidget> RebuildWidget() override;
234 //~ End UWidget Interface
235
238
241
243 UMG_API void InitIsFocusable(bool InIsFocusable);
244
247
248protected:
251
254
257
260
263};
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 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 UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition Archive.h:1208
Definition Text.h:385
Definition Array.h:670
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition Widget.h:217
virtual UMG_API TSharedRef< SWidget > RebuildWidget()
Definition Widget.cpp:1452
Definition SlateEnums.h:309
Type
Definition SlateEnums.h:311
U16 Index
Definition radfft.cpp:71
Definition SlateTypes.h:742
Definition Margin.h:17
Definition SlateTypes.h:932
Definition SlateColor.h:42
Definition SlateFontInfo.h:147
Definition SlateTypes.h:1641