本文整理汇总了C++中ToggleButton::getValueChangedCallbacks方法的典型用法代码示例。如果您正苦于以下问题:C++ ToggleButton::getValueChangedCallbacks方法的具体用法?C++ ToggleButton::getValueChangedCallbacks怎么用?C++ ToggleButton::getValueChangedCallbacks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToggleButton
的用法示例。
在下文中一共展示了ToggleButton::getValueChangedCallbacks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Menu
void CrustaApp::
produceMainMenu()
{
/* Create a popup shell to hold the main menu: */
popMenu = new PopupMenu("MainMenuPopup",Vrui::getWidgetManager());
popMenu->setTitle("Crusta");
/* Create the main menu itself: */
Menu* mainMenu =
new Menu("MainMenu",popMenu,false);
/* Data Loading menu entry */
produceDataDialog();
Button* dataLoadButton = new Button(
"DataLoadButton", mainMenu, "Load Data");
dataLoadButton->getSelectCallbacks().add(
this, &CrustaApp::showDataDialogCallback);
verticalScaleSettings.createMenuEntry(mainMenu);
opacitySettings.createMenuEntry(mainMenu);
lightSettings.createMenuEntry(mainMenu);
/* Inject the map management menu entries */
crusta->getMapManager()->addMenuEntry(mainMenu);
//color map settings dialog toggle
layerSettings.createMenuEntry(mainMenu);
/* Create a button to open or hide the palette editor dialog: */
ToggleButton* showPaletteEditorToggle = new ToggleButton(
"ShowPaletteEditorToggle", mainMenu, "Palette Editor");
showPaletteEditorToggle->setToggle(false);
showPaletteEditorToggle->getValueChangedCallbacks().add(
this, &CrustaApp::showPaletteEditorCallback);
/* Create settings submenu */
Popup* settingsMenuPopup =
new Popup("SettingsMenuPopup", Vrui::getWidgetManager());
SubMenu* settingsMenu =
new SubMenu("Settings", settingsMenuPopup, false);
//line decoration toggle
ToggleButton* decorateLinesToggle = new ToggleButton(
"DecorateLinesToggle", settingsMenu, "Decorate Lines");
decorateLinesToggle->setToggle(SETTINGS->lineDecorated);
decorateLinesToggle->getValueChangedCallbacks().add(
this, &CrustaApp::decorateLinesCallback);
//terrain color settings dialog toggle
terrainColorSettings.createMenuEntry(settingsMenu);
/* Create the advanced submenu */
Popup* advancedMenuPopup =
new Popup("AdvancedMenuPopup", Vrui::getWidgetManager());
SubMenu* advancedMenu =
new SubMenu("Advanced", advancedMenuPopup, false);
//toogle display of the debugging grid
ToggleButton* debugGridToggle = new ToggleButton(
"DebugGridToggle", advancedMenu, "Debug Grid");
debugGridToggle->setToggle(false);
debugGridToggle->getValueChangedCallbacks().add(
this, &CrustaApp::debugGridCallback);
//toogle display of the debugging sphere
ToggleButton* debugSpheresToggle = new ToggleButton(
"DebugSpheresToggle", advancedMenu, "Debug Spheres");
debugSpheresToggle->setToggle(false);
debugSpheresToggle->getValueChangedCallbacks().add(
this, &CrustaApp::debugSpheresCallback);
advancedMenu->manageChild();
CascadeButton* advancedMenuCascade = new CascadeButton(
"AdvancedMenuCascade", settingsMenu, "Advanced");
advancedMenuCascade->setPopup(advancedMenuPopup);
settingsMenu->manageChild();
CascadeButton* settingsMenuCascade = new CascadeButton(
"SettingsMenuCascade", mainMenu, "Settings");
settingsMenuCascade->setPopup(settingsMenuPopup);
/* Navigation reset: */
Button* resetNavigationButton = new Button(
"ResetNavigationButton",mainMenu,"Reset Navigation");
resetNavigationButton->getSelectCallbacks().add(
this, &CrustaApp::resetNavigationCallback);
/* Finish building the main menu: */
mainMenu->manageChild();
Vrui::setMainMenu(popMenu);
}