58 myACDialogParent(ACDialog),
59 myAttrProperty(attrProperty) {
61 const auto tooltipMenu = ACDialog->getElement()->getNet()->getGNEApplicationWindow()->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(), myACDialogParent, color);
143 myTextField->setText(
toString(colorDialog->getColor()).c_str(), TRUE);
152 const auto allowVClassesDialog =
new GNEVClassesDialog(myACDialogParent->getApplicationWindow(), myACDialogParent,
153 myAttrProperty->getAttr(), myTextField->getText().text());
156 myTextField->setText(allowVClassesDialog->getModifiedVClasses().c_str(), TRUE);
210 std::vector<const GNEAttributeProperties*> attrProperties;
213 if (attrProperty->isEditMode() && attrProperty->isBasicEditor()) {
214 attrProperties.push_back(attrProperty);
218 for (
size_t i = 0; i < attrProperties.size(); i++) {
220 auto attributeTextField =
new AttributeTextField(
this, (i % 2 == 0) ? columnLeft : columnRight, attrProperties[i]);
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 builder(GNEAttributeCarrier *AC)
builder
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
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 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
GNEUndoList * getUndoList() const
get undo list(used for simplify code)
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
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