58 myACDialogParent(ACDialog),
59 myAttrProperty(attrProperty) {
61 const auto tooltipMenu = ACDialog->getElement()->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
64 myAttributeButton =
new MFXButtonTooltip(
this, tooltipMenu, attrProperty->getAttrStr(),
nullptr,
this,
66 myAttributeButton->setTipText(
TL(
"Open dialog for editing vClasses"));
67 }
else if (attrProperty->isColor()) {
70 myAttributeButton->setTipText(
TL(
"Open dialog for editing color"));
76 if (attrProperty->isBool()) {
81 myCheckButton->setCheck(TRUE);
82 myCheckButton->setText(
TL(
"true"));
84 myCheckButton->setCheck(FALSE);
85 myCheckButton->setText(
TL(
"false"));
91 myTextField->setText(ACDialog->getElement()->getAttribute(attrProperty->getAttr()).c_str());
134 if (GNEAttributeCarrier::canParse<RGBColor>(myTextField->getText().text())) {
135 color = GNEAttributeCarrier::parse<RGBColor>(myTextField->getText().text());
136 }
else if (myAttrProperty->hasDefaultValue()) {
137 color = myAttrProperty->getDefaultColorValue();
140 const auto colorDialog =
new GNEColorDialog(myACDialogParent->getApplicationWindow(), color);
143 myTextField->setText(
toString(colorDialog->getColor()).c_str(), TRUE);
152 const auto allowVClassesDialog =
new GNEVClassesDialog(myACDialogParent->getApplicationWindow(), myAttrProperty->getAttr(),
153 myTextField->getText().text());
156 myTextField->setText(allowVClassesDialog->getModifiedVClasses().c_str(), TRUE);
172 std::vector<const GNEAttributeProperties*> attrProperties;
175 if (attrProperty->isEditMode() && attrProperty->isBasicEditor()) {
176 attrProperties.push_back(attrProperty);
180 for (
size_t i = 0; i < attrProperties.size(); i++) {
182 auto attributeTextField =
new AttributeTextField(
this, (i % 2 == 0) ? columnLeft : columnRight, attrProperties[i]);
208 TLF(
"The % '%' cannot be updated because there are invalid attributes.",
FXDEFMAP(GNEAttributeCarrierDialog::AttributeTextField) AttributeTextFieldMap[]
@ MID_GNE_ATTRIBUTESEDITORROW_SETATTRIBUTE
set attribute (string, bool, etc.) in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_COLOR
open color dialog in attributes editor row
@ MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_ALLOW
open allow dialog in attributes editor row
#define GUIDesignButtonAttribute
button extended over over column with thick and raise frame
#define GUIDesignTextColorRed
red color (for invalid text)
#define GUIDesignTextField
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignBackgroundColorRed
red background color (for invalid text)
#define GUIDesignAuxiliarFrameFixedWidth(width)
design for auxiliar (Without borders) frame with fixed width and extended height
#define GUIDesignTextColorBlack
black color (for correct text)
#define GUIDesignBackgroundColorWhite
white background color (for valid text)
#define GUIDesignCheckButton
checkButton placed in left position
#define GUIDesignLabelThickedFixed(width)
label thicked, icon before text, text centered and custom width
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
long onCmdSetAttribute(FXObject *obj, FXSelector, void *)
event after edit text field
const GNEAttributeProperties * myAttrProperty
attribute property
FXCheckButton * myCheckButton
check button for true/false
MFXTextFieldIcon * myTextField
text field for attribute
long onCmdOpenColorDialog(FXObject *sender, FXSelector, void *arg)
called when user press "edit color" dialog
long onCmdOpenVClassDialog(FXObject *, FXSelector, void *)
called when user press vClass dialog
GNEAttributeCarrierDialog * myACDialogParent
FOX needs this.
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
GNEAttributeCarrierDialog(GNEAttributeCarrier *AC)
constructor
long onCmdReset(FXObject *, FXSelector, void *)
event after press reset button
std::vector< AttributeTextField * > myAttributeTextFields
list of attribute text fields
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
~GNEAttributeCarrierDialog()
destructor
const std::string getID() const
get ID (all Attribute Carriers have one)
static const std::string FALSE_STR
true value in string format(used for comparing boolean values in getAttribute(...))
static const std::string TRUE_STR
true value in string format (used for comparing boolean values in getAttribute(......
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
GNENet * getNet() const
get pointer to net
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
SumoXMLAttr getAttr() const
get XML Attribute
FXVerticalFrame * myContentFrame
content frame
void openDialog(FXWindow *focusableElement=nullptr)
open dialog
GNEViewNet * getViewNet() const
get view net
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
GNEAttributeCarrier * myElement
pointer to edited element
T * getElement() const
get edited element
void resetChanges()
reset changes did in this dialog.
long acceptElementDialog()
close dialog commiting changes
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
dialog arguments, used for certain modal dialogs that can not be edited using tab
virtual void killFocus()
Remove the focus from this window.
FXString getText() const
Get the text for this label.
void setTextColor(FXColor clr)
Change text color.
static const RGBColor BLACK