54FXIMPLEMENT_ABSTRACT(
GNEDialog, FXDialogBox, MFXDialogBoxMap, ARRAYNUMBER(MFXDialogBoxMap))
63 FXDialogBox(applicationWindow->getApp(), name.c_str(),
65 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
66 myApplicationWindow(applicationWindow),
68 myOpenType(openType) {
70 if (applicationWindow->id()) {
71 buildDialog(titleIcon, buttons);
78 ResizeMode resizeMode,
const int width,
const int height) :
79 FXDialogBox(applicationWindow->getApp(), name.c_str(),
81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
82 myApplicationWindow(applicationWindow),
84 myOpenType(openType) {
86 if (applicationWindow->id()) {
90 resize(width, height);
133 throw ProcessError(
"onCmdReset function must be reimplemented in GNEDialog children");
139 throw ProcessError(
"onCmdRun function must be reimplemented in GNEDialog children");
145 throw ProcessError(
"onCmdBack function must be reimplemented in GNEDialog children");
151 throw ProcessError(
"onCmdAdvanced function must be reimplemented in GNEDialog children");
157 throw ProcessError(
"onCmdyCopy function must be reimplemented in GNEDialog children");
163 throw ProcessError(
"onCmdyReport function must be reimplemented in GNEDialog children");
173 FXEvent*
event = (FXEvent*)ptr;
174 if (event->code == KEY_Escape) {
177 return FXDialogBox::onKeyPress(obj, sel, ptr);
188 return FXDialogBox::onKeyRelease(obj, sel, ptr);
198 if (focusableElement) {
199 focusableElement->setFocus();
204 show(PLACEMENT_OWNER);
209 bool closeDialog =
false;
211 while (internalTest->getCurrentStep() && !closeDialog &&
213 (internalTest->getCurrentStep()->getDialogArgument()->getType() ==
myType)) {
217 switch (testStep->getDialogArgument()->getAction()) {
242 getApp()->runModalFor(
this);
252 getApp()->stopModal(
this, TRUE);
268 getApp()->stopModal(
this, TRUE);
284 getApp()->stopModal(
this, TRUE);
298 setTitle(newTitle.c_str());
488 throw ProcessError(
"Invalid buttons combination in GNEDialog");
FXDEFMAP(GNEDialog) MFXDialogBoxMap[]
@ MID_GNE_BUTTON_COPY
copy
@ MID_GNE_BUTTON_REPORT
report
@ 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 depending of Buttons)
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
FXButton * myCopyButton
copy button
virtual long onCmdBack(FXObject *, FXSelector, void *)
called when back button is pressed (must be reimplemented in children depending of Buttons)
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 depending of Buttons)
OpenType
Open dialog type.
DialogType myType
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 * myReportButton
report button
GNEDialog(GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, DialogType type, Buttons buttons, OpenType openType, ResizeMode resizeMode)
basic constructor
FXButton * myBackButton
back button
long onKeyPress(FXObject *obj, FXSelector sel, void *ptr)
called when user presses a key on the dialog
FXButton * myRunButton
run button
virtual long onCmdReport(FXObject *, FXSelector, void *)
called when report button is pressed (must be reimplemented in children depending of Buttons)
virtual long onCmdCopy(FXObject *, FXSelector, void *)
called when copy button is pressed (must be reimplemented in children depending of Buttons)
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 depending of Buttons)
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