UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SComboBox< OptionType > Class Template Reference

#include <SComboBox.h>

+ Inheritance diagram for SComboBox< OptionType >:

Public Types

typedef TListTypeTraits< OptionTypeListTypeTraits
 
typedef TListTypeTraits< OptionType >::NullableType NullableOptionType
 
typedef SListView< OptionTypeSComboListType
 
typedef TSlateDelegates< OptionType >::FOnGenerateWidget FOnGenerateWidget
 
typedef TSlateDelegates< NullableOptionType >::FOnSelectionChanged FOnSelectionChanged
 

Public Member Functions

 SLATE_BEGIN_ARGS (SComboBox)
 
void Construct (const FArguments &InArgs)
 
 SComboBox ()
 
void ClearSelection ()
 
void SetSelectedItem (NullableOptionType InSelectedItem)
 
void SetEnableGamepadNavigationMode (bool InEnableGamepadNavigationMode)
 
void SetMaxHeight (float InMaxHeight)
 
void SetStyle (const FComboBoxStyle *InStyle)
 
void InvalidateStyle ()
 
void SetItemStyle (const FTableRowStyle *InItemStyle)
 
void InvalidateItemStyle ()
 
NullableOptionType GetSelectedItem ()
 
void SetItemsSource (const TArray< OptionType > *InListItemsSource)
 
void SetItemsSource (TSharedRef<::UE::Slate::Containers::TObservableArray< OptionType > > InListItemsSource)
 
void ClearItemsSource ()
 
void RefreshOptions ()
 
- Public Member Functions inherited from SComboButton
 SLATE_BEGIN_ARGS (SComboButton)
 
virtual SLATE_API void SetMenuContent (TSharedRef< SWidget > InContent) override
 
SLATE_API void SetOnGetMenuContent (FOnGetContent InOnGetMenuContent)
 
SLATE_API void Construct (const FArguments &InArgs)
 
void SetMenuContentWidgetToFocus (TWeakPtr< SWidget > InWidgetToFocusPtr)
 
SLATE_API void SetButtonContentPadding (FMargin InPadding)
 
SLATE_API void SetHasDownArrow (bool InHasArrowDown)
 

Protected Member Functions

FReply OnKeyDown (const FGeometry &MyGeometry, const FKeyEvent &InKeyEvent) override
 
virtual bool SupportsKeyboardFocus () const override
 
virtual bool IsInteractable () const
 
- Protected Member Functions inherited from SComboButton
SLATE_API FText GetFilteredToolTipText (TAttribute< FText > ToolTipText) const
 

Additional Inherited Members

- Protected Attributes inherited from SComboButton
SHorizontalBox::FSlotButtonContentSlot
 
FOnComboBoxOpened OnComboBoxOpened
 
TWeakPtr< SWidgetWidgetToFocusPtr
 
const FSlateBrushMenuBorderBrush
 
FMargin MenuBorderPadding
 
TWeakPtr< SWidgetContentWidgetPtr
 
bool bIsFocusable
 

Detailed Description

template<typename OptionType>
class SComboBox< OptionType >

A combo box that shows arbitrary content.

Member Typedef Documentation

◆ FOnGenerateWidget

template<typename OptionType >
typedef TSlateDelegates<OptionType>::FOnGenerateWidget SComboBox< OptionType >::FOnGenerateWidget

Delegate type used to generate widgets that represent Options

◆ FOnSelectionChanged

template<typename OptionType >
typedef TSlateDelegates<NullableOptionType>::FOnSelectionChanged SComboBox< OptionType >::FOnSelectionChanged

◆ ListTypeTraits

◆ NullableOptionType

template<typename OptionType >
typedef TListTypeTraits<OptionType>::NullableType SComboBox< OptionType >::NullableOptionType

◆ SComboListType

Type of list used for showing menu options.

Constructor & Destructor Documentation

◆ SComboBox()

Member Function Documentation

◆ ClearItemsSource()

