Path: blob/main/src/netedit/frames/GNEAttributesEditorRow.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEAttributesEditorRow.h14/// @author Pablo Alvarez Lopez15/// @date Nov 202416///17// Row used for edit attributes in GNEAttributesEditorType18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEAttributesEditorType.h"2324// ===========================================================================25// class declaration26// ===========================================================================2728class GNEAttributeCarrier;29class MFXLabelTooltip;30class MFXTextFieldIcon;3132// ===========================================================================33// class definitions34// ===========================================================================3536class GNEAttributesEditorRow : protected FXHorizontalFrame {37/// @brief FOX-declaration38FXDECLARE(GNEAttributesEditorRow)3940public:41/// @brief constructor42GNEAttributesEditorRow(GNEAttributesEditorType* attributeTable);4344/// @brief return true if attribute row was successfully show45bool showAttributeRow(GNEAttributesEditorType* attributeTable, const GNEAttributeProperties* attrProperty, const bool forceDisable);4647/// @brief hide attribute row (always return false)48bool hideAttributeRow();4950/// @brief disable51void disable();5253/// @brief get attribute property54const GNEAttributeProperties* getAttrProperty() const;5556/// @brief get current value in string format57std::string getCurrentValue() const;5859/// @brief check if current attribute row is valid60bool isValueValid() const;6162/// @brief check if current attribute row is shown63bool isAttributeRowShown() const;6465/// @brief fill sumo Base object66SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObject, const bool insertDefaultValues) const;6768/// @name FOX-callbacks69/// @{7071/// @brief set new string/bool attribute72long onCmdSetAttribute(FXObject* obj, FXSelector, void*);7374/// @brief called when user press the checkBox for toogle enable/disable attribute75long onCmdToggleEnableAttribute(FXObject*, FXSelector, void*);7677/// @brief called when user press "edit color" dialog78long onCmdOpenColorDialog(FXObject* sender, FXSelector, void* arg);7980/// @brief called when user press "open allow" dialog81long onCmdOpenVClassDialog(FXObject*, FXSelector, void*);8283/// @brief called when user press "open file" dialog84long onCmdOpenFileDialog(FXObject*, FXSelector, void*);8586/// @brief called when user press reparent button87long onCmdReparent(FXObject*, FXSelector, void*);8889/// @brief called when user press "inspect parent"90long onCmdInspectParent(FXObject*, FXSelector, void*);9192/// @brief called when user press "move lane up"93long onCmdMoveLaneUp(FXObject*, FXSelector, void*);9495/// @brief called when user press "move lane down"96long onCmdMoveLaneDown(FXObject*, FXSelector, void*);9798/// @}99100protected:101/// @brief default constructor (needed for FOX)102GNEAttributesEditorRow();103104/// @brief get value from edited ACs105const std::string getAttributeValue(const bool enabled) const;106107/// @brief show attribute toogle enable108void showAttributeToggleEnable(const GNEAttributeProperties* attrProperty, const bool value);109110/// @brief show attribute button reparent111void showAttributeReparent(const bool enabled);112113/// @brief show attribute button inspect parent114void showAttributeInspectParent(const GNEAttributeProperties* attrProperty, const bool enabled);115116/// @brief show attribute button vClass117void showAttributeVClass(const GNEAttributeProperties* attrProperty, const bool enabled);118119/// @brief show attribute button color120void showAttributeColor(const GNEAttributeProperties* attrProperty, const bool enabled);121122/// @brief show attribute button file123void showAttributeFile(const GNEAttributeProperties* attrProperty, const bool enabled);124125/// @brief show attribute label126void showAttributeLabel(const GNEAttributeProperties* attrProperty);127128/// @brief hide all attribute elements129void hideAllAttributeElements();130131/// @brief show value for check button132void showValueCheckButton(const std::string& value, const bool enabled, const bool computed);133134/// @brief show value for combo Box135void showValueComboBox(const GNEAttributeProperties* attrProperty, const std::string& value, const bool enabled, const bool computed);136137/// @brief show value for strings138void showValueString(const std::string& value, const bool enabled, const bool computed);139140/// @brief show move lane buttons141void showMoveLaneButtons(const std::string& laneID);142143/// @brief check if enable or disable all elements depending of current supermode or forceDisable144void enableElements(const GNEAttributeProperties* attrProperty, const bool forceDisable);145146/// @brief check if the given attribute is enabled147bool isAttributeEnabled(const GNEAttributeProperties* attrProperty) const;148149private:150/// @brief pointer to attribute table parent151GNEAttributesEditorType* myAttributeTable;152153/// @brief edited attribute property154const GNEAttributeProperties* myAttrProperty = nullptr;155156/// @brief pointer to attribute label157MFXLabelTooltip* myAttributeLabel = nullptr;158159/// @brief pointer to attribute menu check160FXCheckButton* myAttributeToggleEnableCheckButton = nullptr;161162/// @brief pointer to button that can be used for files, color, parent, vclass or inspect163MFXButtonTooltip* myAttributeButton = nullptr;164165/// @brief pointer to text field for modify values166MFXTextFieldIcon* myValueTextField = nullptr;167168/// @brief pointer to combo box for select choices169MFXComboBoxIcon* myValueComboBox = nullptr;170171/// @brief pointer to menu check172FXCheckButton* myValueCheckButton = nullptr;173174/// @brief Button for move lane up175MFXButtonTooltip* myValueLaneUpButton = nullptr;176177/// @brief Button for move lane down178MFXButtonTooltip* myValueLaneDownButton = nullptr;179180/// @brief Invalidated copy constructor.181GNEAttributesEditorRow(GNEAttributesEditorRow*) = delete;182183/// @brief Invalidated assignment operator.184GNEAttributesEditorRow& operator=(GNEAttributesEditorRow*) = delete;185};186187188