GLMotif::PopupMenu* CaveApp::createMainMenu() { /* Create a popup shell to hold the main menu */ GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager()); mainMenuPopup->setBorderWidth(0.0f); mainMenuPopup->setBorderType(GLMotif::Widget::RAISED); mainMenuPopup->setBorderColor(Vrui::getUiBgColor()); mainMenuPopup->setBackgroundColor(Vrui::getUiBgColor()); mainMenuPopup->setForegroundColor(Vrui::getUiFgColor()); mainMenuPopup->setMarginWidth(Vrui::getUiSize()); mainMenuPopup->setTitleSpacing(Vrui::getUiSize()); mainMenuPopup->setTitle("NetVR",Vrui::getUiFont()); /* Create the main menu itself */ GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false); mainMenu->setBorderWidth(0.0f); mainMenu->setOrientation(GLMotif::Menu::VERTICAL); mainMenu->setNumMinorWidgets(1); mainMenu->setMarginWidth(0.0f); mainMenu->setSpacing(Vrui::getUiSize()); /* Create buttons and assign callback methods */ GLMotif::CascadeButton* layoutTogglesCascade=new GLMotif::CascadeButton("LayoutTogglesCascade", mainMenu, "Layouts", Vrui::getUiFont()); layoutTogglesCascade->setPopup(createLayoutTogglesMenu()); GLMotif::CascadeButton* viewTogglesCascade=new GLMotif::CascadeButton("ViewTogglesCascade", mainMenu, "View", Vrui::getUiFont()); viewTogglesCascade->setPopup(createViewTogglesMenu()); GLMotif::CascadeButton* selectionTogglesCascade=new GLMotif::CascadeButton("SelectionTogglesCascade", mainMenu, "Node Selection", Vrui::getUiFont()); selectionTogglesCascade->setPopup(createSelectionTogglesMenu()); GLMotif::ToggleButton* showStudentInfoToggleButton=new GLMotif::ToggleButton("ShowStudentInfoToggleButton", mainMenu, "Show Student Info Dialog", Vrui::getUiFont()); GLMotif::Button* resetNavigationButton=new GLMotif::Button("ResetNavigationButton",mainMenu,"Reset Navigation",Vrui::getUiFont()); resetNavigationButton->getSelectCallbacks().add(this,&CaveApp::resetNavigationCallback); GLMotif::Button* quitApplicationButton=new GLMotif::Button("QuitApplicationButton",mainMenu,"Quit",Vrui::getUiFont()); mainMenu->manageChild(); return mainMenuPopup; }
GLMotif::PopupMenu* VRMeshEditor::createMainMenu(void) { GLMotif::PopupMenu* mainMenuPopup=new GLMotif::PopupMenu("MainMenuPopup",Vrui::getWidgetManager()); mainMenuPopup->setBorderWidth(0.0f); mainMenuPopup->setBorderType(GLMotif::Widget::RAISED); mainMenuPopup->setBorderColor(Vrui::getUiBgColor()); mainMenuPopup->setBackgroundColor(Vrui::getUiBgColor()); mainMenuPopup->setForegroundColor(Vrui::getUiFgColor()); mainMenuPopup->setMarginWidth(Vrui::getUiSize()); mainMenuPopup->setTitleSpacing(Vrui::getUiSize()); mainMenuPopup->setTitle("Liquid Metal Editing",Vrui::getUiFont()); GLMotif::Menu* mainMenu=new GLMotif::Menu("MainMenu",mainMenuPopup,false); mainMenu->setBorderWidth(0.0f); mainMenu->setOrientation(GLMotif::RowColumn::VERTICAL); mainMenu->setNumMinorWidgets(1); mainMenu->setMarginWidth(0.0f); mainMenu->setSpacing(Vrui::getUiSize()); GLMotif::Button* centerDisplayButton=new GLMotif::Button("CenterDisplayButton",mainMenu,"Center Display",Vrui::getUiFont()); centerDisplayButton->getSelectCallbacks().add(this,&VRMeshEditor::centerDisplayCallback); GLMotif::CascadeButton* draggerTypesCascade=new GLMotif::CascadeButton("DraggerTypesCascade",mainMenu,"Dragger Types",Vrui::getUiFont()); draggerTypesCascade->setPopup(createDraggerTypesMenu()); GLMotif::CascadeButton* influenceActionsCascade=new GLMotif::CascadeButton("InfluenceActionsCascade",mainMenu,"Influence Actions",Vrui::getUiFont()); influenceActionsCascade->setPopup(createInfluenceActionsMenu()); GLMotif::Button* createMorphBoxButton=new GLMotif::Button("CreateMorphBoxButton",mainMenu,"Create Morph Box",Vrui::getUiFont()); createMorphBoxButton->getSelectCallbacks().add(this,&VRMeshEditor::createMorphBoxCallback); GLMotif::Button* deleteMorphBoxButton=new GLMotif::Button("DeleteMorphBoxButton",mainMenu,"Delete Morph Box",Vrui::getUiFont()); deleteMorphBoxButton->getSelectCallbacks().add(this,&VRMeshEditor::deleteMorphBoxCallback); GLMotif::CascadeButton* settingsCascade=new GLMotif::CascadeButton("SettingsCascade",mainMenu,"Settings",Vrui::getUiFont()); settingsCascade->setPopup(createSettingsMenu()); GLMotif::Button* createInputDeviceButton=new GLMotif::Button("CreateInputDeviceButton",mainMenu,"Create Input Device",Vrui::getUiFont()); createInputDeviceButton->getSelectCallbacks().add(this,&VRMeshEditor::createInputDeviceCallback); mainMenu->manageChild(); return mainMenuPopup; }