2024-01-25 11:21:15 +08:00

27 lines
631 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "SChannelNodeButton.h"
#include "SButton.h"
#include "SlateOptMacros.h"
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SChannelNodeButton::Construct(const FArguments& InArgs, FChannelNode* InChannelNode)
{
ChannelNode = InChannelNode;
OnClickedDelegate = InArgs._OnClickedDelegate;
ChildSlot
[
SNew(SButton)
.Text(FText::FromString(ChannelNode->GetName()))
.OnClicked_Lambda([this]() -> FReply
{
OnClickedDelegate.ExecuteIfBound(ChannelNode);
return FReply::Handled();
})
];
}
END_SLATE_FUNCTION_BUILD_OPTIMIZATION