59 myFrameParent(frameParent),
60 myEditorOptions(editorOptions) {
62 if ((myEditorOptions & EditorOptions::BASIC_ATTRIBUTES) != 0) {
64 }
else if ((myEditorOptions & EditorOptions::FLOW_ATTRIBUTES) != 0) {
66 }
else if ((myEditorOptions & EditorOptions::GEO_ATTRIBUTES) != 0) {
68 }
else if ((myEditorOptions & EditorOptions::NETEDIT_ATTRIBUTES) != 0) {
72 myFrontButton->hide();
74 myOpenDialogButton->hide();
75 }
else if ((myEditorOptions & EditorOptions::EXTENDED_ATTRIBUTES) != 0) {
78 myOpenExtendedAttributesButton->hide();
83 myAttributesEditorRows.resize(myMaxNumberOfRows);
84 for (
int i = 0; i < myMaxNumberOfRows; i++) {
109 for (
const auto& AC : ACs) {
121 row->hideAttributeRow();
130 const auto& tagProperty =
myEditedACs.front()->getTagProperty();
132 bool showButtons =
false;
136 if (tagProperty.isDrawable()) {
151 if (tagProperty.hasDialog()) {
174 for (
const auto& attrProperty : tagProperty) {
175 bool showAttributeRow =
true;
177 if (attrProperty.isExtended()) {
178 showAttributeRow =
false;
180 showAttributeRow =
false;
182 showAttributeRow =
false;
184 showAttributeRow =
false;
186 showAttributeRow =
false;
188 showAttributeRow =
false;
190 showAttributeRow =
false;
192 showAttributeRow =
true;
194 if (showAttributeRow) {
211 if ((itRows == 0) && !showButtons) {
258 AC->markForDrawingFront();
268 const auto editedTag =
myEditedACs.front()->getTagProperty().getTag();
310 const auto& tagProperty =
myEditedACs.front()->getTagProperty();
313 undoList->
begin(tagProperty.getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty.getTagStr()));
316 undoList->begin(tagProperty.getGUIIcon(),
TLF(
"change % attribute", tagProperty.getTagStr()));
320 editedAC->setAttribute(attr, value, undoList);
335 const auto& tagProperty =
myEditedACs.front()->getTagProperty();
338 undoList->
begin(tagProperty.getGUIIcon(),
TLF(
"change multiple % attributes", tagProperty.getTagStr()));
343 editedAC->enableAttribute(attr, undoList);
345 editedAC->disableAttribute(attr, undoList);
360 if (
myEditedACs.front()->getTagProperty().getParentTags().size() > 0) {
FXDEFMAP(GNEAttributesEditor) GNEAttributeTableMap[]
@ MID_GNE_ATTRIBUTESEDITOR_FRONT
mark element as front
@ MID_GNE_ATTRIBUTESEDITOR_DIALOG
open element dialog
@ MID_GNE_ATTRIBUTESEDITOR_EXTENDED
open extended attributes
@ MID_GNE_ATTRIBUTESEDITOR_HELP
open help dialog
#define GUIDesignButtonRectangular
little rectangular button used in frames (For example, in "help" buttons)
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_VTYPE
description of a vehicle/person/container type
@ SUMO_TAG_NOTHING
invalid tag, must be the last one
@ GNE_TAG_CALIBRATOR_LANE
A calibrator placed over lane.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_VSS
A variable speed sign.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_PARENT
parent of an additional element
static int maxNumberOfGeoAttributes
max number of geo attributes (needed for geo attributes editor)
const std::string getID() const
get ID (all Attribute Carriers have one)
static int maxNumberOfNeteditAttributes
max number of netedit attributes (needed for netedit attributes editor)
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
static int maxNumberOfEditableAttributes
max number of editable (non extended) attributes (needed for attributes editor)
static int maxNumberOfFlowAttributes
max number of flow attributes (needed for geo attributes editor)
long onCmdAttributesEditorHelp(FXObject *, FXSelector, void *)
called when user press the help button
GNEFrame * getFrameParent() const
pointer to GNEFrame parent
long onCmdOpenElementDialog(FXObject *, FXSelector, void *)
called when user press the "Open element dialog" button
void setNewParent(const GNEAttributeCarrier *AC)
set new parent
std::vector< GNEAttributeCarrier * > myEditedACs
current edited ACs
long onCmdMarkAsFront(FXObject *, FXSelector, void *)
GNEFrame * myFrameParent
pointer to GNEFrame parent
int myMaxNumberOfRows
maximum number of rows used in this attributes editor
void refreshAttributesEditor()
refresh attribute editor
int myEditorOptions
variable use for packing attribute editor options
void toggleEnableAttribute(SumoXMLAttr attr, const bool value)
set attribute in the current ACs (Callend from row)
bool checkNewParent(const GNEAttributeCarrier *AC) const
check if the given AC can be a new parent
void moveLaneDown()
move lane down
void inspectParent()
inspect parent (Callend from row)
void enableReparent()
void enable reparent
std::vector< GNEAttributesEditorRow * > myAttributesEditorRows
list of attributes editor rows
void showAttributesEditor(GNEAttributeCarrier *AC)
edit attributes of the given AC (usually the edited template AC)
bool isReparenting() const
SumoXMLTag myReparentTag
check if we're reparent
long onCmdOpenExtendedAttributesDialog(FXObject *, FXSelector, void *)
called when user press the "Open extended attributes" button
void abortReparenting()
abort selecting parent
void hideAttributesEditor()
hide attribute editor
FXButton * myFrontButton
pointer to front button
FXButton * myOpenExtendedAttributesButton
pointer to open extended attributes button
void moveLaneUp()
move lane up
FXButton * myOpenDialogButton
pointer to open dialog button (usually additionals)
void setAttribute(SumoXMLAttr attr, const std::string &value)
set attribute in the current ACs (Callend from row)
FXButton * myHelpButton
button for help
Dialog for edit calibrators.
virtual void attributeUpdated(SumoXMLAttr attribute)
function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/....
GNEViewNet * getViewNet() const
get view net
void openHelpAttributesDialog(const GNEAttributeCarrier *AC) const
Open help attributes dialog.
void inspectElement(GNEAttributeCarrier *AC, GNEAttributeCarrier *previousInspectedAC=nullptr)
Inspect a single element.
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Dialog for edit rerouters.
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
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...
Dialog for editing calibrator vehicle types.
GNENet * getNet() const
get the net object
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
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
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
MFXGroupBoxModule (based on FXGroupBox)