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


C++ FMenuBuilder::PopCommandList方法代码示例

本文整理汇总了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();
			}
		}
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:26,代码来源:MultiBoxExtender.cpp

示例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 );
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:16,代码来源:SToolBarButtonBlock.cpp

示例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();
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:101,代码来源:LevelEditorContextMenu.cpp


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