template<typename OptionType >
void SComboBox< OptionType >::ClearItemsSource ( )
inline

Clears current item source

◆ ClearSelection()

template<typename OptionType >
void SComboBox< OptionType >::ClearSelection ( )
inline

◆ Construct()

template<typename OptionType >
void SComboBox< OptionType >::Construct ( const FArguments &  InArgs)
inline

Slot for this button's content (optional) The visual style of the button part of the combo box (overrides ComboBoxStyle) Called when combo box is opened, before list is actually created The custom scrollbar to use in the ListView The option that should be selected when the combo box is first created The max height of the combo box menu The sound to play when the button is pressed (overrides ComboBoxStyle) The sound to play when the selection changes (overrides ComboBoxStyle) 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. When false, directional keys will change the selection. When true, ComboBox must be activated and will only capture arrow input while activated. When true, allows the combo box to receive keyboard focus True if this combo's menu should be collapsed when our parent receives focus, false (default) otherwise Construct the widget from a declaration

Parameters
InArgsDeclaration from which to construct the combo box

◆ GetSelectedItem()

template<typename OptionType >
NullableOptionType SComboBox< OptionType >::GetSelectedItem ( )
inline
Returns
the item currently selected by the combo box.

◆ InvalidateItemStyle()

template<typename OptionType >
void SComboBox< OptionType >::InvalidateItemStyle ( )
inline

◆ InvalidateStyle()

template<typename OptionType >
void SComboBox< OptionType >::InvalidateStyle ( )
inline

◆ IsInteractable()

template<typename OptionType >
virtual bool SComboBox< OptionType >::IsInteractable ( ) const
inlineprotectedvirtual

◆ OnKeyDown()

template<typename OptionType >
FReply SComboBox< OptionType >::OnKeyDown ( const FGeometry MyGeometry,
const FKeyEvent InKeyEvent 
)
inlineoverrideprotectedvirtual

Handle key presses that SListView ignores

Reimplemented from SComboButton.

◆ RefreshOptions()

template<typename OptionType >
void SComboBox< OptionType >::RefreshOptions ( )
inline

Requests a list refresh after updating options Call SetSelectedItem to update the selected item if required

See also
SetSelectedItem

◆ SetEnableGamepadNavigationMode()

template<typename OptionType >
void SComboBox< OptionType >::SetEnableGamepadNavigationMode ( bool  InEnableGamepadNavigationMode)
inline

◆ SetItemsSource() [1/2]

template<typename OptionType >
void SComboBox< OptionType >::SetItemsSource ( const TArray< OptionType > *  InListItemsSource)
inline

Sets new item source

◆ SetItemsSource() [2/2]

template<typename OptionType >
void SComboBox< OptionType >::SetItemsSource ( TSharedRef<::UE::Slate::Containers::TObservableArray< OptionType > >  InListItemsSource)
inline

Sets new item source

◆ SetItemStyle()

template<typename OptionType >
void SComboBox< OptionType >::SetItemStyle ( const FTableRowStyle InItemStyle)
inline

◆ SetMaxHeight()

template<typename OptionType >
void SComboBox< OptionType >::SetMaxHeight ( float  InMaxHeight)
inline

◆ SetSelectedItem()

template<typename OptionType >
void SComboBox< OptionType >::SetSelectedItem ( NullableOptionType  InSelectedItem)
inline

◆ SetStyle()

template<typename OptionType >
void SComboBox< OptionType >::SetStyle ( const FComboBoxStyle InStyle)
inline

◆ SLATE_BEGIN_ARGS()

template<typename OptionType >
SComboBox< OptionType >::SLATE_BEGIN_ARGS ( SComboBox< OptionType )
inline

◆ SupportsKeyboardFocus()

template<typename OptionType >
virtual bool SComboBox< OptionType >::SupportsKeyboardFocus ( ) const
inlineoverrideprotectedvirtual

The documentation for this class was generated from the following file: