本文整理汇总了C++中MenuItem::addSubItem方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuItem::addSubItem方法的具体用法?C++ MenuItem::addSubItem怎么用?C++ MenuItem::addSubItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuItem
的用法示例。
在下文中一共展示了MenuItem::addSubItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildMenu
void Options::buildMenu()
{
MyOGL::OutlineFonts& fonts = win.extensions().outlineFonts();
menu.addItem(new PlayerNameItem(win, playerName));
MenuItem* last; //pointer to the last added item (only if it will have sub menu)
last = menu.addItem(new MenuItem(fonts, langData["optionsMenu"]["cuboidSize"]));
for(int size = Difficulty::SIZE_MIN; size <= Difficulty::SIZE_MAXX; ++size)
last->addSubItem(new MenuItem(fonts, lexical_cast<string>(size)));
last = menu.addItem(new MenuItem(fonts, langData["optionsMenu"]["cuboidDepth"]));
for(int depth = Difficulty::DEPTH_MIN; depth <= Difficulty::DEPTH_MAX; depth += 2)
last->addSubItem(new MenuItem(fonts, lexical_cast<std::string>(depth)));
last = menu.addItem(new MenuItem(fonts, langData["optionsMenu"]["blocksSet"]));
for(int bset = 0; bset < 3; ++bset)
last->addSubItem(new MenuItem(fonts, Difficulty::blocksSetStr(bset)));
menu.addItem(new VideoItem(win)); //sub items are created in constructor automatically
menu.addItem(new LanguageItem(win.extensions(), user["language"], needRestart));
menu.addItem(new MenuItem(fonts, langData["optionsMenu"]["keyboard"]));
last = menu.addItem(new MenuItem(fonts, langData["optionsMenu"]["sounds"]));
last->addSubItem(new MenuItem(fonts, langData["sounds"]["on"]));
last->addSubItem(new MenuItem(fonts, langData["sounds"]["off"]));
}