本文整理汇总了C++中TSharedPtr::AddToolBarExtension方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::AddToolBarExtension方法的具体用法?C++ TSharedPtr::AddToolBarExtension怎么用?C++ TSharedPtr::AddToolBarExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TSharedPtr
的用法示例。
在下文中一共展示了TSharedPtr::AddToolBarExtension方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtendToolbar
void FSoundCueEditor::ExtendToolbar()
{
struct Local
{
static void FillToolbar(FToolBarBuilder& ToolbarBuilder)
{
ToolbarBuilder.BeginSection("Toolbar");
{
ToolbarBuilder.AddToolBarButton(FSoundCueGraphEditorCommands::Get().PlayCue);
ToolbarBuilder.AddToolBarButton(FSoundCueGraphEditorCommands::Get().PlayNode);
ToolbarBuilder.AddToolBarButton(FSoundCueGraphEditorCommands::Get().StopCueNode);
}
ToolbarBuilder.EndSection();
}
};
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
GetToolkitCommands(),
FToolBarExtensionDelegate::CreateStatic( &Local::FillToolbar )
);
AddToolbarExtender(ToolbarExtender);
ISoundCueEditorModule* SoundCueEditorModule = &FModuleManager::LoadModuleChecked<ISoundCueEditorModule>( "SoundCueEditor" );
AddToolbarExtender(SoundCueEditorModule->GetToolBarExtensibilityManager()->GetAllExtenders(GetToolkitCommands(), GetEditingObjects()));
}
示例2: StartupModule
void FSSTBatchCombinerModule::StartupModule()
{
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
FSSTBatchCombinerStyle::Initialize();
FSSTBatchCombinerStyle::ReloadTextures();
FSSTBatchCombinerCommands::Register();
PluginCommands = MakeShareable(new FUICommandList);
PluginCommands->MapAction(
FSSTBatchCombinerCommands::Get().PluginAction,
FExecuteAction::CreateRaw(this, &FSSTBatchCombinerModule::PluginButtonClicked),
FCanExecuteAction());
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
{
TSharedPtr<FExtender> MenuExtender = MakeShareable(new FExtender());
MenuExtender->AddMenuExtension("WindowLayout", EExtensionHook::After, PluginCommands, FMenuExtensionDelegate::CreateRaw(this, &FSSTBatchCombinerModule::AddMenuExtension));
LevelEditorModule.GetMenuExtensibilityManager()->AddExtender(MenuExtender);
}
{
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension("Settings", EExtensionHook::After, PluginCommands, FToolBarExtensionDelegate::CreateRaw(this, &FSSTBatchCombinerModule::AddToolbarExtension));
LevelEditorModule.GetToolBarExtensibilityManager()->AddExtender(ToolbarExtender);
}
}
示例3: MakeShareable
TSharedPtr<FExtender> SBehaviorTreeBlackboardEditor::GetToolbarExtender(TSharedRef<FUICommandList> ToolkitCommands) const
{
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension("Debugging", EExtensionHook::Before, ToolkitCommands, FToolBarExtensionDelegate::CreateSP( this, &SBehaviorTreeBlackboardEditor::FillToolbar ));
return ToolbarExtender;
}
示例4: SetupTranslationEditorToolbar
void FTranslationEditorMenu::SetupTranslationEditorToolbar( TSharedPtr< FExtender > Extender, FTranslationEditor& TranslationEditor )
{
struct Local
{
static void AddToolbarButtons( FToolBarBuilder& ToolbarBuilder )
{
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().SaveTranslations, "SaveTranslations", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "AssetEditor.SaveAsset"));
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().PreviewAllTranslationsInEditor, "PreviewTranslationsInEditor", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "TranslationEditor.PreviewInEditor"));
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().ImportLatestFromLocalizationService, "ImportLatestFromLocalizationService", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "TranslationEditor.ImportLatestFromLocalizationService"));
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().ExportToPortableObjectFormat, "ExportToPortableObjectFormat", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "TranslationEditor.Export"));
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().ImportFromPortableObjectFormat, "ImportFromPortableObjectFormat", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "TranslationEditor.Import"));
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().OpenSearchTab, "OpenSearchTab", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "TranslationEditor.Search"));
if (GetDefault<UEditorExperimentalSettings>()->bEnableTranslationPicker)
{
ToolbarBuilder.AddWidget(SNew(STranslationWidgetPicker));
}
}
};
Extender->AddToolBarExtension(
"Asset",
EExtensionHook::First,
TranslationEditor.GetToolkitCommands(),
FToolBarExtensionDelegate::CreateStatic( &Local::AddToolbarButtons ) );
}
示例5: ExtendToolbar
void FSubstanceEditor::ExtendToolbar()
{
struct Local
{
static void FillToolbar(FToolBarBuilder& ToolbarBuilder)
{
ToolbarBuilder.BeginSection("Reset to default values.");
{
ToolbarBuilder.AddToolBarButton(FSubstanceEditorCommands::Get().ResetDefaultValues);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("Presets");
{
ToolbarBuilder.AddToolBarButton(FSubstanceEditorCommands::Get().ExportPreset);
ToolbarBuilder.AddToolBarButton(FSubstanceEditorCommands::Get().ImportPreset);
}
ToolbarBuilder.EndSection();
}
};
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
ToolbarExtender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
GetToolkitCommands(),
FToolBarExtensionDelegate::CreateStatic(&Local::FillToolbar)
);
AddToolbarExtender(ToolbarExtender);
ISubstanceEditorModule* SubstanceEditorModule = &FModuleManager::LoadModuleChecked<ISubstanceEditorModule>("SubstanceEditor");
AddToolbarExtender(SubstanceEditorModule->GetToolBarExtensibilityManager()->GetAllExtenders());
}
示例6: AddEditorToolbar
void FCodeProjectEditorToolbar::AddEditorToolbar(TSharedPtr<FExtender> Extender)
{
check(CodeProjectEditor.IsValid());
TSharedPtr<FCodeProjectEditor> CodeProjectEditorPtr = CodeProjectEditor.Pin();
Extender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
CodeProjectEditorPtr->GetToolkitCommands(),
FToolBarExtensionDelegate::CreateSP( this, &FCodeProjectEditorToolbar::FillEditorToolbar ) );
}
示例7: ExtendToolbar
void FNiagaraEditor::ExtendToolbar()
{
struct Local
{
static void FillToolbar(FToolBarBuilder& ToolbarBuilder, TSharedRef<SWidget> CompileBox)
{
ToolbarBuilder.BeginSection("Compile");
{
ToolbarBuilder.AddWidget(CompileBox);
}
ToolbarBuilder.EndSection();
}
};
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
TSharedRef<SWidget> Compilebox = SNew(SHorizontalBox)
+SHorizontalBox::Slot()
.AutoWidth()
.Padding(4)
[
SNew(SButton)
.OnClicked(this, &FNiagaraEditor::OnCompileClicked)
.Content()
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.AutoHeight()
[
SNew(SImage)
.Image(FEditorStyle::GetBrush("LevelEditor.Recompile"))
]
+SVerticalBox::Slot()
.AutoHeight()
[
SNew(STextBlock)
.Text(LOCTEXT("NiagaraToolbar_Compile", "Compile"))
]
]
];
ToolbarExtender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
GetToolkitCommands(),
FToolBarExtensionDelegate::CreateStatic( &Local::FillToolbar, Compilebox )
);
AddToolbarExtender(ToolbarExtender);
FNiagaraEditorModule& NiagaraEditorModule = FModuleManager::LoadModuleChecked<FNiagaraEditorModule>( "NiagaraEditor" );
AddToolbarExtender(NiagaraEditorModule.GetToolBarExtensibilityManager()->GetAllExtenders(GetToolkitCommands(), GetEditingObjects()));
}
示例8: SetupTranslationEditorToolbar
void FTranslationEditorMenu::SetupTranslationEditorToolbar( TSharedPtr< FExtender > Extender, FTranslationEditor& TranslationEditor )
{
struct Local
{
static void AddToolbarButtons( FToolBarBuilder& ToolbarBuilder )
{
ToolbarBuilder.AddToolBarButton(
FTranslationEditorCommands::Get().SaveTranslations, "SaveTranslations", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "AssetEditor.SaveAsset"));
}
};
Extender->AddToolBarExtension(
"Asset",
EExtensionHook::First,
TranslationEditor.GetToolkitCommands(),
FToolBarExtensionDelegate::CreateStatic( &Local::AddToolbarButtons ) );
}
示例9: FillToolbar
TSharedPtr<FExtender> FCurveAssetEditor::GetToolbarExtender()
{
struct Local
{
static void FillToolbar(FToolBarBuilder& ToolbarBuilder, TSharedRef<SWidget> InputSnapWidget, TSharedRef<SWidget> OutputSnapWidget)
{
ToolbarBuilder.BeginSection("Curve");
{
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().ZoomToFitHorizontal);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().ZoomToFitVertical);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().ZoomToFitAll);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().ZoomToFitSelected);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("Interpolation");
{
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().InterpolationCubicAuto);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().InterpolationCubicUser);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().InterpolationCubicBreak);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().InterpolationLinear);
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().InterpolationConstant);
}
ToolbarBuilder.EndSection();
ToolbarBuilder.BeginSection("Snap");
{
ToolbarBuilder.AddToolBarButton(FRichCurveEditorCommands::Get().ToggleSnapping);
ToolbarBuilder.AddWidget(InputSnapWidget);
ToolbarBuilder.AddWidget(OutputSnapWidget);
}
ToolbarBuilder.EndSection();
}
};
TSharedPtr<FExtender> ToolbarExtender = MakeShareable(new FExtender);
TSharedRef<SWidget> InputSnapWidget =
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.Padding(4)
.AutoHeight()
[
SNew(STextBlock)
.Text(LOCTEXT("InputSnap", "Time Snap"))
]
+ SVerticalBox::Slot()
.Padding(4)
.AutoHeight()
[
SNew(SComboButton)
.ContentPadding(1)
.OnGetMenuContent(this, &FCurveAssetEditor::BuildInputSnapMenu)
.ButtonContent()
[
SNew(SEditableTextBox)
.Text(this, &FCurveAssetEditor::GetInputSnapText)
.OnTextCommitted(this, &FCurveAssetEditor::InputSnapTextComitted)
]
];
TSharedRef<SWidget> OutputSnapWidget =
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.Padding(4)
.AutoHeight()
[
SNew(STextBlock)
.Text(LOCTEXT("OutputSnap", "Value Snap"))
]
+ SVerticalBox::Slot()
.Padding(4)
.AutoHeight()
[
SNew(SComboButton)
.ContentPadding(1)
.OnGetMenuContent(this, &FCurveAssetEditor::BuildOutputSnapMenu)
.ButtonContent()
[
SNew(SEditableTextBox)
.Text(this, &FCurveAssetEditor::GetOutputSnapText)
.OnTextCommitted(this, &FCurveAssetEditor::OutputSnapTextComitted)
]
];
ToolbarExtender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
TrackWidget->GetCommands(),
FToolBarExtensionDelegate::CreateStatic(&Local::FillToolbar, InputSnapWidget, OutputSnapWidget)
);
return ToolbarExtender;
}
示例10: ExtendToolbar
//.........这里部分代码省略.........
.Visibility( this, &FMatinee::GetLargeIconVisibility )
]
+SVerticalBox::Slot()
.AutoHeight()
.Padding(4,0)
[
InitialInterpModeComboBox.ToSharedRef()
]
];
SpeedSettingStrings.Empty();
SpeedSettingStrings.Add( MakeShareable( new FString(NSLOCTEXT("UnrealEd", "FullSpeed", "100%").ToString()) ) );
SpeedSettingStrings.Add( MakeShareable( new FString(NSLOCTEXT("UnrealEd", "50Speed", "50%").ToString()) ) );
SpeedSettingStrings.Add( MakeShareable( new FString(NSLOCTEXT("UnrealEd", "25Speed", "25%").ToString()) ) );
SpeedSettingStrings.Add( MakeShareable( new FString(NSLOCTEXT("UnrealEd", "10Speed", "10%").ToString()) ) );
SpeedSettingStrings.Add( MakeShareable( new FString(NSLOCTEXT("UnrealEd", "1Speed", "1%").ToString()) ) );
SpeedCombo =
SNew(STextComboBox)
.OptionsSource(&SpeedSettingStrings)
.InitiallySelectedItem(SpeedSettingStrings[0])
.OnSelectionChanged(this, &FMatinee::OnChangePlaySpeed)
;
TSharedRef<SWidget> SpeedBox =
SNew(SBox)
.WidthOverride(103)
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.Padding(4)
[
SNew(STextBlock)
.Text(NSLOCTEXT("Matinee.Toolbar", "PlaybackSpeed", "Playback Speed:"))
.Visibility( this, &FMatinee::GetLargeIconVisibility )
]
+SVerticalBox::Slot()
.AutoHeight()
.Padding(4,0)
[
SpeedCombo.ToSharedRef()
]
];
// Append Second Snap Times
SnapComboStrings.Empty();
for(int32 i=0; i<ARRAY_COUNT(InterpEdSnapSizes); i++)
{
FString SnapCaption = FString::Printf( TEXT("%1.2f"), InterpEdSnapSizes[i] );
SnapComboStrings.Add( MakeShareable( new FString(SnapCaption) ) );
}
// Append FPS Snap Times
for(int32 i=0; i<ARRAY_COUNT(InterpEdFPSSnapSizes); i++)
{
FString SnapCaption = GetInterpEdFPSSnapSizeLocName( i );
SnapComboStrings.Add( MakeShareable( new FString(SnapCaption) ) );
}
// Add option for snapping to other keys.
SnapComboStrings.Add( MakeShareable( new FString(NSLOCTEXT("UnrealEd", "InterpEd_Snap_Keys", "Snap to Keys" ).ToString()) ) );
SnapCombo =
SNew(STextComboBox)
.OptionsSource(&SnapComboStrings)
.InitiallySelectedItem(SnapComboStrings[2])
.OnSelectionChanged(this, &FMatinee::OnChangeSnapSize)
.ToolTipText( NSLOCTEXT("Matinee", "SnapComboToolTip", "Snap Size | Selects the timeline granularity for snapping and visualization purposes") )
;
TSharedRef<SWidget> SnapSettingBox =
SNew(SBox)
.WidthOverride(155)
[
SNew(SVerticalBox)
+SVerticalBox::Slot()
.Padding(4)
[
SNew(STextBlock)
.Text(NSLOCTEXT("Matinee.Toolbar", "SnapSetting", "Snap Setting:"))
.Visibility( this, &FMatinee::GetLargeIconVisibility )
]
+SVerticalBox::Slot()
.AutoHeight()
.Padding(4,0)
[
SnapCombo.ToSharedRef()
]
];
ToolbarExtender->AddToolBarExtension(
"Asset",
EExtensionHook::After,
GetToolkitCommands(),
FToolBarExtensionDelegate::CreateStatic( &Local::FillToolbar, InterpolationBox, SpeedBox, SnapSettingBox)
);
AddToolbarExtender(ToolbarExtender);
IMatineeModule* MatineeModule = &FModuleManager::LoadModuleChecked<IMatineeModule>( "Matinee" );
AddToolbarExtender(MatineeModule->GetToolBarExtensibilityManager()->GetAllExtenders(GetToolkitCommands(), GetEditingObjects()));
}
示例11: StartupModule
void FSkookumScriptEditor::StartupModule()
{
// Get pointer to runtime module
m_runtime_p = FModuleManager::Get().GetModule("SkookumScriptRuntime");
// Tell runtime that editor is present (needed even in commandlet mode as we might have to demand-load blueprints)
get_runtime()->set_editor_interface(this);
// Clear contents of scripts folder for a fresh start
// Won't work here if project has several maps using different blueprints
//FString directory_to_delete(m_scripts_path / TEXT("Object"));
//IFileManager::Get().DeleteDirectory(*directory_to_delete, false, true);
// Reset super classes
m_used_classes.Empty();
// Label used to extract package path from Sk class meta file
m_package_name_key = TEXT("// UE4 Package Name: \"");
m_package_path_key = TEXT("// UE4 Package Path: \"");
// String to insert into/remove from Sk project ini file
m_editable_ini_settings_p = TEXT("Editable=false\r\nCanMakeEditable=true\r\n");
if (IsRunningCommandlet())
{
// Tell runtime to start skookum now
get_runtime()->startup_skookum();
}
else
{
// Hook up delegates
m_on_asset_loaded_handle = FCoreUObjectDelegates::OnAssetLoaded.AddRaw(this, &FSkookumScriptEditor::on_asset_loaded);
m_on_object_modified_handle = FCoreUObjectDelegates::OnObjectModified.AddRaw(this, &FSkookumScriptEditor::on_object_modified);
m_on_map_opened_handle = FEditorDelegates::OnMapOpened.AddRaw(this, &FSkookumScriptEditor::on_map_opened);
m_on_new_asset_created_handle = FEditorDelegates::OnNewAssetCreated.AddRaw(this, &FSkookumScriptEditor::on_new_asset_created);
m_on_assets_deleted_handle = FEditorDelegates::OnAssetsDeleted.AddRaw(this, &FSkookumScriptEditor::on_assets_deleted);
m_on_asset_post_import_handle = FEditorDelegates::OnAssetPostImport.AddRaw(this, &FSkookumScriptEditor::on_asset_post_import);
FAssetRegistryModule & asset_registry = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(AssetRegistryConstants::ModuleName);
m_on_asset_added_handle = asset_registry.Get().OnAssetAdded().AddRaw(this, &FSkookumScriptEditor::on_asset_added);
m_on_asset_renamed_handle = asset_registry.Get().OnAssetRenamed().AddRaw(this, &FSkookumScriptEditor::on_asset_renamed);
m_on_in_memory_asset_created_handle = asset_registry.Get().OnInMemoryAssetCreated().AddRaw(this, &FSkookumScriptEditor::on_in_memory_asset_created);
m_on_in_memory_asset_deleted_handle = asset_registry.Get().OnInMemoryAssetDeleted().AddRaw(this, &FSkookumScriptEditor::on_in_memory_asset_deleted);
//---------------------------------------------------------------------------------------
// UI extension
// Register commands and styles
FSkookumScriptEditorCommands::Register();
FSlateStyleRegistry::UnRegisterSlateStyle(FSkookumStyles::GetStyleSetName()); // Hot reload hack
FSkookumStyles::Initialize();
// Button commands
m_button_commands = MakeShareable(new FUICommandList);
m_button_commands->MapAction(
FSkookumScriptEditorCommands::Get().m_skookum_button,
FExecuteAction::CreateRaw(this, &FSkookumScriptEditor::on_skookum_button_clicked),
FCanExecuteAction());
// Add to level tool bar
m_level_tool_bar_extender = MakeShareable(new FExtender);
m_level_tool_bar_extension = m_level_tool_bar_extender->AddToolBarExtension("Compile", EExtensionHook::After, m_button_commands, FToolBarExtensionDelegate::CreateRaw(this, &FSkookumScriptEditor::add_skookum_button_to_level_tool_bar));
FLevelEditorModule & level_editor_module = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
m_level_extension_manager = level_editor_module.GetToolBarExtensibilityManager();
m_level_extension_manager->AddExtender(m_level_tool_bar_extender);
// Add to blueprint tool bar
m_blueprint_tool_bar_extender = MakeShareable(new FExtender);
m_blueprint_tool_bar_extension = m_blueprint_tool_bar_extender->AddToolBarExtension("Asset", EExtensionHook::After, m_button_commands, FToolBarExtensionDelegate::CreateRaw(this, &FSkookumScriptEditor::add_skookum_button_to_blueprint_tool_bar));
FBlueprintEditorModule & blueprint_editor_module = FModuleManager::LoadModuleChecked<FBlueprintEditorModule>("Kismet");
m_blueprint_extension_manager = blueprint_editor_module.GetMenuExtensibilityManager();
m_blueprint_extension_manager->AddExtender(m_blueprint_tool_bar_extender);
}
}