You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
81 lines
1.8 KiB
C++
81 lines
1.8 KiB
C++
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Components/VerticalBoxSlot.h"
|
|
#include "Components/Widget.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// UVerticalBoxSlot
|
|
|
|
UVerticalBoxSlot::UVerticalBoxSlot(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
, Slot(NULL)
|
|
{
|
|
HorizontalAlignment = HAlign_Fill;
|
|
VerticalAlignment = VAlign_Fill;
|
|
Size = FSlateChildSize(ESlateSizeRule::Automatic);
|
|
}
|
|
|
|
void UVerticalBoxSlot::ReleaseSlateResources(bool bReleaseChildren)
|
|
{
|
|
Super::ReleaseSlateResources(bReleaseChildren);
|
|
|
|
Slot = NULL;
|
|
}
|
|
|
|
void UVerticalBoxSlot::BuildSlot(TSharedRef<SVerticalBox> VerticalBox)
|
|
{
|
|
Slot = &VerticalBox->AddSlot()
|
|
.Padding(Padding)
|
|
.HAlign(HorizontalAlignment)
|
|
.VAlign(VerticalAlignment)
|
|
[
|
|
Content == NULL ? SNullWidget::NullWidget : Content->TakeWidget()
|
|
];
|
|
|
|
Slot->SizeParam = UWidget::ConvertSerializedSizeParamToRuntime(Size);
|
|
}
|
|
|
|
void UVerticalBoxSlot::SetPadding(FMargin InPadding)
|
|
{
|
|
Padding = InPadding;
|
|
if ( Slot )
|
|
{
|
|
Slot->Padding(InPadding);
|
|
}
|
|
}
|
|
|
|
void UVerticalBoxSlot::SetSize(FSlateChildSize InSize)
|
|
{
|
|
Size = InSize;
|
|
if ( Slot )
|
|
{
|
|
Slot->SizeParam = UWidget::ConvertSerializedSizeParamToRuntime(InSize);
|
|
}
|
|
}
|
|
|
|
void UVerticalBoxSlot::SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment)
|
|
{
|
|
HorizontalAlignment = InHorizontalAlignment;
|
|
if ( Slot )
|
|
{
|
|
Slot->HAlign(InHorizontalAlignment);
|
|
}
|
|
}
|
|
|
|
void UVerticalBoxSlot::SetVerticalAlignment(EVerticalAlignment InVerticalAlignment)
|
|
{
|
|
VerticalAlignment = InVerticalAlignment;
|
|
if ( Slot )
|
|
{
|
|
Slot->VAlign(InVerticalAlignment);
|
|
}
|
|
}
|
|
|
|
void UVerticalBoxSlot::SynchronizeProperties()
|
|
{
|
|
SetPadding(Padding);
|
|
SetSize(Size);
|
|
SetHorizontalAlignment(HorizontalAlignment);
|
|
SetVerticalAlignment(VerticalAlignment);
|
|
}
|