当前位置: 首页>>代码示例>>C++>>正文


C++ TSharedRef::GetExcerptContent方法代码示例

本文整理汇总了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;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:90,代码来源:SGraphNodeDocumentation.cpp


注:本文中的TSharedRef::GetExcerptContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。