Skip to content

Commit

Permalink
Removed additional dialog. Refs #15776
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Dec 4, 2024
1 parent ba3d2c6 commit 4150e90
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 177 deletions.
21 changes: 4 additions & 17 deletions src/netedit/frames/GNEAttributesEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,16 @@
#include <netedit/GNENet.h>
#include <netedit/GNEUndoList.h>
#include <netedit/GNEViewNet.h>
#include <netedit/GNEViewNetHelper.h>
#include <netedit/GNEViewParent.h>
#include <netedit/dialogs/GNEAllowVClassesDialog.h>
#include <netedit/dialogs/GNECalibratorDialog.h>
#include <netedit/dialogs/GNEMultipleParametersDialog.h>
#include <netedit/dialogs/GNERerouterDialog.h>
#include <netedit/dialogs/GNESingleParametersDialog.h>
#include <netedit/dialogs/GNEVariableSpeedSignDialog.h>
#include <netedit/elements/GNEAttributeCarrier.h>
#include <netedit/elements/additional/GNECalibrator.h>
#include <netedit/elements/additional/GNERerouter.h>
#include <netedit/elements/additional/GNEVariableSpeedSign.h>
#include <netedit/frames/common/GNEInspectorFrame.h>
#include <netedit/frames/demand/GNETypeFrame.h>
#include <utils/common/Parameterised.h>
#include <utils/common/StringTokenizer.h>
#include <utils/foxtools/MFXLabelTooltip.h>
#include <utils/foxtools/MFXTextFieldTooltip.h>
#include <utils/foxtools/MFXToggleButtonTooltip.h>
#include <utils/gui/div/GUIDesigns.h>
#include <utils/gui/images/POIIcons.h>
#include <utils/gui/images/VClassIcons.h>
#include <utils/gui/windows/GUIAppEnum.h>

#include "GNEAttributesEditor.h"
#include "GNEAttributesEditorRow.h"
Expand Down Expand Up @@ -278,15 +265,15 @@ long
GNEAttributesEditor::onCmdOpenElementDialog(FXObject*, FXSelector, void*) {
// check number of inspected elements
if (myEditedACs.size() == 1) {
const auto tag = myEditedACs.front()->getTagProperty().getTag();
const auto editedTag = myEditedACs.front()->getTagProperty().getTag();
// check AC
if (tag == SUMO_TAG_REROUTER) {
if (editedTag == SUMO_TAG_REROUTER) {
// Open rerouter dialog
GNERerouterDialog(dynamic_cast<GNERerouter*>(myEditedACs.front()));
} else if ((tag == SUMO_TAG_CALIBRATOR) || (tag == GNE_TAG_CALIBRATOR_LANE)) {
} else if ((editedTag == SUMO_TAG_CALIBRATOR) || (editedTag == GNE_TAG_CALIBRATOR_LANE)) {
// Open calibrator dialog
GNECalibratorDialog(dynamic_cast<GNECalibrator*>(myEditedACs.front()));
} else if (tag == SUMO_TAG_VSS) {
} else if (editedTag == SUMO_TAG_VSS) {
// Open VSS dialog
GNEVariableSpeedSignDialog(dynamic_cast<GNEVariableSpeedSign*>(myEditedACs.front()));
}
Expand Down
12 changes: 2 additions & 10 deletions src/netedit/frames/GNEAttributesEditorRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,16 @@
///
// Row used for edit attributes in GNEAttributesEditor
/****************************************************************************/
#include <config.h>

#include <netedit/elements/GNEAttributeCarrier.h>
#include <netedit/dialogs/GNEMultipleParametersDialog.h>
#include <netedit/GNEApplicationWindow.h>
#include <netedit/GNENet.h>
#include <netedit/GNEUndoList.h>
#include <netedit/GNEViewNet.h>
#include <netedit/GNEViewParent.h>
#include <netedit/GNEApplicationWindow.h>
#include <netedit/dialogs/GNEAllowVClassesDialog.h>
#include <netedit/dialogs/GNESingleParametersDialog.h>
#include <netedit/frames/common/GNEInspectorFrame.h>
#include <netedit/frames/demand/GNETypeFrame.h>
#include <utils/common/StringTokenizer.h>
#include <utils/gui/div/GUIDesigns.h>
#include <utils/gui/images/VClassIcons.h>
#include <utils/gui/images/POIIcons.h>
#include <utils/gui/windows/GUIAppEnum.h>
#include <utils/gui/images/VClassIcons.h>

#include "GNEAttributesEditorRow.h"

Expand Down
110 changes: 2 additions & 108 deletions src/netedit/frames/common/GNEInspectorFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,17 @@
///
// The Widget for modifying network-element attributes (i.e. lane speed)
/****************************************************************************/
#include <config.h>

#include <netedit/GNENet.h>
#include <netedit/GNEUndoList.h>
#include <netedit/GNEViewNet.h>
#include <netedit/GNEViewParent.h>
#include <netedit/GNEApplicationWindow.h>
#include <netedit/elements/additional/GNERerouter.h>
#include <netedit/elements/additional/GNECalibrator.h>
#include <netedit/elements/additional/GNEVariableSpeedSign.h>
#include <netedit/elements/network/GNEEdgeTemplate.h>
#include <netedit/dialogs/GNEMultipleParametersDialog.h>
#include <netedit/dialogs/GNERerouterDialog.h>
#include <netedit/dialogs/GNECalibratorDialog.h>
#include <netedit/dialogs/GNEVariableSpeedSignDialog.h>
#include <netedit/dialogs/GNESingleParametersDialog.h>
#include <netedit/frames/network/GNECreateEdgeFrame.h>
#include <utils/gui/div/GUIDesigns.h>
#include <utils/gui/windows/GUIAppEnum.h>

#include "GNEInspectorFrame.h"
#include "GNEDeleteFrame.h"


// ===========================================================================
Expand All @@ -56,14 +45,9 @@ FXDEFMAP(GNEInspectorFrame::TemplateEditor) TemplateEditorMap[] = {
FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GNEInspectorFrame::TemplateEditor::onCmdClearTemplate),
};

FXDEFMAP(GNEInspectorFrame::AdditionalDialog) AdditionalDialogMap[] = {
FXMAPFUNC(SEL_COMMAND, MID_OPEN_ADDITIONAL_DIALOG, GNEInspectorFrame::AdditionalDialog::onCmdOpenAdditionalDialog),
};

// Object implementation
FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, MFXGroupBoxModule, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap))
FXIMPLEMENT(GNEInspectorFrame::AdditionalDialog, MFXGroupBoxModule, AdditionalDialogMap, ARRAYNUMBER(AdditionalDialogMap))
FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap))
FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, MFXGroupBoxModule, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap))


