Hello.
I was trying to add SNumericEntryBox
to my plug-in (for now I have SButton
working on).
I done it with:
SNew(SNumericEntryBox<int32>)
.AllowSpin(true)
.MinValue(1).MaxValue(1000)
.MinSliderValue(1).MaxSliderValue(1000).Value(100)
I can now see the numeric entry box in my plug-in.
But when I wanted to handle value change event, adding .OnValueChanged(&Locals::numberChanged)
:
SNew(SNumericEntryBox<int32>)
.AllowSpin(true)
.MinValue(1).MaxValue(1000)
.MinSliderValue(1).MaxSliderValue(1000).Value(100)
.OnValueChanged(&Locals::numberChanged)
With following Locals
structure:
FCopyPluginEdModeToolkit::FCopyPluginEdModeToolkit()
{
struct Locals
{
static void numberChanged(int32 copies){
OnButtonClick(FVector{ 0.0f, 0.0f, float(copies) }); //or whatever code here
}
static FReply OnButtonClick(FVector InOffset){
//that works fine for SButton
//...
}
...
I got an compile-time error:
error C2664: 'SNumericEntryBox<int32>::FArguments &SNumericEntryBox<int32>::FArguments::OnValueChanged(const TBaseDelegate<void,int32> &)' : cannot convert argument 1 from 'void (__cdecl *)(int32)' to 'const TBaseDelegate<void,int32> &'