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-2024 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 GNEAttributesEditor
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25#include "GNEAttributesEditor.h"
26
27// ===========================================================================
28// class declaration
29// ===========================================================================
30
33
34// ===========================================================================
35// class definitions
36// ===========================================================================
37
38class GNEAttributesEditorRow : protected FXHorizontalFrame {
40 FXDECLARE(GNEAttributesEditorRow)
41
42public:
45
47 bool showAttributeRow(const GNEAttributeProperties& attrProperty, const bool forceDisable);
48
50 bool hideAttributeRow();
51
53 bool isAttributeRowShown() const;
54
57
59 long onCmdSetAttribute(FXObject* obj, FXSelector, void*);
60
62 long onCmdToggleEnableAttribute(FXObject*, FXSelector, void*);
63
65 long onCmdOpenColorDialog(FXObject*, FXSelector, void*);
66
68 long onCmdOpenAllowDialog(FXObject*, FXSelector, void*);
69
71 long onCmdReparent(FXObject*, FXSelector, void*);
72
74 long onCmdInspectParent(FXObject*, FXSelector, void*);
75
77 long onCmdMoveLaneUp(FXObject*, FXSelector, void*);
78
80 long onCmdMoveLaneDown(FXObject*, FXSelector, void*);
81
83
84protected:
87
89 const std::string getAttributeValue(const bool enabled) const;
90
92 void showAttributeToggleEnable(const GNEAttributeProperties& attrProperty, const bool value);
93
95 void showAttributeReparent(const bool enabled);
96
98 void showAttributeInspectParent(const GNEAttributeProperties& attrProperty, const bool enabled);
99
101 void showAttributeVClass(const GNEAttributeProperties& attrProperty, const bool enabled);
102
104 void showAttributeColor(const GNEAttributeProperties& attrProperty, const bool enabled);
105
107 void showAttributeLabel(const GNEAttributeProperties& attrProperty);
108
110 void showValueCheckButton(const std::string& value, const bool enabled, const bool computed);
111
113 void showValueComboBox(const GNEAttributeProperties& attrProperty, const std::string& value, const bool enabled, const bool computed);
114
116 void showValueString(const std::string& value, const bool enabled, const bool computed);
117
119 void showMoveLaneButtons(const std::string& laneID);
120
122 void enableElements(const GNEAttributeProperties& attrProperty, const bool forceDisable);
123
126
127private:
130
133
136
138 FXCheckButton* myAttributeToggleEnableCheckButton = nullptr;
139
142
145
148
151
154
157
159 FXCheckButton* myValueCheckButton = nullptr;
160
163
166
169
172};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_NOTHING
invalid attribute, must be the last one
SumoXMLAttr myAttribute
edited attribute
bool isAttributeRowShown() const
check if current attribute row is shown
bool showAttributeRow(const GNEAttributeProperties &attrProperty, const bool forceDisable)
return true if attribute row was successfully show
MFXButtonTooltip * myValueLaneUpButton
Button for move lane up.
FXCheckButton * myAttributeToggleEnableCheckButton
pointer to attribute menu check
void enableElements(const GNEAttributeProperties &attrProperty, const bool forceDisable)
check if enable or disable all elements depending of current supermode or forceDisable
long onCmdInspectParent(FXObject *, FXSelector, void *)
called when user press "inspect parent"
long onCmdOpenAllowDialog(FXObject *, FXSelector, void *)
called when user press "open allow" dialog
long onCmdOpenColorDialog(FXObject *, FXSelector, void *)
called when user press "edit color" dialog
MFXButtonTooltip * myValueLaneDownButton
Button for move lane down.
const std::string getAttributeValue(const bool enabled) const
get value from edited ACs
void showAttributeLabel(const GNEAttributeProperties &attrProperty)
show attribute label
MFXLabelTooltip * myAttributeLabel
pointer to attribute label
MFXComboBoxIcon * myValueComboBox
pointer to combo box for select choices
GNEAttributesEditorRow(GNEAttributesEditorRow *)=delete
Invalidated copy constructor.
bool hideAttributeRow()
hide attribute row (always return false)
void showValueComboBox(const GNEAttributeProperties &attrProperty, const std::string &value, const bool enabled, const bool computed)
show value for combo Box
long onCmdToggleEnableAttribute(FXObject *, FXSelector, void *)
called when user press the checkBox for toogle enable/disable attribute
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
GNEAttributesEditor * myAttributeTable
check junction merging bool mergeJunction(SumoXMLAttr attr, const std::string& newVal) const;
void showAttributeInspectParent(const GNEAttributeProperties &attrProperty, const bool enabled)
show attribute parent
void showAttributeVClass(const GNEAttributeProperties &attrProperty, const bool enabled)
show attribute vClass
FXCheckButton * myValueCheckButton
pointer to menu check
MFXButtonTooltip * myAttributeColorButton
pointer to attribute color button
GNEAttributesEditorRow & operator=(GNEAttributesEditorRow *)=delete
Invalidated assignment operator.
void showValueCheckButton(const std::string &value, const bool enabled, const bool computed)
show value for check button
MFXButtonTooltip * myAttributeVClassButton
pointer to attribute vClass button
long onCmdSetAttribute(FXObject *obj, FXSelector, void *)
set new string/bool attribute
void showAttributeColor(const GNEAttributeProperties &attrProperty, const bool enabled)
show attribute color
MFXButtonTooltip * myAttributeReparentButton
pointer to attribute reparent button
void showAttributeReparent(const bool enabled)
show attribute reparent
MFXButtonTooltip * myAttributeInspectParentButton
pointer to attribute inspect parent button
MFXTextFieldTooltip * myValueTextField
pointer to text field for modify values
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
ComboBox with icon.