Files
PalUIExtension/Api/HorizontalBox.hpp

30 lines
1.1 KiB
C++
Raw Normal View History

2026-09-07 19:33:58 -04:00
#pragma once
#include "PanelWidget.hpp"
#include "HorizontalBoxSlot.hpp"
namespace PalUIExtension::Api
{
// UHorizontalBox : public UPanelWidget directly -- same shape as
// Overlay. Every generic panel operation is already on PanelWidget;
// AddChildToHorizontalBox exists only to hand back the concrete slot
// type instead of the generic UPanelSlot* AddChild() returns.
class HorizontalBox : public PanelWidget
{
public:
static auto ClassPath() -> const TCHAR* { return STR("/Script/UMG.HorizontalBox"); }
static auto DebugTag() -> const TCHAR* { return STR("HorizontalBox"); }
HorizontalBox() = default;
explicit HorizontalBox(UObject* Obj)
: PanelWidget(Obj, ClassOf<HorizontalBox>(), DebugTag()) {}
auto AddChildToHorizontalBox(UObject* Content) -> HorizontalBoxSlot
{
struct P { UObject* Content; UObject* ReturnValue; } p{ Content, nullptr };
auto Result = CallForReturn(STR("AddChildToHorizontalBox"), p, &P::ReturnValue);
return (Result && *Result) ? HorizontalBoxSlot{ *Result } : HorizontalBoxSlot{};
}
};
}