diff --git a/src/netedit/GNEApplicationWindow.cpp b/src/netedit/GNEApplicationWindow.cpp index 8eae600644e..1b5dd4dfc60 100644 --- a/src/netedit/GNEApplicationWindow.cpp +++ b/src/netedit/GNEApplicationWindow.cpp @@ -1787,24 +1787,6 @@ GNEApplicationWindow::consoleOptionsLoaded() { } -void -GNEApplicationWindow::viewUpdated() { - if (myViewNet) { - // adjust supermode commmand - if (myViewNet->getEditModes().isJuPedSimView()) { - mySupermodeCommands.dataMode->hide(); - // set width (grip + 2 large buttons + icon button) - myToolbarsGrip.superModes->setWidth(250); - } else { - mySupermodeCommands.dataMode->show(); - // set width (grip + 3 large buttons + icon button) - myToolbarsGrip.superModes->setWidth(353); - } - myViewNet->viewUpdated(); - } -} - - long GNEApplicationWindow::onCmdSetSuperMode(FXObject* sender, FXSelector sel, void* ptr) { // check that currently there is a View @@ -4753,6 +4735,11 @@ GNEApplicationWindow::clearUndoList() { } +GNEApplicationWindowHelper::FileMenuCommands& +GNEApplicationWindow::getFileMenuCommands() { + return myFileMenuCommands; +} + GNEApplicationWindowHelper::EditMenuCommands& GNEApplicationWindow::getEditMenuCommands() { diff --git a/src/netedit/GNEApplicationWindow.h b/src/netedit/GNEApplicationWindow.h index 9da96a817a7..727331ea6d2 100644 --- a/src/netedit/GNEApplicationWindow.h +++ b/src/netedit/GNEApplicationWindow.h @@ -81,9 +81,6 @@ class GNEApplicationWindow : public GUIMainWindow, public MFXInterThreadEventCli /// @brief check if console options was already loaded bool consoleOptionsLoaded(); - /// @brief called when view is updated - void viewUpdated(); - /// @name Inter-thread event handling /// @{ /// @brief called when an event occurred @@ -574,7 +571,10 @@ class GNEApplicationWindow : public GUIMainWindow, public MFXInterThreadEventCli /// @brief clear undo list void clearUndoList(); - /// @brief getEdit Menu Commands (needed for show/hide menu commands) + /// @brief get file Menu Commands (needed for show/hide menu commands) + GNEApplicationWindowHelper::FileMenuCommands& getFileMenuCommands(); + + /// @brief get Edit Menu Commands (needed for show/hide menu commands) GNEApplicationWindowHelper::EditMenuCommands& getEditMenuCommands(); /// @brief get processing Menu Commands diff --git a/src/netedit/GNEApplicationWindowHelper.cpp b/src/netedit/GNEApplicationWindowHelper.cpp index 23ca26b17fe..dc1ca8fd970 100644 --- a/src/netedit/GNEApplicationWindowHelper.cpp +++ b/src/netedit/GNEApplicationWindowHelper.cpp @@ -333,6 +333,32 @@ GNEApplicationWindowHelper::FileMenuCommands::disableMenuCascades() { } +void +GNEApplicationWindowHelper::FileMenuCommands::showTLSMenuCommand() { + myTLSMenuCascade->show(); +} + + +void +GNEApplicationWindowHelper::FileMenuCommands::hideTLSMenuCommand() { + myTLSMenuCascade->hide(); +} + + +void +GNEApplicationWindowHelper::FileMenuCommands::showDataMenuCommands() { + myDataMenuCascade->show(); + myMeanDataMenuCascade->show(); +} + + +void +GNEApplicationWindowHelper::FileMenuCommands::hideDataMenuCommands() { + myDataMenuCascade->hide(); + myMeanDataMenuCascade->hide(); +} + + void GNEApplicationWindowHelper::FileMenuCommands::buildNeteditConfigSection(FXMenuPane* menuPane) { GUIDesigns::buildFXMenuCommandShortcut(menuPane, diff --git a/src/netedit/GNEApplicationWindowHelper.h b/src/netedit/GNEApplicationWindowHelper.h index 1583c7bd111..7c1d60a5922 100644 --- a/src/netedit/GNEApplicationWindowHelper.h +++ b/src/netedit/GNEApplicationWindowHelper.h @@ -173,6 +173,18 @@ struct GNEApplicationWindowHelper { /// @brief disable menu cascades void disableMenuCascades(); + /// @brief show TLS menuCommand + void showTLSMenuCommand(); + + /// @brief hide TLS menuCommand (used in JuPedSim mode) + void hideTLSMenuCommand(); + + /// @brief show data menuCommands + void showDataMenuCommands(); + + /// @brief hide data menuCommands (used in JuPedSim mode) + void hideDataMenuCommands(); + private: /// @brief build netedit config section void buildNeteditConfigSection(FXMenuPane* menuPane); diff --git a/src/netedit/GNEViewNetHelper.cpp b/src/netedit/GNEViewNetHelper.cpp index acfb65e598d..45c285d3681 100644 --- a/src/netedit/GNEViewNetHelper.cpp +++ b/src/netedit/GNEViewNetHelper.cpp @@ -2367,13 +2367,21 @@ void GNEViewNetHelper::EditModes::setView(FXSelector sel) { // grip supermodes auto gripSupermodes = myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes; + // file menu commands + auto &fileMenuCommands = myViewNet->getViewParent()->getGNEAppWindows()->getFileMenuCommands(); // continue depending of selector if (sel == MID_GNE_VIEW_DEFAULT) { myNeteditViewsButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::VIEWDEFAULT)); gripSupermodes->setWidth(353); + // show menu commands + fileMenuCommands.showTLSMenuCommand(); + fileMenuCommands.showDataMenuCommands(); } else if (sel == MID_GNE_VIEW_JUPEDSIM) { myNeteditViewsButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::VIEWJUPEDSIM)); gripSupermodes->setWidth(250); + // hide menu commands + fileMenuCommands.hideTLSMenuCommand(); + fileMenuCommands.hideDataMenuCommands(); } // update viewNet myViewNet->viewUpdated();