Skip to content

Commit

Permalink
Updated file menuCommands. Refs #13750
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Sep 4, 2023
1 parent 3438438 commit 29d25ce
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 22 deletions.
23 changes: 5 additions & 18 deletions src/netedit/GNEApplicationWindow.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -4753,6 +4735,11 @@ GNEApplicationWindow::clearUndoList() {
}


GNEApplicationWindowHelper::FileMenuCommands&
GNEApplicationWindow::getFileMenuCommands() {
return myFileMenuCommands;
}


GNEApplicationWindowHelper::EditMenuCommands&
GNEApplicationWindow::getEditMenuCommands() {
Expand Down
8 changes: 4 additions & 4 deletions src/netedit/GNEApplicationWindow.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions src/netedit/GNEApplicationWindowHelper.cpp
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions src/netedit/GNEApplicationWindowHelper.h
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions src/netedit/GNEViewNetHelper.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 29d25ce

Please sign in to comment.