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);
79 FXDialogBox(applicationWindow->getApp(), name.c_str(),
81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
82 myApplicationWindow(applicationWindow),
83 myParentDialog(parentDialog),
85 myOpenType(openType) {
87 if (applicationWindow->id()) {
95 ResizeMode resizeMode,
const int width,
const int height) :
96 FXDialogBox(applicationWindow->getApp(), name.c_str(),
98 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
99 myApplicationWindow(applicationWindow),
101 myOpenType(openType) {
103 if (applicationWindow->id()) {
107 resize(width, height);
115 FXDialogBox(applicationWindow->getApp(), name.c_str(),
117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
118 myApplicationWindow(applicationWindow),
119 myParentDialog(parentDialog),
121 myOpenType(openType) {
123 if (applicationWindow->id()) {
127 resize(width, height);
170 throw ProcessError(
"onCmdReset function must be reimplemented in GNEDialog children");
176 throw ProcessError(
"onCmdRun function must be reimplemented in GNEDialog children");
182 throw ProcessError(
"onCmdBack function must be reimplemented in GNEDialog children");
188 throw ProcessError(
"onCmdAdvanced function must be reimplemented in GNEDialog children");
194 throw ProcessError(
"onCmdyCopy function must be reimplemented in GNEDialog children");
200 throw ProcessError(
"onCmdyReport function must be reimplemented in GNEDialog children");
210 FXEvent*
event = (FXEvent*)ptr;
211 if (event->code == KEY_Escape) {
213 }
else if (event->code == KEY_Return) {
222 return FXDialogBox::onKeyPress(obj, sel, ptr);
232 return FXDialogBox::onKeyRelease(obj, sel, ptr);
242 if (focusableElement) {
243 focusableElement->setFocus();
248 show(PLACEMENT_OWNER);
253 bool closeDialog =
false;
255 while (internalTest->getCurrentStep() && !closeDialog &&
257 (internalTest->getCurrentStep()->getDialogArgument()->getType() ==
myType)) {
261 switch (testStep->getDialogArgument()->getAction()) {
286 getApp()->runModalFor(
this);
296 getApp()->stopModal(
this, TRUE);
316 getApp()->stopModal(
this, TRUE);
336 getApp()->stopModal(
this, TRUE);
354 setTitle(newTitle.c_str());
544 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.
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
GNEDialog * myParentDialog
parent dialog used for restoring focus after closing dialog
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