50 lines
2.1 KiB
C++
50 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include "PanelSlot.hpp"
|
|
|
|
namespace PalUIExtension::Api
|
|
{
|
|
// Same four-member surface as HorizontalBoxSlot. Kept separate for
|
|
// the same reason -- see HorizontalBoxSlot.hpp.
|
|
class VerticalBoxSlot : public PanelSlot
|
|
{
|
|
public:
|
|
static auto ClassPath() -> const TCHAR* { return STR("/Script/UMG.VerticalBoxSlot"); }
|
|
static auto DebugTag() -> const TCHAR* { return STR("VerticalBoxSlot"); }
|
|
|
|
VerticalBoxSlot() = default;
|
|
explicit VerticalBoxSlot(UObject* Obj)
|
|
: PanelSlot(Obj, ClassOf<VerticalBoxSlot>(), DebugTag()) {}
|
|
|
|
// ---- setters (write through the UFUNCTION so SynchronizeProperties runs)
|
|
|
|
auto SetSize(FSlateChildSize_ InSize) -> bool
|
|
{
|
|
struct P { FSlateChildSize_ InSize; } p{ InSize };
|
|
return Call(STR("SetSize"), p);
|
|
}
|
|
auto SetPadding(FMargin_ InPadding) -> bool
|
|
{
|
|
struct P { FMargin_ InPadding; } p{ InPadding };
|
|
return Call(STR("SetPadding"), p);
|
|
}
|
|
auto SetHorizontalAlignment(EHorizontalAlignment_ InHorizontalAlignment) -> bool
|
|
{
|
|
struct P { EHorizontalAlignment_ InHorizontalAlignment; } p{ InHorizontalAlignment };
|
|
return Call(STR("SetHorizontalAlignment"), p);
|
|
}
|
|
auto SetVerticalAlignment(EVerticalAlignment_ InVerticalAlignment) -> bool
|
|
{
|
|
struct P { EVerticalAlignment_ InVerticalAlignment; } p{ InVerticalAlignment };
|
|
return Call(STR("SetVerticalAlignment"), p);
|
|
}
|
|
|
|
// ---- property reads
|
|
|
|
auto GetSize() const -> std::optional<FSlateChildSize_> { return PropertyValue<FSlateChildSize_>(STR("Size")); }
|
|
auto GetPadding() const -> std::optional<FMargin_> { return PropertyValue<FMargin_>(STR("Padding")); }
|
|
auto GetHorizontalAlignment() const -> std::optional<EHorizontalAlignment_> { return PropertyValue<EHorizontalAlignment_>(STR("HorizontalAlignment")); }
|
|
auto GetVerticalAlignment() const -> std::optional<EVerticalAlignment_> { return PropertyValue<EVerticalAlignment_>(STR("VerticalAlignment")); }
|
|
};
|
|
}
|