// ===========================================================================
Expand Down Expand Up @@ -251,89 +235,6 @@ GNEInspectorFrame::TemplateEditor::updateButtons() {
}
}

// ---------------------------------------------------------------------------
// GNEInspectorFrame::AdditionalDialog - methods
// ---------------------------------------------------------------------------

GNEInspectorFrame::AdditionalDialog::AdditionalDialog(GNEInspectorFrame* inspectorFrameParent) :
MFXGroupBoxModule(inspectorFrameParent, TL("Additional dialog")),
myInspectorFrameParent(inspectorFrameParent) {
// Create mark as front element button
myOpenAdditionalDialog = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Additional dialog"), "", "", nullptr, this, MID_OPEN_ADDITIONAL_DIALOG, GUIDesignButton);
}


GNEInspectorFrame::AdditionalDialog::~AdditionalDialog() {}


void
GNEInspectorFrame::AdditionalDialog::showAdditionalDialog() {
const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
// check number of inspected elements
if (inspectedElements.isInspectingSingleElement()) {
// get first inspected AC tag
auto firstInspectedACTag = inspectedElements.getFirstAC()->getTagProperty().getTag();
// check AC
if (firstInspectedACTag == SUMO_TAG_REROUTER) {
// update button
myOpenAdditionalDialog->setText(TL("Open rerouter dialog"));
myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::REROUTER));
// show module
show();
} else if (firstInspectedACTag == SUMO_TAG_CALIBRATOR) {
// update button
myOpenAdditionalDialog->setText(TL("Open calibrator dialog"));
myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::CALIBRATOR));
// show module
show();
} else if (firstInspectedACTag == GNE_TAG_CALIBRATOR_LANE) {
// update button
myOpenAdditionalDialog->setText(TL("Open calibrator lane dialog"));
myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::CALIBRATOR));
// show module
show();
} else if (firstInspectedACTag == SUMO_TAG_VSS) {
// update button
myOpenAdditionalDialog->setText(TL("Open VSS dialog"));
myOpenAdditionalDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::VARIABLESPEEDSIGN));
// show module
show();
}
} else {
// hide module
hide();
}
}


