Skip to content

Commit

Permalink
Updated GNEAttributesEditor. Refs #9731
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Feb 20, 2025
1 parent c78e8b4 commit 1803a11
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/netedit/frames/GNEAttributesEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,16 @@ GNEAttributesEditor::refreshAttributesEditor() {
}


void
GNEAttributesEditor::disableAttributesEditor() {
for (const auto& row : myAttributesEditorRows) {
row->disable();
}
}


bool
GNEAttributesEditor::checkAttributes(const bool showWarning) {
// iterate over standar parameters
for (const auto& row : myAttributesEditorRows) {
if (!row->isValueValid())
if (showWarning) {
Expand Down
3 changes: 3 additions & 0 deletions src/netedit/frames/GNEAttributesEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class GNEAttributesEditor : public MFXGroupBoxModule {
/// @brief refresh attribute editor
void refreshAttributesEditor();

/// @brief disable attribute editor
void disableAttributesEditor();

/// @brief check if current edited attributes are valid
bool checkAttributes(const bool showWarning);

Expand Down
17 changes: 16 additions & 1 deletion src/netedit/frames/GNEAttributesEditorRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,22 @@ GNEAttributesEditorRow::hideAttributeRow() {
}


void
GNEAttributesEditorRow::disable() {
// disable all elements
myAttributeToggleEnableCheckButton->disable();
myAttributeReparentButton->disable();
myAttributeInspectParentButton->disable();
myAttributeVClassButton->disable();
myAttributeColorButton->disable();
myValueTextField->disable();
myValueComboBox->disable();
myValueCheckButton->disable();
myValueLaneUpButton->disable();
myValueLaneDownButton->disable();
}


const GNEAttributeProperties*
GNEAttributesEditorRow::getAttrProperty() const {
return myAttrProperty;
Expand Down Expand Up @@ -686,7 +702,6 @@ GNEAttributesEditorRow::showAttributeLabel(const GNEAttributeProperties* attrPro

void
GNEAttributesEditorRow::hideAllAttributeElements() {
// hide other elements
myAttributeLabel->hide();
myAttributeToggleEnableCheckButton->hide();
myAttributeReparentButton->hide();
Expand Down
6 changes: 3 additions & 3 deletions src/netedit/frames/GNEAttributesEditorRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class GNEAttributesEditorRow : protected FXHorizontalFrame {
/// @brief hide attribute row (always return false)
bool hideAttributeRow();

/// @brief disable
void disable();

/// @brief get attribute property
const GNEAttributeProperties* getAttrProperty() const;

Expand Down Expand Up @@ -139,9 +142,6 @@ class GNEAttributesEditorRow : protected FXHorizontalFrame {
/// @brief check if the given attribute is enabled
bool isAttributeEnabled(const GNEAttributeProperties* attrProperty) const;

/// @brief check junction merging
/// bool mergeJunction(SumoXMLAttr attr, const std::string& newVal) const;

private:
/// @brief pointer to attribute table parent
GNEAttributesEditor* myAttributeTable;
Expand Down

0 comments on commit 1803a11

Please sign in to comment.