本文整理汇总了C++中FMenuBuilder::PopCommandList方法的典型用法代码示例。如果您正苦于以下问题:C++ FMenuBuilder::PopCommandList方法的具体用法?C++ FMenuBuilder::PopCommandList怎么用?C++ FMenuBuilder::PopCommandList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FMenuBuilder
的用法示例。
在下文中一共展示了FMenuBuilder::PopCommandList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
void FExtender::Apply( FName ExtensionHook, EExtensionHook::Position HookPosition, FMenuBuilder& MenuBuilder ) const
{
for( auto ExtensionIt( Extensions.CreateConstIterator() ); ExtensionIt; ++ExtensionIt )
{
const auto& Extension = *ExtensionIt;
if( Extension->GetType() == EExtensionType::Menu && Extension->Hook == ExtensionHook && Extension->HookPosition == HookPosition )
{
const auto& MenuExtension = StaticCastSharedPtr< const FMenuExtension >( Extension );
if ( Extension->CommandList.IsValid() )
{
// Push the command list needed for this extension's menu items
MenuBuilder.PushCommandList( Extension->CommandList.ToSharedRef() );
}
// Extend the menu!
MenuExtension->MenuExtensionDelegate.ExecuteIfBound( MenuBuilder );
if ( Extension->CommandList.IsValid() )
{
// Restore the original command list
MenuBuilder.PopCommandList();
}
}
}
}
示例2: CreateMenuEntry
void FToolBarButtonBlock::CreateMenuEntry(FMenuBuilder& MenuBuilder) const
{
TSharedPtr<const FUICommandInfo> MenuEntryAction = GetAction();
TSharedPtr<const FUICommandList> MenuEntryActionList = GetActionList();
if (MenuEntryAction.IsValid() && MenuEntryActionList.IsValid())
{
MenuBuilder.PushCommandList(MenuEntryActionList.ToSharedRef());
MenuBuilder.AddMenuEntry(MenuEntryAction);
MenuBuilder.PopCommandList();
}
else if ( LabelOverride.IsSet() )
{
const FUIAction& DirectAction = GetDirectActions();
MenuBuilder.AddMenuEntry( LabelOverride.Get(), ToolTipOverride.Get(), IconOverride.Get(), DirectAction );
}
}
示例3: FillMenu
//.........这里部分代码省略.........
LOCTEXT("SelectSubMenu_ToolTip", "Opens the actor selection menu"),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillSelectActorMenu ) );
MenuBuilder.AddSubMenu(
LOCTEXT("EditSubMenu", "Edit"),
FText::GetEmpty(),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillEditMenu, ContextType ) );
MenuBuilder.AddSubMenu(
LOCTEXT("VisibilitySubMenu", "Visibility"),
LOCTEXT("VisibilitySubMenu_ToolTip", "Selected actor visibility options"),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillActorVisibilityMenu ) );
// Build the menu for grouping actors
BuildGroupMenu( MenuBuilder, SelectionInfo );
MenuBuilder.AddSubMenu(
LOCTEXT("LevelSubMenu", "Level"),
LOCTEXT("LevelSubMenu_ToolTip", "Options for interacting with this actor's level"),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillActorLevelMenu ) );
}
MenuBuilder.EndSection();
if (ContextType == LevelEditorMenuContext::Viewport)
{
LevelEditorCreateActorMenu::FillAddReplaceViewportContextMenuSections( MenuBuilder );
}
if( GEditor->PlayWorld != NULL )
{
if( SelectionInfo.NumSelected > 0 )
{
MenuBuilder.BeginSection( "Simulation", NSLOCTEXT( "LevelViewportContextMenu", "SimulationHeading", "Simulation" ) );
{
MenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().KeepSimulationChanges );
}
MenuBuilder.EndSection();
}
}
MenuBuilder.BeginSection("LevelViewportAttach");
{
// Only display the attach menu if we have actors selected
if ( GEditor->GetSelectedActorCount() )
{
if(SelectionInfo.bHaveAttachedActor)
{
MenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().DetachFromParent );
}
MenuBuilder.AddSubMenu(
LOCTEXT( "ActorAttachToSubMenu", "Attach To" ),
LOCTEXT( "ActorAttachToSubMenu_ToolTip", "Attach Actor as child" ),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillActorMenu ) );
}
// Add a heading for "Movement" if an actor is selected
if ( GEditor->GetSelectedActorIterator() )
{
// Add a sub-menu for "Transform"
MenuBuilder.AddSubMenu(
LOCTEXT("TransformSubMenu", "Transform"),
LOCTEXT("TransformSubMenu_ToolTip", "Actor transform utils"),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillTransformMenu ) );
}
// @todo UE4: The current pivot options only work for brushes
if( SelectionInfo.bHaveBrush )
{
// You can only move the pivot in ortho viewports, but you can reset it in any viewport
if( GCurrentLevelEditingViewportClient->ViewportType != LVT_Perspective )
{
// Add a sub-menu for "Pivot"
MenuBuilder.AddSubMenu(
LOCTEXT("PivotSubMenu", "Pivot"),
LOCTEXT("PivotSubMenu_ToolTip", "Actor pivoting utils"),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillPivotMenu ) );
}
else
{
MenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().ResetPivot );
}
}
if (GetDefault<UEditorExperimentalSettings>()->bActorMerging &&
(SelectionInfo.bHaveStaticMeshComponent || SelectionInfo.bHaveLandscape))
{
MenuBuilder.AddSubMenu(
LOCTEXT("MergeActorsSubMenu", "Merge"),
LOCTEXT("MergeActorsSubMenu_ToolTip", "Actor merging utils"),
FNewMenuDelegate::CreateStatic( &FLevelEditorContextMenuImpl::FillMergeActorsMenu ) );
}
}
MenuBuilder.EndSection();
FLevelScriptEventMenuHelper::FillLevelBlueprintEventsMenu(MenuBuilder, SelectedActors);
MenuBuilder.PopCommandList();
MenuBuilder.PopExtender();
}