46FXIMPLEMENT_ABSTRACT(
GNEDemandElementDialog, FXTopWindow, GNEDemandElementDialogMap, ARRAYNUMBER(GNEDemandElementDialogMap))
53 FXTopWindow(editedDemandElement->getNet()->getViewNet(), ("Edit '" + editedDemandElement->getID() + "' data").c_str(), editedDemandElement->getACIcon(), editedDemandElement->getACIcon(),
GUIDesignDialogBoxExplicit(width, height)),
54 myEditedDemandElement(editedDemandElement),
55 myUpdatingElement(updatingElement),
56 myChangesDescription("Change " + editedDemandElement->getTagStr() + " values"),
57 myNumberOfChanges(0) {
76 getParent()->setFocus();
89 return getApp()->runModalFor(
this);
101 return FXTopWindow::onKeyPress(sender, sel, ptr);
107 return FXTopWindow::onKeyRelease(sender, sel, ptr);
121 setTitle(newHeader.c_str());
137 if (myNumberOfChanges < myEditedDemandElement->getNet()->getViewNet()->getUndoList()->currentCommandGroupSize()) {
FXDEFMAP(GNEDemandElementDialog) GNEDemandElementDialogMap[]
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_GNE_BUTTON_RESET
reset button
@ MID_GNE_BUTTON_FOCUS
focus button
@ MID_GNE_BUTTON_ACCEPT
accept button
#define GUIDesignDialogBoxExplicit(width, height)
design for dialog box with specific width and height (for example, additional dialogs)
#define GUIDesignButtonAccept
Accept Button.
#define GUIDesignButtonCancel
Cancel Button.
#define GUIDesignContentsFrame
design for the main content frame of every frame/dialog with padding and spacing
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignButtonFocus
Focus Button.
#define GUIDesignButtonReset
Reset Button.
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignHorizontalFrame
Horizontal frame extended over frame parent with padding and spacing.
void updateControls()
update control contents after undo/redo or recompute
GNENet * getNet() const
get pointer to net
Dialog to edit sequences, parameters, etc.. of DemandElements.
virtual long onCmdAccept(FXObject *sender, FXSelector sel, void *ptr)=0
void acceptChanges()
Accept changes did in this dialog.
GNEDemandElement * myEditedDemandElement
pointer to edited additional
long onCmdFocusOnFrame(FXObject *sender, FXSelector sel, void *ptr)
focus on frame
FXint openAsModalDialog(FXuint placement=PLACEMENT_CURSOR)
execute dialog as modal
GNEDemandElement * getEditedDemandElement() const
get edited DemandElement
long onKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
event after release a key
void initChanges()
init a new group of changes that will be do it in dialog
virtual long onCmdCancel(FXObject *sender, FXSelector sel, void *ptr)=0
event after press cancel button
void cancelChanges()
Cancel changes did in this dialog.
void changeDemandElementDialogHeader(const std::string &newHeader)
change additional dialog header
virtual long onCmdReset(FXObject *, FXSelector, void *)=0
event after press cancel button
std::string myChangesDescription
description of changes did in this additional dialog
void resetChanges()
reset changes did in this dialog.
int myNumberOfChanges
number of GNEChanges_... in dialog
~GNEDemandElementDialog()
destructor
long onKeyPress(FXObject *sender, FXSelector sel, void *ptr)
event after press a key
GNEViewNet * getViewNet() const
get view net
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
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...
int currentCommandGroupSize() const
get size of current CommandGroup
void abortLastChangeGroup()
reverts last active chained change group
GNEViewParent * getViewParent() const
get the net object
GNEUndoList * getUndoList() const
get the undoList object
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
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