Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEAttributesEditorRow.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// Row used for edit attributes in GNEAttributesEditorType
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
30class MFXLabelTooltip;
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
36
37class GNEAttributesEditorRow : protected FXHorizontalFrame {
39 FXDECLARE(GNEAttributesEditorRow)
40
41public:
44
46 bool showAttributeRow(GNEAttributesEditorType* attributeTable, const GNEAttributeProperties* attrProperty, const bool forceDisable);
47
49 bool hideAttributeRow();
50
52 void disable();
53
56
58 std::string getCurrentValue() const;
59
61 bool isValueValid() const;
62
64 bool isAttributeRowShown() const;
65
67 SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObject, const bool insertDefaultValues) const;
68
71
73 long onCmdSetAttribute(FXObject* obj, FXSelector, void*);
74
76 long onCmdToggleEnableAttribute(FXObject*, FXSelector, void*);
77
79 long onCmdOpenColorDialog(FXObject* sender, FXSelector, void* arg);
80
82 long onCmdOpenVClassDialog(FXObject*, FXSelector, void*);
83
85 long onCmdOpenFileDialog(FXObject*, FXSelector, void*);
86
88 long onCmdReparent(FXObject*, FXSelector, void*);
89
91 long onCmdInspectParent(FXObject*, FXSelector, void*);
92
94 long onCmdMoveLaneUp(FXObject*, FXSelector, void*);
95
97 long onCmdMoveLaneDown(FXObject*, FXSelector, void*);
98
100
101protected:
104
106 const std::string getAttributeValue(const bool enabled) const;
107
109 void showAttributeToggleEnable(const GNEAttributeProperties* attrProperty, const bool value);
110
112 void showAttributeReparent(const bool enabled);
113
115 void showAttributeInspectParent(const GNEAttributeProperties* attrProperty, const bool enabled);
116
118 void showAttributeVClass(const GNEAttributeProperties* attrProperty, const bool enabled);
119
121 void showAttributeColor(const GNEAttributeProperties* attrProperty, const bool enabled);
122
124 void showAttributeFile(const GNEAttributeProperties* attrProperty, const bool enabled);
125
127 void showAttributeLabel(const GNEAttributeProperties* attrProperty);
128
131
133 void showValueCheckButton(const std::string& value, const bool enabled, const bool computed);
134
136 void showValueComboBox(const GNEAttributeProperties* attrProperty, const std::string& value, const bool enabled, const bool computed);
137
139 void showValueString(const std::string& value, const bool enabled, const bool computed);
140
142 void showMoveLaneButtons(const std::string& laneID);
143
145 void enableElements(const GNEAttributeProperties* attrProperty, const bool forceDisable);
146
148 bool isAttributeEnabled(const GNEAttributeProperties* attrProperty) const;
149
150private:
153
156
159
161 FXCheckButton* myAttributeToggleEnableCheckButton = nullptr;
162
165
168
171
173 FXCheckButton* myValueCheckButton = nullptr;
174
177
180
183
186};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool isAttributeRowShown() const
check if current attribute row is shown
void enableElements(const GNEAttributeProperties *attrProperty, const bool forceDisable)
check if enable or disable all elements depending of current supermode or forceDisable
MFXButtonTooltip * myValueLaneUpButton
Button for move lane up.
void showValueComboBox(const GNEAttributeProperties *attrProperty, const std::string &value, const bool enabled, const bool computed)
show value for combo Box
FXCheckButton * myAttributeToggleEnableCheckButton
pointer to attribute menu check
MFXButtonTooltip * myAttributeButton
pointer to button that can be used for files, color, parent, vclass or inspect
long onCmdInspectParent(FXObject *, FXSelector, void *)
called when user press "inspect parent"
MFXButtonTooltip * myValueLaneDownButton
Button for move lane down.
const std::string getAttributeValue(const bool enabled) const
get value from edited ACs
long onCmdOpenColorDialog(FXObject *sender, FXSelector, void *arg)
called when user press "edit color" dialog
void showAttributeColor(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button color
bool isAttributeEnabled(const GNEAttributeProperties *attrProperty) const
check if the given attribute is enabled
void showAttributeVClass(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button vClass
MFXLabelTooltip * myAttributeLabel
pointer to attribute label
MFXComboBoxIcon * myValueComboBox
pointer to combo box for select choices
SumoXMLAttr fillSumoBaseObject(CommonXMLStructure::SumoBaseObject *baseObject, const bool insertDefaultValues) const
fill sumo Base object
bool isValueValid() const
check if current attribute row is valid
GNEAttributesEditorRow(GNEAttributesEditorRow *)=delete
Invalidated copy constructor.
bool hideAttributeRow()
hide attribute row (always return false)
void showAttributeLabel(const GNEAttributeProperties *attrProperty)
show attribute label
GNEAttributesEditorType * myAttributeTable
pointer to attribute table parent
long onCmdToggleEnableAttribute(FXObject *, FXSelector, void *)
called when user press the checkBox for toogle enable/disable attribute
std::string getCurrentValue() const
get current value in string format
const GNEAttributeProperties * getAttrProperty() const
get attribute property
GNEAttributesEditorRow()
default constructor (needed for FOX)
long onCmdMoveLaneDown(FXObject *, FXSelector, void *)
called when user press "move lane down"
long onCmdMoveLaneUp(FXObject *, FXSelector, void *)
called when user press "move lane up"
void showMoveLaneButtons(const std::string &laneID)
show move lane buttons
void showAttributeToggleEnable(const GNEAttributeProperties *attrProperty, const bool value)
show attribute toogle enable
FXCheckButton * myValueCheckButton
pointer to menu check
void showAttributeInspectParent(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button inspect parent
const GNEAttributeProperties * myAttrProperty
edited attribute property
GNEAttributesEditorRow & operator=(GNEAttributesEditorRow *)=delete
Invalidated assignment operator.
void showValueCheckButton(const std::string &value, const bool enabled, const bool computed)
show value for check button
MFXTextFieldIcon * myValueTextField
pointer to text field for modify values
void hideAllAttributeElements()
hide all attribute elements
long onCmdSetAttribute(FXObject *obj, FXSelector, void *)
set new string/bool attribute
bool showAttributeRow(GNEAttributesEditorType *attributeTable, const GNEAttributeProperties *attrProperty, const bool forceDisable)
return true if attribute row was successfully show
void showAttributeFile(const GNEAttributeProperties *attrProperty, const bool enabled)
show attribute button file
long onCmdOpenFileDialog(FXObject *, FXSelector, void *)
called when user press "open file" dialog
void showAttributeReparent(const bool enabled)
show attribute button reparent
long onCmdOpenVClassDialog(FXObject *, FXSelector, void *)
called when user press "open allow" dialog
void showValueString(const std::string &value, const bool enabled, const bool computed)
show value for strings
long onCmdReparent(FXObject *, FXSelector, void *)
called when user press reparent button