本文整理汇总了C++中TSharedRef::GetExcerptContent方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedRef::GetExcerptContent方法的具体用法?C++ TSharedRef::GetExcerptContent怎么用?C++ TSharedRef::GetExcerptContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedRef
的用法示例。
在下文中一共展示了TSharedRef::GetExcerptContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DesiredExcerpt
TSharedPtr<SWidget> SGraphNodeDocumentation::CreateDocumentationPage()
{
TSharedPtr<SWidget> DocumentationWidget;
if( IDocumentation::Get()->PageExists( GraphNode->GetDocumentationLink() ))
{
TSharedRef< IDocumentationPage > DocumentationPage = IDocumentation::Get()->GetPage( GraphNode->GetDocumentationLink(), NULL );
TMap< FString, FString > InVariables;
FExcerpt DesiredExcerpt( GraphNode->GetDocumentationExcerptName(), SNullWidget::NullWidget, InVariables, 0 );
// Set attributes to control documentation WrapAt and optional width
DocumentationPage->SetTextWrapAt( TAttribute<float>( this, &SGraphNodeDocumentation::GetDocumentationWrapWidth ) );
if( DocumentationPage->GetExcerptContent( DesiredExcerpt ))
{
// Create Content
SAssignNew( DocumentationWidget, SBox )
.WidthOverride( this, &SGraphNodeDocumentation::GetContentWidth )
.HeightOverride( this, &SGraphNodeDocumentation::GetContentHeight )
[
SAssignNew( ContentWidget, SVerticalBox )
+SVerticalBox::Slot()
.Padding( GraphNodeDocumentationDefs::DefaultContentBorder )
[
SNew( SBorder )
.HAlign( HAlign_Left )
.Content()
[
SNew( SScrollBox )
+SScrollBox::Slot()
[
DesiredExcerpt.Content.ToSharedRef()
]
]
]
];
// Find Maximum Content area for resizing
UserSize = GraphNodeDocumentationDefs::MaximumNodeSize;
ContentWidget->SlatePrepass();
DocumentationSize = ContentWidget->GetDesiredSize();
if( GraphNode->NodeWidth != 0.f && GraphNode->NodeHeight != 0.f )
{
// restore node size
UserSize.X = GraphNode->NodeWidth;
UserSize.Y = GraphNode->NodeHeight;
}
else
{
// set initial size
UserSize = GraphNodeDocumentationDefs::DefaultContentSize;
ContentWidget->SlatePrepass();
UserSize = ContentWidget->GetDesiredSize();
}
}
}
if( !DocumentationWidget.IsValid() )
{
// Create Placeholder
SAssignNew( DocumentationWidget, SBox )
.WidthOverride( this, &SGraphNodeDocumentation::GetContentWidth )
.HeightOverride( this, &SGraphNodeDocumentation::GetContentHeight )
[
SAssignNew( ContentWidget, SVerticalBox )
+SVerticalBox::Slot()
.Padding( GraphNodeDocumentationDefs::DefaultContentBorder )
[
SNew( SBorder )
.HAlign( HAlign_Left )
.Content()
[
SNew( SScrollBox )
+SScrollBox::Slot()
[
SNew( STextBlock )
.WrapTextAt( this, &SGraphNodeDocumentation::GetDocumentationWrapWidth )
.Text( LOCTEXT( "InvalidContentNotification", "No valid content to display.Please choose a valid link and excerpt in the details panel" ))
]
]
]
];
// Find Maximum Content area for resizing
UserSize = GraphNodeDocumentationDefs::PlaceholderContentSize;
DocumentationSize = GraphNodeDocumentationDefs::PlaceholderContentSize;
}
// Cache link/excerpt this widget was based on
CachedDocumentationLink = GraphNode->GetDocumentationLink();
CachedDocumentationExcerpt = GraphNode->GetDocumentationExcerptName();
return DocumentationWidget;
}