UComboBoxString

The combobox allows you to display a list of options to the user in a dropdown menu for them to select one.

Windows
MacOS
Linux

Inheritance Hierarchy

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

Name Description

Public variable

bool

 

bIsFocusable

Protected variable

TSharedPtr< SBo...

 

ComboBoxContent

A shared pointer to a container that holds the combobox content that is selected

Public variable

FMargin

 

ContentPadding

Protected variable

TSharedPtr< FSt...

 

CurrentOptionPtr

A shared pointer to the current selected string

Protected variable

TWeakPtr< SText...

 

DefaultComboBoxContent

If OnGenerateWidgetEvent is not bound, this will store the default STextBlock generated

Public variable

bool

 

EnableGamepadNavigationMode

When false, directional keys will change the selection.

Public variable

FSlateFontInfo

 

Font

The default font to use in the combobox, only applies if you're not implementing OnGenerateWidgetEvent to factory each new entry.

Public variable

FSlateColor

 

ForegroundColor

The foreground color to pass through the hierarchy.

Public variable

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.

Public variable

FTableRowStyle

 

ItemStyle

The item row style.

Public variable

float

 

MaxListHeight

The max height of the combobox list that opens

Protected variable

TSharedPtr< SCo...

 

MyComboBox

A shared pointer to the underlying slate combobox

Public variable

FGenerateWidget...

 

OnGenerateWidgetEvent

Called when the widget is needed for the item.

Public variable

FOnOpeningEvent

 

OnOpening

Called when the combobox is opening

Public variable

FOnSelectionCha...

 

OnSelectionChanged

Called when a new item is selected in the combobox.

Protected variable

TArray< TShared...

 

Options

The true objects bound to the Slate combobox.

Public variable

FComboBoxStyle

 

WidgetStyle

The style.

Constructors

Name Description

Public function

UComboBoxString

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

AddOption

(
    const FString& Option
)

Public function

void

 

ClearOptions()

Public function

void

 

ClearSelection()

Public function Const

int32

 

FindOptionIndex

(
    const FString& Option
)

Public function Const

FString

 

GetOptionAtIndex

(
    int32 Index
)

Public function Const

int32

 

GetOptionCount()

Returns the number of options

Public function Const

int32

 

GetSelectedIndex()

Public function Const

FString

 

GetSelectedOption()

Protected function Virtual Const

TSharedRef< ...

 

HandleGenerateWidget

(
    TSharedPtr< FString > Item
)

Called by slate when it needs to generate a new item for the combobox

Protected function Virtual

void

 

HandleOpening()

Called by slate when the underlying combobox is opening

Protected function Virtual

void

 

HandleSelectionChanged

(
    TSharedPtr< FString > Item,
    ESelectInfo::Type SelectionType
)

Called by slate when the underlying combobox selection changes

Public function Const

bool

 

IsOpen()

Public function

void

 

RefreshOptions()

Refreshes the list of options.

Public function

bool

 

RemoveOption

(
    const FString& Option
)

Public function

void

 

SetSelectedIndex

(
    const int32 Index
)

Public function

void

 

SetSelectedOption

(
    FString Option
)

Protected function

void

 

UpdateOrGenerateWidget

(
    TSharedPtr< FString > Item
)

Refresh ComboBoxContent with the correct widget/data when the selected option changes

Overridden from UWidget

Name Description

Public function Virtual

const FText

 

GetPaletteCategory()

Gets the palette category of the widget

Protected function Virtual

TSharedRef< ...

 

RebuildWidget()

Function implemented by all subclasses of UWidget is called when the underlying SWidget needs to be constructed.

Overridden from UVisual

Name Description

Public function Virtual

void

 

ReleaseSlateResources

(
    bool bReleaseChildren
)

Overridden from UObject

Name Description

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Classes

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss