本文整理汇总了C++中Menu::AddSeparatorItem方法的典型用法代码示例。如果您正苦于以下问题:C++ Menu::AddSeparatorItem方法的具体用法?C++ Menu::AddSeparatorItem怎么用?C++ Menu::AddSeparatorItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::AddSeparatorItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
static Menu*
add_debug_menu()
{
Menu* menu = new(std::nothrow) Menu(STANDARD_MENU, "Debug Options");
MenuItem* item;
#if DEBUG_SPINLOCK_LATENCIES
item = new(std::nothrow) MenuItem("Disable latency checks");
if (item != NULL) {
item->SetType(MENU_ITEM_MARKABLE);
item->SetData(B_SAFEMODE_DISABLE_LATENCY_CHECK);
item->SetHelpText("Disables latency check panics.");
menu->AddItem(item);
}
#endif
menu->AddItem(item
= new(nothrow) MenuItem("Enable serial debug output"));
item->SetData("serial_debug_output");
item->SetType(MENU_ITEM_MARKABLE);
item->SetHelpText("Turns on forwarding the syslog output to the serial "
"interface.");
menu->AddItem(item
= new(nothrow) MenuItem("Enable on screen debug output"));
item->SetData("debug_screen");
item->SetType(MENU_ITEM_MARKABLE);
item->SetHelpText("Displays debug output on screen while the system "
"is booting, instead of the normal boot logo.");
menu->AddItem(item = new(nothrow) MenuItem("Enable debug syslog"));
item->SetType(MENU_ITEM_MARKABLE);
item->SetMarked(gKernelArgs.keep_debug_output_buffer);
item->SetTarget(&debug_menu_toggle_debug_syslog);
item->SetHelpText("Enables a special in-memory syslog buffer for this "
"session that the boot loader will be able to access after rebooting.");
ring_buffer* syslogBuffer = (ring_buffer*)gKernelArgs.debug_output;
if (syslogBuffer != NULL && ring_buffer_readable(syslogBuffer) > 0) {
menu->AddSeparatorItem();
menu->AddItem(item
= new(nothrow) MenuItem("Display syslog from previous session"));
item->SetTarget(&debug_menu_display_syslog);
item->SetType(MENU_ITEM_NO_CHOICE);
item->SetHelpText(
"Displays the syslog from the previous Haiku session.");
menu->AddItem(item = new(nothrow) MenuItem(
"Save syslog from previous session", add_save_debug_syslog_menu()));
item->SetHelpText("Saves the syslog from the previous Haiku session to "
"disk. Currently only FAT32 volumes are supported.");
}
menu->AddSeparatorItem();
menu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));
return menu;
}
示例2: new
static Menu *
add_boot_volume_menu(Directory *bootVolume)
{
Menu *menu = new(nothrow) Menu(CHOICE_MENU, "Select Boot Volume");
MenuItem *item;
void *cookie;
int32 count = 0;
if (gRoot->Open(&cookie, O_RDONLY) == B_OK) {
Directory *volume;
while (gRoot->GetNextNode(cookie, (Node **)&volume) == B_OK) {
// only list bootable volumes
if (!is_bootable(volume))
continue;
char name[B_FILE_NAME_LENGTH];
if (volume->GetName(name, sizeof(name)) == B_OK) {
menu->AddItem(item = new(nothrow) MenuItem(name));
item->SetTarget(user_menu_boot_volume);
item->SetData(volume);
if (volume == bootVolume) {
item->SetMarked(true);
item->Select(true);
}
count++;
}
}
gRoot->Close(cookie);
}
if (count == 0) {
// no boot volume found yet
menu->AddItem(item = new(nothrow) MenuItem("<No boot volume found>"));
item->SetType(MENU_ITEM_NO_CHOICE);
item->SetEnabled(false);
}
menu->AddSeparatorItem();
menu->AddItem(item = new(nothrow) MenuItem("Rescan volumes"));
item->SetHelpText("Please insert a Antares CD-ROM or attach a USB disk - "
"depending on your system, you can then boot from them.");
item->SetType(MENU_ITEM_NO_CHOICE);
if (count == 0)
item->Select(true);
menu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));
item->SetType(MENU_ITEM_NO_CHOICE);
if (gKernelArgs.boot_volume.GetBool(BOOT_VOLUME_BOOTED_FROM_IMAGE, false))
menu->SetChoiceText("CD-ROM or hard drive");
return menu;
}
示例3: new
Menu *
video_mode_menu()
{
Menu *menu = new(nothrow) Menu(CHOICE_MENU, "Select Video Mode");
MenuItem *item;
menu->AddItem(item = new(nothrow) MenuItem("Default"));
item->SetMarked(true);
item->Select(true);
item->SetHelpText("The Default video mode is the one currently configured "
"in the system. If there is no mode configured yet, a viable mode will "
"be chosen automatically.");
menu->AddSeparatorItem();
menu->AddItem(item = new(nothrow) MenuItem("Return to main menu"));
item->SetType(MENU_ITEM_NO_CHOICE);
return menu;
}
示例4: 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;
}