Hello.
Inside of my FMyPluginEdModeToolkit::FMyPluginEdModeToolkit(){...}
, reacting to button click I would like to disable the “left” button. But how to call that “left” button from inside of OnButtonClick(...)
?
The code is based on sample plugin:
MyPluginEdModeToolkit::FMyPluginEdModeToolkit()
struct Locals{
static FReply OnButtonClick(FVector InOffset){
//how do disable the "left" button here?
return FReply::Handled();
}
static TSharedRef<SWidget> MakeButton(FText InLabel, const FVector InOffset){
return SNew(SButton).Text(InLabel).OnClicked_Static(&Locals::OnButtonClick, InOffset);
}
};
const float Factor = 256.0f;
SAssignNew(ToolkitWidget, SBorder).HAlign(HAlign_Center).Padding(25)
.IsEnabled_Static(&Locals::IsWidgetEnabled)
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.AutoHeight().HAlign(HAlign_Center).Padding(50)
[
SNew(STextBlock)
.AutoWrapText(true)
.Text(LOCTEXT("HelperLabel", "Plugin description."))
]
+SVerticalBox::Slot()
.HAlign(HAlign_Center).AutoHeight()
[
Locals::MakeButton(LOCTEXT("UpButtonLabel", "Up"), FVector(0, 0, Factor))
]
+SVerticalBox::Slot()
.HAlign(HAlign_Center).AutoHeight()
[
SNew(SHorizontalBox)
+SHorizontalBox::Slot().AutoWidth()
[
Locals::MakeButton(LOCTEXT("LeftButtonLabel", "Left"), FVector(0, -Factor, 0))
]
+SHorizontalBox::Slot().AutoWidth()
[
Locals::MakeButton(LOCTEXT("RightButtonLabel", "Right"), FVector(0, Factor, 0))
]
]
];