63 myFrameParent(frameParent) {
76 refreshGenericDataAttributes();
91 myTextFieldParameters->setText(getParametersStr().c_str());
92 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
93 myTextFieldParameters->killFocus();
107 for (
const auto& parameter : myParameters) {
108 result += parameter.first +
"=" + parameter.second +
"|";
111 if (!result.empty()) {
118std::vector<std::pair<std::string, std::string> >
120 std::vector<std::pair<std::string, std::string> > result;
122 for (
const auto& parameter : myParameters) {
123 result.push_back(std::make_pair(parameter.first, parameter.second));
134 for (
const auto& parameter : parameters) {
135 result += parameter.first +
"=" + parameter.second +
"|";
138 if (!result.empty()) {
142 myTextFieldParameters->setText(result.c_str(), TRUE);
148 return myFrameParent;
154 if (myTextFieldParameters->getText().empty()) {
156 }
else if (myTextFieldParameters->getTextColor() == FXRGB(255, 0, 0)) {
168 refreshGenericDataAttributes();
177 myParameters.clear();
181 myTextFieldParameters->setTextColor(FXRGB(0, 0, 0));
182 myTextFieldParameters->killFocus();
184 std::vector<std::string> parameters =
StringTokenizer(myTextFieldParameters->getText().text(),
"|",
true).
getVector();
186 for (
const auto& parameter : parameters) {
190 myParameters[keyParam.front()] = keyParam.back();
193 myTextFieldParameters->setText(getParametersStr().c_str(), FALSE);
195 myTextFieldParameters->setTextColor(FXRGB(255, 0, 0));
205 if (tagProperty->isNetworkElement() || tagProperty->isAdditionalElement()) {
213 tagProperty->isDemandElement()) {
216 (tagProperty->isDataElement() || tagProperty->isMeanData())) {
FXDEFMAP(GNEFrameAttributeModules::GenericDataAttributes) GenericDataAttributesMap[]
@ MID_GNE_SET_ATTRIBUTE
attribute edited
@ MID_GNE_ATTRIBUTESEDITOR_PARAMETERS
open generic parameters editor
#define GUIDesignTextField
#define GUIDesignTextFieldNCol
Num of column of text field.
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
const GNETagProperties * getTagPropertyParent() const
get reference to tagProperty parent
~GenericDataAttributes()
destructor
long onCmdSetParameters(FXObject *, FXSelector, void *)
Called when user udpate the parameter text field.
bool areAttributesValid() const
check if current attributes are valid
const Parameterised::Map & getParametersMap() const
get parameters as map
void refreshGenericDataAttributes()
refresh netedit attributes
void showGenericDataAttributes()
show netedit attributes EditorCreator
long onCmdEditParameters(FXObject *, FXSelector, void *)
GNEFrame * getFrameParent() const
pointer to frame parent
std::vector< std::pair< std::string, std::string > > getParameters() const
get parameters as vector of strings
std::string getParametersStr() const
get parameters as string
void hideGenericDataAttributes()
hide netedit attributes EditorCreator
void setParameters(const std::vector< std::pair< std::string, std::string > > ¶meters)
set parameters
static bool isSupermodeValid(const GNEViewNet *viewNet, const GNEAttributeCarrier *AC)
return true if AC can be edited in the current supermode
Dialog for edit parameters.
bool isMeanData() const
return true if tag correspond to a mean data element
bool isNetworkElement() const
element sets
bool isDataElement() const
return true if tag correspond to a data element
bool isDemandElement() const
return true if tag correspond to a demand element
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
static FXButton * buildFXButton(FXComposite *p, const std::string &text, const std::string &tip, const std::string &help, FXIcon *ic, FXObject *tgt, FXSelector sel, FXuint opts=BUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
build button
MFXGroupBoxModule (based on FXGroupBox)
static bool areAttributesValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to an attributes map "key1=value1|key2=value2|....
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::map< std::string, std::string > Map
parameters map
std::vector< std::string > getVector()
return vector of strings
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network