Navigation
API > API/Runtime > API/Runtime/UMG > API/Runtime/UMG/Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UVisual
- UWidget
- UComboBoxString
- UEditorUtilityComboBoxString
References
| Module | UMG |
| Header | /Engine/Source/Runtime/UMG/Public/Components/ComboBoxString.h |
| Include | #include "Components/ComboBoxString.h" |
Syntax
class UComboBoxString : public UWidget
Remarks
The combobox allows you to display a list of options to the user in a dropdown menu for them to select one.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TSharedPtr< SBox > | ComboBoxContent | A shared pointer to a container that holds the combobox content that is selected | |
| TSharedPtr< FString > | CurrentOptionPtr | A shared pointer to the current selected string | |
| TWeakPtr< STextBlock > | DefaultComboBoxContent | If OnGenerateWidgetEvent is not bound, this will store the default STextBlock generated | |
| TSharedPtr< SComboBox< TSharedPtr< FString > > > | MyComboBox | A shared pointer to the underlying slate combobox | |
| FGenerateWidgetForString | OnGenerateWidgetEvent | Called when the widget is needed for the item. | |
| FOnOpeningEvent | OnOpening | Called when the combobox is opening | |
| FOnSelectionChangedEvent | OnSelectionChanged | Called when a new item is selected in the combobox. | |
| TArray< TSharedPtr< FString > > | Options | The true objects bound to the Slate combobox. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UComboBoxString
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | |||
| void | ClearOptions () |
||
| void | |||
| int32 | FindOptionIndex
(
const FString& Option |
||
| FMargin | Get the padding for content. | ||
| const FSlateFontInfo & | GetFont () |
Get the default font for Combobox if no OnGenerateWidgetEvent is specified. | |
| FSlateColor | Get the foreground color of the button. | ||
| const FTableRowStyle & | GetItemStyle () |
Get the style of the items. | |
| float | Get the maximum height of the combobox list. | ||
| FString | GetOptionAtIndex
(
int32 Index |
||
| int32 | Returns the number of options | ||
| const FScrollBarStyle & | Get the style of the scrollbar. | ||
| int32 | |||
| FString | |||
| const FComboBoxStyle & | Get the style of the combobox. | ||
| TSharedRef< SWidget > | HandleGenerateWidget
(
TSharedPtr< FString > Item |
Called by slate when it needs to generate a new item for the combobox | |
| void | Called by slate when the underlying combobox is opening | ||
| void | HandleSelectionChanged
(
TSharedPtr< FString > Item, |
Called by slate when the underlying combobox selection changes | |
| void | InitFont
(
FSlateFontInfo InFont |
Initialize the default font in the constructor before the SWidget is constructed. | |
| void | InitForegroundColor
(
FSlateColor InForegroundColor |
Initialize ForegroundColor in the constructor before the SWidget is constructed. | |
| void | InitIsFocusable
(
bool InIsFocusable |
Initialize IsFocusable in the constructor before the SWidget is constructed. | |
| void | InitScrollBarStyle
(
const FScrollBarStyle& InScrollBarStyle |
Initialize the scrollbar style in the constructor before the SWidget is constructed. | |
| bool | Is the combobox navigated by gamepad. | ||
| bool | IsFocusable () |
Is the combobox focusable. | |
| bool | Is the combobox arrow showing. | ||
| bool | IsOpen () |
||
| void | Refreshes the list of options. | ||
| bool | RemoveOption
(
const FString& Option |
||
| void | SetContentPadding
(
FMargin InPadding |
Set the padding for content. | |
| void | SetEnableGamepadNavigationMode
(
bool InEnableGamepadNavigationMode |
Set whether the combobox is navigated by gamepad. | |
| void | SetHasDownArrow
(
bool InHasDownArrow |
Set whether the combobox arrow is showing. | |
| void | SetItemStyle
(
const FTableRowStyle& InItemStyle |
Set the style of the items. | |
| void | SetMaxListHeight
(
float InMaxHeight |
Set the maximum height of the combobox list. | |
| void | SetSelectedIndex
(
const int32 Index |
||
| void | SetSelectedOption
(
FString Option |
||
| void | SetWidgetStyle
(
const FComboBoxStyle& InWidgetStyle |
Set the style of the combobox. | |
| void | UpdateOrGenerateWidget
(
TSharedPtr< FString > Item |
Refresh ComboBoxContent with the correct widget/data when the selected option changes |
Overridden from UWidget
| Type | Name | Description | |
|---|---|---|---|
| const FText | Gets the palette category of the widget | ||
| TSharedRef< SWidget > | Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed. |
Overridden from UVisual
| Type | Name | Description | |
|---|---|---|---|
| void | ReleaseSlateResources
(
bool bReleaseChildren |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | Called after the C++ constructor and after the properties have been initialized, including those loaded from config. | ||
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FOnOpeningEvent | |||
| FOnSelectionChangedEvent |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bIsFocusable | 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. | |
| FMargin | ContentPadding | Direct access to ContentPadding is deprecated. Please use the getter or setter. | |
| bool | EnableGamepadNavigationMode | Direct access to EnableGamepadNavigationMode is deprecated. Please use the getter or setter. | |
| FSlateFontInfo | Font | 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. | |
| FSlateColor | ForegroundColor | 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. | |
| bool | HasDownArrow | Direct access to HasDownArrow is deprecated. Please use the getter or setter. | |
| FTableRowStyle | ItemStyle | Direct access to ItemStyle is deprecated. Please use the getter or setter. | |
| float | MaxListHeight | Direct access to MaxListHeight is deprecated. Please use the getter or setter. | |
| FScrollBarStyle | ScrollBarStyle | 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. | |
| FComboBoxStyle | WidgetStyle | Direct access to WidgetStyle is deprecated. Please use the getter or setter. |