Files
UnrealEngineUWP/Engine/Source/Runtime/Slate/Private/Framework/MultiBox/SHeadingBlock.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

59 lines
1.4 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "Framework/MultiBox/SHeadingBlock.h"
/**
* Constructor
*
* @param InHeadingText Heading text
*/
FHeadingBlock::FHeadingBlock( const FName& InExtensionHook, const TAttribute< FText >& InHeadingText )
: FMultiBlock( NULL, NULL, InExtensionHook, EMultiBlockType::Heading )
, HeadingText( InHeadingText )
{
}
/**
* Allocates a widget for this type of MultiBlock. Override this in derived classes.
*
* @return MultiBlock widget object
*/
TSharedRef< class IMultiBlockBaseWidget > FHeadingBlock::ConstructWidget() const
{
return SNew( SHeadingBlock );
}
/**
* Construct this widget
*
* @param InArgs The declaration data for this widget
*/
void SHeadingBlock::Construct( const FArguments& InArgs )
{
}
/**
* Builds this MultiBlock widget up from the MultiBlock associated with it
*/
void SHeadingBlock::BuildMultiBlockWidget(const ISlateStyle* StyleSet, const FName& StyleName)
{
TSharedRef< const FHeadingBlock > HeadingBlock = StaticCastSharedRef< const FHeadingBlock >( MultiBlock.ToSharedRef() );
// Add this widget to the search list of the multibox
if (MultiBlock->GetSearchable())
OwnerMultiBoxWidget.Pin()->AddSearchElement(this->AsWidget(), FText::GetEmpty());
ChildSlot
.Padding( 2.0f )
[
SNew( STextBlock )
.Text( HeadingBlock->HeadingText )
.TextStyle( StyleSet, ISlateStyle::Join( StyleName, ".Heading" ) )
];
}