Navigation
API > API/Runtime > API/Runtime/UMG
The combobox allows you to display a list of options to the user in a dropdown menu for them to select one.
| Name | UComboBoxString |
| Type | class |
| Header File | /Engine/Source/Runtime/UMG/Public/Components/ComboBoxString.h |
| Include Path | #include "Components/ComboBoxString.h" |
Syntax
UCLASS (Meta=(DisplayName="ComboBox (String)"), MinimalAPI)
class UComboBoxString : public UWidget
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UVisual → UWidget → UComboBoxString
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UComboBoxString
(
const FObjectInitializer& ObjectInitializer |
Components/ComboBoxString.h |
Classes
| Name | Remarks |
|---|---|
| FOnOpeningEvent | |
| FOnSelectionChangedEvent |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsFocusable | bool | Components/ComboBoxString.h |
|
|
| ContentPadding | FMargin | Components/ComboBoxString.h |
|
|
| EnableGamepadNavigationMode | bool | When false, directional keys will change the selection. | Components/ComboBoxString.h |
|
| Font | FSlateFontInfo | The default font to use in the combobox, only applies if you're not implementing OnGenerateWidgetEvent to factory each new entry. | Components/ComboBoxString.h |
|
| ForegroundColor | FSlateColor | The foreground color to pass through the hierarchy. | Components/ComboBoxString.h |
|
| HasDownArrow | bool | When false, the down arrow is not generated and it is up to the API consumer to make their own visual hint that this is a drop down. | Components/ComboBoxString.h |
|
| ItemStyle | FTableRowStyle | The item row style. | Components/ComboBoxString.h |
|
| MaxListHeight | float | The max height of the combobox list that opens | Components/ComboBoxString.h |
|
| OnGenerateWidgetEvent | FGenerateWidgetForString | Called when the widget is needed for the item. | Components/ComboBoxString.h |
|
| OnOpening | FOnOpeningEvent | Called when the combobox is opening | Components/ComboBoxString.h |
|
| OnSelectionChanged | FOnSelectionChangedEvent | Called when a new item is selected in the combobox. | Components/ComboBoxString.h |
|
| ScrollBarStyle | FScrollBarStyle | The scroll bar style. | Components/ComboBoxString.h |
|
| WidgetStyle | FComboBoxStyle | The style. | Components/ComboBoxString.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DefaultOptions | TArray< FString > | The default list of items to be displayed on the combobox. | Components/ComboBoxString.h |
|
| SelectedOption | FString | The item in the combobox to select by default | Components/ComboBoxString.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddOption
(
const FString& Option |
Components/ComboBoxString.h |
|
|
void ClearOptions() |
Components/ComboBoxString.h |
|
|
void ClearSelection() |
Components/ComboBoxString.h |
|
|
int32 FindOptionIndex
(
const FString& Option |
Components/ComboBoxString.h |
|
|
FMargin GetContentPadding() |
Get the padding for content. | Components/ComboBoxString.h | |
const FSlateFontInfo & GetFont() |
Get the default font for Combobox if no OnGenerateWidgetEvent is specified. | Components/ComboBoxString.h | |
FSlateColor GetForegroundColor() |
Get the foreground color of the button. | Components/ComboBoxString.h | |
const FTableRowStyle & GetItemStyle() |
Get the style of the items. | Components/ComboBoxString.h | |
float GetMaxListHeight() |
Get the maximum height of the combobox list. | Components/ComboBoxString.h | |
FString GetOptionAtIndex
(
int32 Index |
Components/ComboBoxString.h |
|
|
int32 GetOptionCount() |
Returns the number of options | Components/ComboBoxString.h |
|
const FScrollBarStyle & GetScrollBarStyle() |
Get the style of the scrollbar. | Components/ComboBoxString.h | |
int32 GetSelectedIndex() |
Components/ComboBoxString.h |
|
|
FString GetSelectedOption() |
Components/ComboBoxString.h |
|
|
const FComboBoxStyle & GetWidgetStyle() |
Get the style of the combobox. | Components/ComboBoxString.h | |
bool IsEnableGamepadNavigationMode() |
Is the combobox navigated by gamepad. | Components/ComboBoxString.h | |
bool IsFocusable() |
Is the combobox focusable. | Components/ComboBoxString.h | |
bool IsHasDownArrow() |
Is the combobox arrow showing. | Components/ComboBoxString.h | |
bool IsOpen() |
Components/ComboBoxString.h |
|
|
void RefreshOptions () |
Refreshes the list of options. | Components/ComboBoxString.h |
|
bool RemoveOption
(
const FString& Option |
Components/ComboBoxString.h |
|
|
void SetContentPadding
(
FMargin InPadding |
Set the padding for content. | Components/ComboBoxString.h | |
void SetEnableGamepadNavigationMode
(
bool InEnableGamepadNavigationMode |
Set whether the combobox is navigated by gamepad. | Components/ComboBoxString.h | |
void SetHasDownArrow
(
bool InHasDownArrow |
Set whether the combobox arrow is showing. | Components/ComboBoxString.h | |
void SetItemStyle
(
const FTableRowStyle& InItemStyle |
Set the style of the items. | Components/ComboBoxString.h | |
void SetMaxListHeight
(
float InMaxHeight |
Set the maximum height of the combobox list. | Components/ComboBoxString.h | |
void SetSelectedIndex
(
const int32 Index |
Components/ComboBoxString.h |
|
|
void SetSelectedOption
(
FString Option |
Components/ComboBoxString.h |
|
|
void SetWidgetStyle
(
const FComboBoxStyle& InWidgetStyle |
Set the style of the combobox. | Components/ComboBoxString.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const FText GetPaletteCategory() |
Gets the palette category of the widget | Components/ComboBoxString.h |
Overridden from UVisual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ReleaseSlateResources
(
bool bReleaseChildren |
Components/ComboBoxString.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostInitProperties() |
Components/ComboBoxString.h | ||
virtual void PostLoad() |
Components/ComboBoxString.h | ||
virtual void Serialize
(
FArchive& Ar |
Components/ComboBoxString.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< SWidget > HandleGenerateWidget
(
TSharedPtr< FString > Item |
Called by slate when it needs to generate a new item for the combobox | Components/ComboBoxString.h | |
virtual void HandleOpening() |
Called by slate when the underlying combobox is opening | Components/ComboBoxString.h | |
virtual void HandleSelectionChanged
(
TSharedPtr< FString > Item, |
Called by slate when the underlying combobox selection changes | Components/ComboBoxString.h | |
void InitFont
(
FSlateFontInfo InFont |
Initialize the default font in the constructor before the SWidget is constructed. | Components/ComboBoxString.h | |
void InitForegroundColor
(
FSlateColor InForegroundColor |
Initialize ForegroundColor in the constructor before the SWidget is constructed. | Components/ComboBoxString.h | |
void InitIsFocusable
(
bool InIsFocusable |
Initialize IsFocusable in the constructor before the SWidget is constructed. | Components/ComboBoxString.h | |
void InitScrollBarStyle
(
const FScrollBarStyle& InScrollBarStyle |
Initialize the scrollbar style in the constructor before the SWidget is constructed. | Components/ComboBoxString.h | |
void UpdateOrGenerateWidget
(
TSharedPtr< FString > Item |
Refresh ComboBoxContent with the correct widget/data when the selected option changes | Components/ComboBoxString.h |
Overridden from UWidget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< SWidget > RebuildWidget() |
Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed. | Components/ComboBoxString.h |