Files
UnrealEngineUWP/Engine/Source/Editor/ClassViewer/Private/ClassViewerModule.cpp
Wes Hunt 31e2bb00ac Removed a bunch of stuff from Slate standard include, created SlateBasics.h
* Moved Slate.h into SlateBasics.h and began shifting less commonly used headers into SlateExtras.h.
* Slate.h now simply includes SlateBasics.h and SlateExtras.h.
* Slate.h includes a deprecated warning now to indicate that SlateBasics.h + specific includes should be used instead.
* Moved dozens of inlined functions using Slate widgets into .cpp files to avoid header dependencies.
* All code samples now include SlateBasics.h and SlateExtras.h so future shifts will not break most those projects, but not trigger the deprecation warning of including Slate.h.
#BUN

[CL 2329610 by Wes Hunt in Main branch]
2014-10-14 22:50:06 -04:00

62 lines
2.0 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "ClassViewerPrivatePCH.h"
#include "Editor/ClassViewer/Private/SClassViewer.h"
#include "Editor/WorkspaceMenuStructure/Public/WorkspaceMenuStructureModule.h"
#include "ModuleManager.h"
#include "SDockTab.h"
IMPLEMENT_MODULE( FClassViewerModule, ClassViewer );
namespace ClassViewerModule
{
static const FName ClassViewerApp = FName("ClassViewerApp");
}
TSharedRef<SDockTab> CreateClassPickerTab( const FSpawnTabArgs& Args )
{
FClassViewerInitializationOptions InitOptions;
InitOptions.Mode = EClassViewerMode::ClassBrowsing;
InitOptions.DisplayMode = EClassViewerDisplayMode::TreeView;
return SNew(SDockTab)
.TabRole( ETabRole::NomadTab )
[
SNew( SClassViewer, InitOptions )
.OnClassPickedDelegate(FOnClassPicked())
];
}
void FClassViewerModule::StartupModule()
{
FGlobalTabmanager::Get()->RegisterNomadTabSpawner( ClassViewerModule::ClassViewerApp, FOnSpawnTab::CreateStatic( &CreateClassPickerTab ) )
.SetDisplayName( NSLOCTEXT("ClassViewerApp", "TabTitle", "Class Viewer") )
.SetTooltipText( NSLOCTEXT("ClassViewerApp", "TooltipText", "Displays all classes that exist within this project.") )
.SetGroup( WorkspaceMenu::GetMenuStructure().GetDeveloperToolsMiscCategory() )
.SetIcon( FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassViewer.TabIcon") );
}
void FClassViewerModule::ShutdownModule()
{
if (FSlateApplication::IsInitialized())
{
FGlobalTabmanager::Get()->UnregisterNomadTabSpawner( ClassViewerModule::ClassViewerApp );
}
}
/**
* Creates a class viewer widget
*
* @param InitOptions Programmer-driven configuration for this widget instance
* @param OnClassPickedDelegate Optional callback when a class is selected in 'class picking' mode
*
* @return New class viewer widget
*/
TSharedRef<SWidget> FClassViewerModule::CreateClassViewer(const FClassViewerInitializationOptions& InitOptions, const FOnClassPicked& OnClassPickedDelegate )
{
return SNew( SClassViewer, InitOptions )
.OnClassPickedDelegate(OnClassPickedDelegate);
}