Eclipse SUMO - Simulation of Urban MObility
GNEAttributesCreatorRow.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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 in AttributesCreator
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
25
26// ===========================================================================
27// class declaration
28// ===========================================================================
29
30class GNEFrame;
32
33// ===========================================================================
34// class definitions
35// ===========================================================================
36
37class GNEAttributesCreatorRow : public FXHorizontalFrame {
40
41public:
43 GNEAttributesCreatorRow(GNEAttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties);
44
46 void destroy();
47
50
52 std::string getValue() const;
53
56
58 void setAttributeCheckButtonCheck(bool value);
59
62
65
68
70 void refreshRow();
71
73 void disableRow();
74
76 bool isAttributeValid() const;
77
80
84 long onCmdSetAttribute(FXObject*, FXSelector, void*);
85
87 long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*);
89
90protected:
91 FOX_CONSTRUCTOR(GNEAttributesCreatorRow)
92
93
94 std::string generateID() const;
95
97 bool isValidID() const;
98
99private:
102
105
107 std::string myInvalidValue;
108
111
113 FXCheckButton* myEnableAttributeCheckButton = nullptr;
114
116 FXButton* myAttributeButton = nullptr;
117
119 FXTextField* myValueTextField = nullptr;
120
122 FXCheckButton* myValueCheckButton = nullptr;
123
125 FXComboBox* myValueComboBox = nullptr;
126};
std::string generateID() const
generate ID
MFXLabelTooltip * myAttributeLabel
Label with the name of the attribute.
FXTextField * myValueTextField
textField to modify the default value of string parameters
FXCheckButton * myValueCheckButton
check button to enable/disable the value of boolean parameters
void enableAttributesCreatorRow()
enable row
bool getAttributeCheckButtonCheck() const
return status of label checkbox button
GNEAttributesCreatorRow(GNEAttributesCreator *AttributesCreatorParent, const GNEAttributeProperties &attrProperties)
FOX-declaration.
bool isValidID() const
check if current ID placed in myValueTextField is valid
bool isAttributesCreatorRowEnabled() const
check if row is enabled
long onCmdSetAttribute(FXObject *, FXSelector, void *)
FXComboBox * myValueComboBox
comboBox for discrete vaues
std::string getValue() const
return value
void destroy()
destroy GNEAttributesCreatorRow (but don't delete)
bool isAttributeValid() const
check if current attribute is valid
void disableAttributesCreatorRow()
disable row
long onCmdOpenAttributeDialog(FXObject *, FXSelector, void *)
called when user press the open dialog button
void setAttributeCheckButtonCheck(bool value)
enable or disable label checkbox button for Terminatel attributes
GNEAttributesCreator * myAttributesCreatorParent
pointer to GNEAttributesCreator
FXCheckButton * myEnableAttributeCheckButton
check button to enable/disable Label attribute
const GNEAttributeProperties & getAttrProperties() const
return Attr
std::string myInvalidValue
string which indicates the reason due current value is invalid
const GNEAttributeProperties myAttrProperties
attribute properties
FXButton * myAttributeButton
Button for open color or allow/disallow editor.
GNEAttributesCreator * getAttributesCreatorParent() const
get GNEAttributesCreator parent