本文整理汇总了C++中FMenuBuilder::AddPullDownMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ FMenuBuilder::AddPullDownMenu方法的具体用法?C++ FMenuBuilder::AddPullDownMenu怎么用?C++ FMenuBuilder::AddPullDownMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FMenuBuilder
的用法示例。
在下文中一共展示了FMenuBuilder::AddPullDownMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MenuBuilder
TSharedRef<SWidget> FMainMenu::MakeMainMenu( const TSharedPtr<FTabManager>& TabManager, const TSharedRef< FExtender > Extender )
{
#define LOCTEXT_NAMESPACE "MainMenu"
// Cache all project names once
FMainFrameActionCallbacks::CacheProjectNames();
FMenuBarBuilder MenuBuilder(FMainFrameCommands::ActionList, Extender);
{
// File
MenuBuilder.AddPullDownMenu(
LOCTEXT("FileMenu", "File"),
LOCTEXT("FileMenu_ToolTip", "Open the file menu"),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillFileMenu, Extender),
"File",
FName(TEXT("FileMenu"))
);
// Edit
MenuBuilder.AddPullDownMenu(
LOCTEXT("EditMenu", "Edit"),
LOCTEXT("EditMenu_ToolTip", "Open the edit menu"),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillEditMenu, Extender, TabManager),
"Edit"
);
// Window
MenuBuilder.AddPullDownMenu(
LOCTEXT("WindowMenu", "Window"),
LOCTEXT("WindowMenu_ToolTip", "Open new windows or tabs."),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillWindowMenu, Extender, TabManager),
"Window"
);
// Help
MenuBuilder.AddPullDownMenu(
LOCTEXT("HelpMenu", "Help"),
LOCTEXT("HelpMenu_ToolTip", "Open the help menu"),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillHelpMenu, Extender),
"Help"
);
}
// Create the menu bar!
TSharedRef<SWidget> MenuBarWidget = MenuBuilder.MakeWidget();
return MenuBarWidget;
}
示例2: MenuBuilder
TSharedRef<SWidget> FMainMenu::MakeMainMenu(const TSharedPtr<FTabManager>& TabManager, const TSharedRef< FExtender > Extender)
{
#define LOCTEXT_NAMESPACE "MainMenu"
// Put the toolbox into our menus
{
const IWorkspaceMenuStructure& MenuStructure = WorkspaceMenu::GetMenuStructure();
IToolboxModule& ToolboxModule = FModuleManager::LoadModuleChecked<IToolboxModule>("Toolbox");
ToolboxModule.RegisterSpawners(MenuStructure.GetDeveloperToolsDebugCategory(), MenuStructure.GetDeveloperToolsMiscCategory());
}
// Cache all project names once
FMainFrameActionCallbacks::CacheProjectNames();
FMenuBarBuilder MenuBuilder(FMainFrameCommands::ActionList, Extender);
{
// File
MenuBuilder.AddPullDownMenu(
LOCTEXT("FileMenu", "File"),
LOCTEXT("FileMenu_ToolTip", "Open the file menu"),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillFileMenu, Extender),
"File",
FName(TEXT("FileMenu"))
);
// Edit
MenuBuilder.AddPullDownMenu(
LOCTEXT("EditMenu", "Edit"),
LOCTEXT("EditMenu_ToolTip", "Open the edit menu"),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillEditMenu, Extender, TabManager),
"Edit"
,
FName(TEXT("EditMenu"))
);
// Window
MenuBuilder.AddPullDownMenu(
LOCTEXT("WindowMenu", "Window"),
LOCTEXT("WindowMenu_ToolTip", "Open new windows or tabs."),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillWindowMenu, Extender, TabManager),
"Window"
);
// Help
MenuBuilder.AddPullDownMenu(
LOCTEXT("HelpMenu", "Help"),
LOCTEXT("HelpMenu_ToolTip", "Open the help menu"),
FNewMenuDelegate::CreateStatic(&FMainMenu::FillHelpMenu, Extender),
"Help"
);
}
// Create the menu bar!
TSharedRef<SWidget> MenuBarWidget = MenuBuilder.MakeWidget();
// Tell tab-manager about the multi-box for platforms with a global menu bar
TabManager->SetMenuMultiBox(MenuBuilder.GetMultiBox());
return MenuBarWidget;
}