void
GNEInspectorFrame::AdditionalDialog::hideAdditionalDialog() {
// hide groupbox
hide();
}


long
GNEInspectorFrame::AdditionalDialog::onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*) {
const auto& inspectedElements = myInspectorFrameParent->getViewNet()->getInspectedElements();
// check number of inspected elements
if (inspectedElements.isInspectingSingleElement()) {
// check AC
if (inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_REROUTER) {
// Open rerouter dialog
GNERerouterDialog(dynamic_cast<GNERerouter*>(inspectedElements.getFirstAC()));
} else if ((inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_CALIBRATOR) ||
(inspectedElements.getFirstAC()->getTagProperty().getTag() == GNE_TAG_CALIBRATOR_LANE)) {
// Open calibrator dialog
GNECalibratorDialog(dynamic_cast<GNECalibrator*>(inspectedElements.getFirstAC()));
} else if (inspectedElements.getFirstAC()->getTagProperty().getTag() == SUMO_TAG_VSS) {
// Open VSS dialog
GNEVariableSpeedSignDialog(dynamic_cast<GNEVariableSpeedSign*>(inspectedElements.getFirstAC()));
}
}
return 1;
}

// ---------------------------------------------------------------------------
// GNEInspectorFrame - methods
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -364,9 +265,6 @@ GNEInspectorFrame::GNEInspectorFrame(GNEViewParent* viewParent, GNEViewNet* view
// Create Netedit Attributes Editor module
myNeteditAttributesEditor = new GNEAttributesEditor(this, TL("Netedit attributes"), GNEAttributesEditor::EditorOptions::NETEDIT_ATTRIBUTES);

// create additional dialog
myAdditionalDialog = new AdditionalDialog(this);

// Create Template editor module
myTemplateEditor = new TemplateEditor(this);

Expand Down Expand Up @@ -559,7 +457,6 @@ GNEInspectorFrame::refreshInspection() {
myOverlappedInspection->refreshOverlappedInspection();
// Hide other moduls
myParametersEditor->hideParametersEditor();
myAdditionalDialog->hideAdditionalDialog();
myTemplateEditor->hideTemplateEditor();
myHierarchicalElementTree->hideHierarchicalElementTree();
// If vector of attribute Carriers contain data
Expand Down Expand Up @@ -606,9 +503,6 @@ GNEInspectorFrame::refreshInspection() {
// show parameters editor
myParametersEditor->showParametersEditor();

// show additional dialog
myAdditionalDialog->showAdditionalDialog();

// If attributes correspond to an Edge and we aren't in demand mode, show template editor
myTemplateEditor->showTemplateEditor();

Expand Down
42 changes: 0 additions & 42 deletions src/netedit/frames/common/GNEInspectorFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,45 +120,6 @@ class GNEInspectorFrame : public GNEFrame {
GNEEdgeTemplate* myEdgeTemplate;
};

// ===========================================================================
// class AdditionalDialog
// ===========================================================================

class AdditionalDialog : public MFXGroupBoxModule {
/// @brief FOX-declaration
FXDECLARE(GNEInspectorFrame::AdditionalDialog)

public:
/// @brief constructor
AdditionalDialog(GNEInspectorFrame* inspectorFrameParent);

/// @brief destructor
~AdditionalDialog();

/// @brief show netedit attributes editor
void showAdditionalDialog();

/// @brief hide netedit attributes editor
void hideAdditionalDialog();

/// @name FOX-callbacks
/// @{
/// @brief Called when user click over open additional dialog
long onCmdOpenAdditionalDialog(FXObject*, FXSelector, void*);
/// @}

protected:
/// @brief FOX need this
FOX_CONSTRUCTOR(AdditionalDialog)

private:
/// @brief pointer to inspector frame parent
GNEInspectorFrame* myInspectorFrameParent;

/// @brief button for open additional dialog
FXButton* myOpenAdditionalDialog;
};

/**@brief Constructor
* @brief viewParent GNEViewParent in which this GNEFrame is placed
* @brief net net that uses this GNEFrame
Expand Down Expand Up @@ -261,9 +222,6 @@ class GNEInspectorFrame : public GNEFrame {
/// @brief Parameters editor inspector
GNEFrameAttributeModules::ParametersEditor* myParametersEditor;

/// @brief Additional dialog
AdditionalDialog* myAdditionalDialog;

/// @brief Template editor
TemplateEditor* myTemplateEditor;

Expand Down

0 comments on commit 4150e90

Please sign in to comment.