61 const auto tooltipMenu = ACDialog->getElement()->getNet()->getViewNet()->getViewParent()->getGNEAppWindows()->getStaticTooltipMenu();
64 myAttributeButton = new MFXButtonTooltip(this, tooltipMenu, attrProperty->getAttrStr(), nullptr, this,
65 MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_ALLOW, GUIDesignButtonAttribute);
66 myAttributeButton->setTipText(TL(
"Open dialog for editing vClasses"));
67 }
else if (attrProperty->isColor()) {
68 myAttributeButton = new MFXButtonTooltip(this, tooltipMenu, attrProperty->getAttrStr(), GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL), this,
69 MID_GNE_ATTRIBUTESEDITORROW_OPENDIALOG_COLOR, GUIDesignButtonAttribute);
70 myAttributeButton->setTipText(TL(
"Open dialog for editing color"));
73 new FXLabel(this, attrProperty->getAttrStr().c_str(), nullptr, GUIDesignLabelThickedFixed(100));
76 if (attrProperty->isBool()) {
78 myCheckButton = new FXCheckButton(this,
"bool", this, MID_GNE_ATTRIBUTESEDITORROW_SETATTRIBUTE, GUIDesignCheckButton);
80 if (ACDialog->getElement()->getAttribute(attrProperty->getAttr()) == GNEAttributeCarrier::TRUE_STR) {
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());
98 auto undoList =
myACDialogParent->getElement()->getNet()->getViewNet()->getUndoList();
156 myTextField->setText(allowVClassesDialog->getModifiedVClasses().c_str(), TRUE);
172 std::vector<const GNEAttributeProperties*> attrProperties;
173 for (
const auto& attrProperty :
myElement->getTagProperty()->getAttributeProperties()) {
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]);
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 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)
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
AttributeTextField(GNEAttributeCarrierDialog *ACDialog, FXVerticalFrame *verticalFrame, const GNEAttributeProperties *attrProperty)
constructor
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
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 getID() const override
get ID (all Attribute Carriers have one)
static T parse(const std::string &string)
parses a value of type T from string (used for basic types: int, double, bool, etc....
const std::string & getTagStr() const
get tag assigned to this object in string format
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
FXVerticalFrame * myContentFrame
void openDialog(FXWindow *focusableElement=nullptr)
GNEAttributeCarrier * myElement
GNETemplateElementDialog(GNEAttributeCarrier *element, DialogType type)
long acceptElementDialog()
dialog arguments, used for certain modal dialogs that can not be edited using tab
static const RGBColor BLACK