本文整理汇总了C++中Menu::Run方法的典型用法代码示例。如果您正苦于以下问题:C++ Menu::Run方法的具体用法?C++ Menu::Run怎么用?C++ Menu::Run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::Run方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddMenu
void AddMenu()
{
Menu AddMenu;
AddMenu.AddItem( 'c', "Add new circle", AddCircle );
AddMenu.AddItem( 'r', "Add new rectangle", AddRectangle );
AddMenu.AddItem( 't', "Add new triangle", AddTriangle );
AddMenu.AddItem( ' ', "", MenuSeparator );
AddMenu.AddItem( 'x', "Exit", MenuExit );
AddMenu.AddItem( '?', "Help", MenuPrintHelp );
AddMenu.Run();
}
示例2: new
status_t
user_menu(Directory** _bootVolume)
{
Menu* menu = new(std::nothrow) Menu(MAIN_MENU);
Menu* safeModeMenu = NULL;
Menu* debugMenu = NULL;
MenuItem* item;
TRACE(("user_menu: enter\n"));
// Add boot volume
menu->AddItem(item = new(std::nothrow) MenuItem("Select boot volume",
add_boot_volume_menu(*_bootVolume)));
// Add safe mode
menu->AddItem(item = new(std::nothrow) MenuItem("Select safe mode options",
safeModeMenu = add_safe_mode_menu()));
// add debug menu
menu->AddItem(item = new(std::nothrow) MenuItem("Select debug options",
debugMenu = add_debug_menu()));
// Add platform dependent menus
platform_add_menus(menu);
menu->AddSeparatorItem();
menu->AddItem(item = new(std::nothrow) MenuItem("Reboot"));
item->SetTarget(user_menu_reboot);
item->SetShortcut('r');
menu->AddItem(item = new(std::nothrow) MenuItem("Continue booting"));
if (*_bootVolume == NULL) {
item->SetEnabled(false);
menu->ItemAt(0)->Select(true);
} else
item->SetShortcut('b');
menu->Run();
// See if a new boot device has been selected, and propagate that back
if (item->Data() != NULL)
*_bootVolume = (Directory*)item->Data();
apply_safe_mode_options(safeModeMenu);
apply_safe_mode_options(debugMenu);
delete menu;
TRACE(("user_menu: leave\n"));
return B_OK;
}
示例3: MaintainRect
void MaintainRect()
{
Menu MaintainMenu;
FigureFirst();
MaintainMenu.AddItem( 'f', "First", FigureFirst );
MaintainMenu.AddItem( 'n', "Next", FigureNext );
MaintainMenu.AddItem( 'p', "Previous", FigurePrevious );
MaintainMenu.AddItem( 'd', "Delete", FigureDelete );
MaintainMenu.AddItem( 'q', "Print current", FigurePrint );
MaintainMenu.AddItem( ' ', "", MenuSeparator );
MaintainMenu.AddItem( 'x', "Exit", MenuExit );
MaintainMenu.AddItem( '?', "Help", MenuPrintHelp );
MaintainMenu.Run();
}
示例4: main
int main()
{
cout << "Hello \n";
Menu MyMenu;
MyMenu.AddItem( 'r', "Read from files", FileRead );
MyMenu.AddItem( 'l', "List all", ListAll );
MyMenu.AddItem( 's', "Show big", ShowBig );
MyMenu.AddItem( 'a', "Add new item",AddMenu );
MyMenu.AddItem( 'c', "Accumulate Area", AccumulateArea );
MyMenu.AddItem( 'm', "Maintain Rects",MaintainRect );
MyMenu.AddItem( 'w', "Write to files", FileWrite );
MyMenu.AddItem( ' ', "", MenuSeparator );
MyMenu.AddItem( 'x', "Exit", MenuExit );
MyMenu.AddItem( '?', "Help", MenuPrintHelp );
MyMenu.Run();
return 0;
}
示例5: WinMain
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
VideoMode vMode(800,600,32);
RenderWindow win(vMode, "ASTEROIDS");
win.SetFramerateLimit(120);
//win.ShowMouseCursor(false);
win.UseVerticalSync(false);
int currentScreen = 0;
Menu menu;
Game game;
Splash splash;
while(currentScreen >= 0)
{
if (currentScreen == 0)
{
currentScreen = splash.Run(win, vMode);
}
if(currentScreen == 2)
{
currentScreen = menu.Run(win, vMode);
}
if(currentScreen == 1)
{
currentScreen = game.Run(win, vMode);
}
}
return EXIT_SUCCESS;
}
示例6: new
status_t
user_menu(BootVolume& _bootVolume, PathBlacklist& _pathBlacklist)
{
Menu* menu = new(std::nothrow) Menu(MAIN_MENU);
sMainMenu = menu;
sBootVolume = &_bootVolume;
sPathBlacklist = &_pathBlacklist;
Menu* safeModeMenu = NULL;
Menu* debugMenu = NULL;
MenuItem* item;
TRACE(("user_menu: enter\n"));
// Add boot volume
menu->AddItem(item = new(std::nothrow) MenuItem("Select boot volume",
add_boot_volume_menu()));
// Add safe mode
menu->AddItem(item = new(std::nothrow) MenuItem("Select safe mode options",
safeModeMenu = add_safe_mode_menu()));
// add debug menu
menu->AddItem(item = new(std::nothrow) MenuItem("Select debug options",
debugMenu = add_debug_menu()));
// Add platform dependent menus
platform_add_menus(menu);
menu->AddSeparatorItem();
menu->AddItem(item = new(std::nothrow) MenuItem("Reboot"));
item->SetTarget(user_menu_reboot);
item->SetShortcut('r');
menu->AddItem(item = new(std::nothrow) MenuItem("Continue booting"));
if (!_bootVolume.IsValid()) {
item->SetEnabled(false);
menu->ItemAt(0)->Select(true);
} else
item->SetShortcut('b');
menu->Run();
apply_safe_mode_options(safeModeMenu);
apply_safe_mode_options(debugMenu);
apply_safe_mode_path_blacklist();
add_safe_mode_settings(sSafeModeOptionsBuffer.String());
delete menu;
TRACE(("user_menu: leave\n"));
sMainMenu = NULL;
sBlacklistRootMenu = NULL;
sBootVolume = NULL;
sPathBlacklist = NULL;
return B_OK;
}