本文整理汇总了C++中TSharedRef::GetContent方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedRef::GetContent方法的具体用法?C++ TSharedRef::GetContent怎么用?C++ TSharedRef::GetContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedRef
的用法示例。
在下文中一共展示了TSharedRef::GetContent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PushMenu
void PushMenu(TSharedRef<FMenuBase> InMenu, const FVector2D& InLocation)
{
check(InMenu->GetContent().IsValid());
TSharedPtr<SWindow> ParentWindow = InMenu->GetParentWindow();
check(ParentWindow.IsValid());
// Transform InLocation into a position local to this panel (assumes the panel is in an overlay that covers the whole of the panel window)
FVector2D PanelInScreen = ParentWindow->GetRectInScreen().GetTopLeft();
FVector2D PanelInWindow = ParentWindow->GetLocalToScreenTransform().Inverse().TransformPoint(PanelInScreen);
FVector2D LocationInWindow = ParentWindow->GetLocalToScreenTransform().Inverse().TransformPoint(InLocation);
FVector2D LocationInPanel = LocationInWindow - PanelInWindow;
// Add the new menu into a slot on this panel and set the padding so that its position is correct
AddSlot()
.HAlign(HAlign_Left)
.VAlign(VAlign_Top)
.Padding(LocationInPanel.X, LocationInPanel.Y, 0, 0)
[
InMenu->GetContent().ToSharedRef()
];
// Make sure that the menu will remove itself from the panel when dismissed
InMenu->GetOnMenuDismissed().AddSP(this, &SMenuPanel::OnMenuClosed);
}
示例2: InvokeSizeMapTab
virtual void InvokeSizeMapTab(const TArray<FName>& AssetPackageNames) override
{
TSharedRef<SDockTab> NewTab = FGlobalTabmanager::Get()->InvokeTab( SizeMapTabId );
TSharedRef<SSizeMap> SizeMap = StaticCastSharedRef<SSizeMap>( NewTab->GetContent() );
SizeMap->SetRootAssetPackageNames( AssetPackageNames );
}
示例3: InvokeReferenceViewerTab
virtual void InvokeReferenceViewerTab(const TArray<FName>& GraphRootPackageNames) override
{
TSharedRef<SDockTab> NewTab = FGlobalTabmanager::Get()->InvokeTab( ReferenceViewerTabId );
TSharedRef<SReferenceViewer> ReferenceViewer = StaticCastSharedRef<SReferenceViewer>( NewTab->GetContent() );
ReferenceViewer->SetGraphRootPackageNames(GraphRootPackageNames);
}
示例4: OnMenuClosed
void OnMenuClosed(TSharedRef<IMenu> InMenu)
{
RemoveSlot(InMenu->GetContent().ToSharedRef());
}