SComboButton clickable

Hello, i have create a combo button for the UE4 Editor in a different tab window.

+ SHorizontalBox::Slot()
                    .AutoWidth()
                    .VAlign(VAlign_Center)
                    .Padding(1,1,3,1)
                    [
                        SNew(SComboButton)
                        .VAlign(VAlign_Center)
                        .HAlign(HAlign_Left)    
                        .HasDownArrow(true)
                        .ButtonContent()
                        [
                                SNew(STextBlock)
                                .Text(FText::FromString(TEXT("Tests")))
                        ]
                        .MenuContent()
                        [
                            SNew(SVerticalBox)
                            + SVerticalBox::Slot()
                            .AutoHeight()
                            [
                                SNew(STextBlock)
                                .Text(FText::FromString(TEXT("Test 1")))
                            ]
                            + SVerticalBox::Slot()
                            .AutoHeight()
                            [
                                SNew(STextBlock)
                                .Text(FText::FromString(TEXT("Test 2")))
                            ]
                        ]

This is the code in the ChildSlot of the Tab window. I cant figure out what I need to put in order the Test1 and Test2 texts to be clickable… Any ideas?? Also, is there any good guide for the slate components??? Because i havent find anything good to be honest…

Thanks in advance!

If you want to see how different slate components are made you can check out the WidgetGallery.

you can visualize it by going to Window → Developer Tools → Debug Tools → Test Suite

Then select the Widget Gallery Tab.


The code for these slate examples can be found here:

C:\Program Files\Epic Games\UE_4.25\Engine\Source\Runtime\AppFramework\Private\Framework\Testing\SWidgetGallery.(h/cpp)

this didn’t helped at all. Ok, i can see the .cpp and .h of SButton, SCheckBox etc, but not the .cpp of the implementation…

I’m not sure what you mean, if you look at line 345 in the cpp of SWidgetGallery you will find the implementation of the SComboButton, where you will see that you will need to add an SButton if you want to make your Test 1 and Test 2 clickable.

Its the same thing, but for one reason mine is not clickable.

Yours does not have a button in the menu content, you can see the SWidgetGallery one has a SButton “Arbibratrary” in the second vertical box slot.

.MenuContent()
[
	SNew(SVerticalBox)

	+ SVerticalBox::Slot()
		.AutoHeight()
		[
			SNew(STextBlock)
				.Text(LOCTEXT("ComboButtonItemLabel01", "Combo\n     Button\n  menu\n       content supports"))
		]

	+ SVerticalBox::Slot()
		.AutoHeight()
		.HAlign(HAlign_Center)
		[
			SNew(SButton)
				[ 
					SNew(STextBlock)
						.Text(LOCTEXT("ComboButtonItemLabel02", "arbitrary"))
				]
		]

	+ SVerticalBox::Slot()
		.AutoHeight()
		[
			SNew(STextBlock)
				.Text(LOCTEXT("ComboButtonItemLabel03", "widgets"))
		]
]