Navigation
API > API/Runtime > API/Runtime/UMG > API/Runtime/UMG/Components
Inheritance Hierarchy
References
| Module | UMG |
| Header | /Engine/Source/Runtime/UMG/Public/Components/ComboBoxString.h |
| Include | #include "Components/ComboBoxString.h" |
Syntax
UCLASS (Meta=(DisplayName="ComboBox (String)"), MinimalAPI)
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 | |
|---|---|---|---|
| bool | bIsFocusable | ||
| TSharedPtr< SBox > | ComboBoxContent | A shared pointer to a container that holds the combobox content that is selected | |
| FMargin | ContentPadding | ||
| 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 | |
| bool | EnableGamepadNavigationMode | When false, directional keys will change the selection. | |
| FSlateFontInfo | Font | The default font to use in the combobox, only applies if you're not implementing OnGenerateWidgetEvent to factory each new entry. | |
| FSlateColor | ForegroundColor | The foreground color to pass through the hierarchy. | |
| bool | HasDownArrow | 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. | |
| FTableRowStyle | ItemStyle | The item row style. | |
| float | MaxListHeight | The max height of the combobox list that opens | |
| 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. | |
| FScrollBarStyle | ScrollBarStyle | The scroll bar style. | |
| FComboBoxStyle | WidgetStyle | The style. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
UComboBoxString
(
const FObjectInitializer& ObjectInitializer |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddOption
(
const FString& Option |
||
| 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 | |||
| void | PostLoad () |
||
| void | Refreshes the list of options. | ||
| bool | RemoveOption
(
const FString& Option |
||
| void | Serialize
(
FArchive& Ar |
||
| 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 |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FOnOpeningEvent | |||
| FOnSelectionChangedEvent |