//简单智能
SNew(STextComboBox).ContentPadding(5).OptionsSource(&Options).InitiallySelectedItem(Options[0]).OnSelectionChanged(this, &FEditorModeTestEdModeToolkit::OnPresetChanged)
//选择改变后的方法
voidFEditorModeTestEdModeToolkit::OnPresetChanged(TSharedPtr<FString> NewSelection, ESelectInfo::TypeSelectInfo)
{
if (SelectInfo != ESelectInfo::Direct)
{
FString const NewPresetName = *NewSelection.Get();
for (int i=0;i < Options.Num();i++)
{
if (*Options[i] == NewPresetName)
{
}
}
}
}
//灵活复杂
SNew(SComboBox<FComboItemType>)
.ContentPadding(5)
.OptionsSource(&Options)
.InitiallySelectedItem(Options[0])