52FXIMPLEMENT_ABSTRACT(
GNEDialog, FXDialogBox, MFXDialogBoxMap, ARRAYNUMBER(MFXDialogBoxMap))
61 FXDialogBox(applicationWindow->getApp(), name.c_str(),
63 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
64 myApplicationWindow(applicationWindow),
65 myOpenType(openType) {
67 buildDialog(titleIcon, buttons);
73 ResizeMode resizeMode,
const int width,
const int height) :
74 FXDialogBox(applicationWindow->getApp(), name.c_str(),
76 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
77 myApplicationWindow(applicationWindow),
78 myOpenType(openType) {
82 resize(width, height);
124 throw ProcessError(
"onCmdReset function must be reimplemented in GNEDialog children");
130 throw ProcessError(
"onCmdRun function must be reimplemented in GNEDialog children");
136 throw ProcessError(
"onCmdBack function must be reimplemented in GNEDialog children");
142 throw ProcessError(
"onCmdAdvanced function must be reimplemented in GNEDialog children");
152 FXEvent*
event = (FXEvent*)ptr;
153 if (event->code == KEY_Escape) {
156 return FXDialogBox::onKeyPress(obj, sel, ptr);
167 return FXDialogBox::onKeyRelease(obj, sel, ptr);
177 if (focusableElement) {
178 focusableElement->setFocus();
183 show(PLACEMENT_OWNER);
193 switch (testStep->getDialogArgument()->getBasicAction()) {
207 if (testStep->getDialogArgument()->getCustomAction().size() > 0) {
210 handle(internalTest, testStep->getSelector(), testStep->getEvent());
220 getApp()->runModalFor(
this);
230 getApp()->stopModal(
this, TRUE);
246 getApp()->stopModal(
this, TRUE);
262 getApp()->stopModal(
this, TRUE);
276 setTitle(newTitle.c_str());
449 throw ProcessError(
"Invalid buttons combination in GNEDialog");
FXDEFMAP(GNEDialog) MFXDialogBoxMap[]
@ MID_GNE_BUTTON_RUN
run button
@ MID_GNE_BUTTON_CANCEL
cancel button
@ MID_GNE_BUTTON_RESET
reset button
@ MID_HOTKEY_ESC
hot key <ESC> abort current edit operation
@ MID_GNE_BUTTON_ADVANCED
advanced button
@ MID_GNE_BUTTON_BACK
back button
@ MID_GNE_BUTTON_ACCEPT
accept button
@ MID_GNE_ABORT
abort lane path creation
#define GUIDesignGNEDialogResizable
design for GNEDialogs resizable
#define GUIDesignDialogContentFrame
design for content frame used in dialog
#define GUIDesignGNEDialogStaticExplicit
design for GNEDialogs explicit
#define GUIDesignAuxiliarHorizontalFrame
design for auxiliar (Without borders) horizontal frame used to pack another frames
#define GUIDesignGNEDialogStatic
#define GUIDesignDialogButtonsHorizontalFrame
design for content frame used in dialog
#define GUIDesignHorizontalSeparator
#define GUIDesignAuxiliarFrame
design for auxiliar (Without borders) frame extended in all directions
#define GUIDesignButtonDialog
#define GUIDesignGNEDialogResizableExplicit
design for GNEDialogs resizable with explicit layout
GUIIcon
An enumeration of icons used by the gui applications.
The main window of Netedit.
GNEInternalTest * getInternalTest() const
get netedit test system
virtual long onCmdRun(FXObject *, FXSelector, void *)
called when run button is pressed (must be reimplemented in children)
void buildDialog(GUIIcon titleIcon, Buttons buttons)
build dialog
FXButton * myFocusButton
focus button, used for focusing the default button when dialog is opened
virtual void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)=0
run internal test
OpenType myOpenType
open type
bool myTesting
flag to indicate if this dialog is being tested using internal test
virtual long onCmdBack(FXObject *, FXSelector, void *)
called when back button is pressed (must be reimplemented in children)
FXVerticalFrame * myContentFrame
content frame
FXButton * myAbortButton
abort button
long closeDialogAborting()
close dialog aborting the changes
FXButton * myCancelButton
cancel button
FXVerticalFrame * getContentFrame() const
get content frame
GNEApplicationWindow * getApplicationWindow() const
get pointer to the application window
Result getResult() const
get result to indicate if this dialog was closed accepting or rejecting changes
FXButton * myAdvancedButton
advanced button
GNEApplicationWindow * myApplicationWindow
FOX needs this.
FXButton * myResetButton
reset button
void updateIcon(GUIIcon newIcon)
update icon
long onKeyRelease(FXObject *obj, FXSelector sel, void *ptr)
called when user releases a key on the dialog
void openDialog(FXWindow *focusableElement=nullptr)
open dialog
Result
list of possible results when closing the dialog
FXButton * myAcceptButton
accept button
Result myResult
result to indicate if this dialog was closed accepting or rejecting changes
long closeDialogAccepting()
close dialog accepting the changes
virtual long onCmdAdvanced(FXObject *, FXSelector, void *)
called when advanced button is pressed (must be reimplemented in children)
OpenType
Open dialog type.
virtual long onCmdAbort(FXObject *, FXSelector, void *)
called when abort is called either closing dialog or pressing abort button (can be reimplemented in c...
FXButton * myBackButton
back button
GNEDialog(GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, Buttons buttons, OpenType openType, ResizeMode resizeMode)
constructor for resizable dialogs
long onKeyPress(FXObject *obj, FXSelector sel, void *ptr)
called when user presses a key on the dialog
FXButton * myRunButton
run button
virtual long onCmdAccept(FXObject *, FXSelector, void *)
called when accept or yes button is pressed (can be reimplemented in children)
long closeDialogCanceling()
close dialog declining the changes
virtual long onCmdCancel(FXObject *, FXSelector, void *)
called when cancel or no button is pressed (can be reimplemented in children)
void updateTitle(const std::string &newTitle)
update title
virtual long onCmdReset(FXObject *, FXSelector, void *)
called when reset button is pressed (must be reimplemented in children)
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
InternalTestStep * setNextStep()
get current step and set next step