![]() |
Eclipse SUMO - Simulation of Urban MObility
|
#include <GNEDialog.h>
Public Types | |
basic dialog type | |
enum class | Buttons { OK , YES_NO , YES_NO_CANCEL , ACCEPT , ACCEPT_CANCEL , ACCEPT_CANCEL_RESET , SAVE_DONTSAVE_CANCEL , RUN_CANCEL_RESET , RUN_ADVANCED_CANCEL , RERUN_BACK_CLOSE } |
enum class | OpenType { MODAL , NON_MODAL } |
Open dialog type. More... | |
Public Member Functions | |
FOX-callbacks | |
virtual long | onCmdAccept (FXObject *, FXSelector, void *) |
called when accept or yes button is pressed (can be reimplemented in children) | |
virtual long | onCmdCancel (FXObject *, FXSelector, void *) |
called when cancel or no button is pressed (can be reimplemented in children) | |
virtual long | onCmdAbort (FXObject *, FXSelector, void *) |
called when abort is called either closing dialog or pressing abort button (can be reimplemented in children) | |
virtual long | onCmdReset (FXObject *, FXSelector, void *) |
called when reset button is pressed (must be reimplemented in children) | |
virtual long | onCmdRun (FXObject *, FXSelector, void *) |
called when run button is pressed (must be reimplemented in children) | |
virtual long | onCmdBack (FXObject *, FXSelector, void *) |
called when back button is pressed (must be reimplemented in children) | |
virtual long | onCmdAdvanced (FXObject *, FXSelector, void *) |
called when advanced button is pressed (must be reimplemented in children) | |
long | onKeyPress (FXObject *obj, FXSelector sel, void *ptr) |
called when user presses a key on the dialog | |
long | onKeyRelease (FXObject *obj, FXSelector sel, void *ptr) |
called when user releases a key on the dialog | |
Protected Member Functions | |
long | closeDialogAborting () |
close dialog aborting the changes | |
long | closeDialogAccepting () |
close dialog accepting the changes | |
long | closeDialogCanceling () |
close dialog declining the changes | |
void | openDialog (FXWindow *focusableElement=nullptr) |
open dialog | |
void | updateIcon (GUIIcon newIcon) |
update icon | |
void | updateTitle (const std::string &newTitle) |
update title | |
Protected Attributes | |
FXButton * | myAbortButton = nullptr |
abort button | |
FXButton * | myAcceptButton = nullptr |
accept button | |
FXButton * | myAdvancedButton = nullptr |
advanced button | |
GNEApplicationWindow * | myApplicationWindow = nullptr |
FOX needs this. | |
FXButton * | myBackButton = nullptr |
back button | |
FXButton * | myCancelButton = nullptr |
cancel button | |
FXVerticalFrame * | myContentFrame = nullptr |
content frame | |
FXButton * | myResetButton = nullptr |
reset button | |
Result | myResult = Result::CANCEL |
result to indicate if this dialog was closed accepting or rejecting changes | |
FXButton * | myRunButton = nullptr |
run button | |
Private Member Functions | |
void | buildDialog (GUIIcon titleIcon, Buttons buttons) |
build dialog | |
GNEDialog (const GNEDialog &)=delete | |
Invalidated copy constructor. | |
GNEDialog & | operator= (const GNEDialog &src)=delete |
Invalidated assignment operator. | |
Private Attributes | |
FXButton * | myFocusButton = nullptr |
focus button, used for focusing the default button when dialog is opened | |
OpenType | myOpenType |
open type | |
bool | myTesting = false |
flag to indicate if this dialog is being tested using internal test | |
Resize mode | |
enum class | ResizeMode { STATIC , RESIZABLE } |
enum class | Result { ACCEPT , CANCEL , ABORT } |
list of possible results when closing the dialog More... | |
GNEDialog (GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, Buttons buttons, OpenType openType, ResizeMode resizeMode) | |
constructor for resizable dialogs | |
GNEDialog (GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, Buttons buttons, OpenType openType, ResizeMode resizeMode, const int width, const int height) | |
constructor for resizable dialogs with layout explicit | |
Result | getResult () const |
get result to indicate if this dialog was closed accepting or rejecting changes | |
GNEApplicationWindow * | getApplicationWindow () const |
get pointer to the application window | |
FXVerticalFrame * | getContentFrame () const |
get content frame | |
virtual void | runInternalTest (const InternalTestStep::DialogArgument *dialogArgument)=0 |
run internal test | |
Definition at line 36 of file GNEDialog.h.
|
strong |
Enumerator | |
---|---|
OK | |
YES_NO | |
YES_NO_CANCEL | |
ACCEPT | |
ACCEPT_CANCEL | |
ACCEPT_CANCEL_RESET | |
SAVE_DONTSAVE_CANCEL | |
RUN_CANCEL_RESET | |
RUN_ADVANCED_CANCEL | |
RERUN_BACK_CLOSE |
Definition at line 41 of file GNEDialog.h.
|
strong |
|
strong |
Enumerator | |
---|---|
STATIC | |
RESIZABLE |
Definition at line 61 of file GNEDialog.h.
|
strong |
list of possible results when closing the dialog
Enumerator | |
---|---|
ACCEPT | |
CANCEL | |
ABORT |
Definition at line 67 of file GNEDialog.h.
GNEDialog::GNEDialog | ( | GNEApplicationWindow * | applicationWindow, |
const std::string & | name, | ||
GUIIcon | titleIcon, | ||
Buttons | buttons, | ||
OpenType | openType, | ||
ResizeMode | resizeMode | ||
) |
constructor for resizable dialogs
Definition at line 58 of file GNEDialog.cpp.
GNEDialog::GNEDialog | ( | GNEApplicationWindow * | applicationWindow, |
const std::string & | name, | ||
GUIIcon | titleIcon, | ||
Buttons | buttons, | ||
OpenType | openType, | ||
ResizeMode | resizeMode, | ||
const int | width, | ||
const int | height | ||
) |
constructor for resizable dialogs with layout explicit
Definition at line 71 of file GNEDialog.cpp.
References buildDialog().
|
privatedelete |
Invalidated copy constructor.
|
private |
build dialog
Definition at line 287 of file GNEDialog.cpp.
References ACCEPT, ACCEPT_CANCEL, ACCEPT_CANCEL_RESET, BACK, GUIDesigns::buildFXButton(), CANCEL, GUIIconSubSys::getIcon(), GUIDesignAuxiliarFrame, GUIDesignAuxiliarHorizontalFrame, GUIDesignButtonDialog, GUIDesignDialogButtonsHorizontalFrame, GUIDesignDialogContentFrame, GUIDesignHorizontalSeparator, MID_GNE_ABORT, MID_GNE_BUTTON_ACCEPT, MID_GNE_BUTTON_ADVANCED, MID_GNE_BUTTON_BACK, MID_GNE_BUTTON_CANCEL, MID_GNE_BUTTON_RESET, MID_GNE_BUTTON_RUN, myAbortButton, myAcceptButton, myAdvancedButton, myBackButton, myCancelButton, myContentFrame, myFocusButton, myResetButton, myRunButton, NO, OK, OPTIONS, RERUN_BACK_CLOSE, RESET, RUN_ADVANCED_CANCEL, RUN_CANCEL_RESET, SAVE, SAVE_DONTSAVE_CANCEL, START, TL, YES, YES_NO, and YES_NO_CANCEL.
Referenced by GNEDialog().
|
protected |
close dialog aborting the changes
Definition at line 259 of file GNEDialog.cpp.
References ABORT, MODAL, myApplicationWindow, myOpenType, myResult, and myTesting.
Referenced by GNEOverwriteElement::onCmdAbort(), GNETemplateElementDialog< T >::onCmdAbort(), onCmdAbort(), and onKeyPress().
|
protected |
close dialog accepting the changes
Definition at line 227 of file GNEDialog.cpp.
References ACCEPT, MODAL, myApplicationWindow, myOpenType, myResult, and myTesting.
Referenced by GNETemplateElementDialog< T >::acceptElementDialog(), GNEOverwriteElement::onCmdAccept(), GNEFileDialog::onCmdAccept(), GNEFixElementsDialog< T >::onCmdAccept(), onCmdAccept(), GNEParametersDialog::onCmdAccept(), GNEVClassesDialog::onCmdAccept(), and GNERunDialog::onCmdAccept().
|
protected |
close dialog declining the changes
Definition at line 243 of file GNEDialog.cpp.
References CANCEL, MODAL, myApplicationWindow, myOpenType, myResult, and myTesting.
Referenced by GNERunDialog::onCmdAbort(), GNEFixElementsDialog< T >::onCmdAccept(), GNEVClassesDialog::onCmdAccept(), GNERunNetgenerateDialog::onCmdAccept(), GNERunPythonToolDialog::onCmdAccept(), GNENetgenerateDialog::onCmdAdvanced(), GNERunNetgenerateDialog::onCmdBack(), GNEOverwriteElement::onCmdCancel(), GNETemplateElementDialog< T >::onCmdCancel(), GNEFilePathDialog::onCmdCancel(), onCmdCancel(), GNEVClassesDialog::onCmdCancel(), GNENeteditOptionsDialog::onCmdCancel(), GNENetgenerateOptionsDialog::onCmdCancel(), GNESumoOptionsDialog::onCmdCancel(), and GNENetgenerateDialog::onCmdRun().
GNEApplicationWindow * GNEDialog::getApplicationWindow | ( | ) | const |
get pointer to the application window
Definition at line 93 of file GNEDialog.cpp.
References myApplicationWindow.
Referenced by GNEPythonToolDialog::buildArguments(), GNEVehicleTypeDialog::CarFollowingModelParameters::CarFollowingModelParameters(), GNEFileSelector::onCmdCopy(), GNEFileSelector::onCmdDelete(), GNEOptionsEditor::onCmdLoadOptions(), GNEFileSelector::onCmdMove(), GNEFileSelector::onCmdNewFolder(), GNEOptionsEditor::onCmdSaveOptions(), GNEOptionsEditor::onCmdShowToolTipsMenu(), GNEVehicleTypeDialog::VTypeAttributes::VShapeRow::VShapeRow(), and GNEVehicleTypeDialog::VTypeAttributes::VTypeAttributeRow::VTypeAttributeRow().
FXVerticalFrame * GNEDialog::getContentFrame | ( | ) | const |
get content frame
Definition at line 99 of file GNEDialog.cpp.
References myContentFrame.
Referenced by GNEVClassesDialog::GNEVClassesDialog().
GNEDialog::Result GNEDialog::getResult | ( | ) | const |
get result to indicate if this dialog was closed accepting or rejecting changes
Definition at line 87 of file GNEDialog.cpp.
References myResult.
Referenced by GNEDataHandler::checkDuplicatedDataSet(), GNEMeanDataHandler::checkDuplicatedMeanDataElement(), GNEAdditionalHandler::checkElement(), and GNERouteHandler::checkElement().
|
virtual |
called when abort is called either closing dialog or pressing abort button (can be reimplemented in children)
Reimplemented in GNEOverwriteElement, GNETemplateElementDialog< T >, GNETemplateElementDialog< elementDialogType >, GNETemplateElementDialog< GNEAdditional >, GNETemplateElementDialog< GNEAttributeCarrier >, GNETemplateElementDialog< GNEDemandElement >, GNERunDialog, GNERunNetgenerateDialog, and GNERunPythonToolDialog.
Definition at line 117 of file GNEDialog.cpp.
References closeDialogAborting().
Referenced by FXDEFMAP(), and openDialog().
|
virtual |
called when accept or yes button is pressed (can be reimplemented in children)
Reimplemented in GNEOverwriteElement, GNEAttributeCarrierDialog, GNECalibratorDialog, GNERerouterDialog, GNERerouterIntervalDialog, GNEVariableSpeedSignDialog, GNEVehicleTypeDialog, GNEFileDialog, GNEFixElementsDialog< T >, GNEFixElementsDialog< GNEAdditional * >, GNEFixElementsDialog< GNEDemandElement * >, GNEFixElementsDialog< GNENetworkElement * >, GNEParametersDialog, GNEVClassesDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, GNERunDialog, GNEGeometryPointDialog, GNETemplateElementDialog< T >, GNETemplateElementDialog< elementDialogType >, GNETemplateElementDialog< GNEAdditional >, GNETemplateElementDialog< GNEAttributeCarrier >, and GNETemplateElementDialog< GNEDemandElement >.
Definition at line 105 of file GNEDialog.cpp.
References closeDialogAccepting().
Referenced by FXDEFMAP(), and openDialog().
|
virtual |
called when advanced button is pressed (must be reimplemented in children)
Reimplemented in GNENetgenerateDialog.
Definition at line 141 of file GNEDialog.cpp.
Referenced by FXDEFMAP().
|
virtual |
called when back button is pressed (must be reimplemented in children)
Reimplemented in GNERunNetgenerateDialog, GNERunPythonToolDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, and GNERunDialog.
Definition at line 135 of file GNEDialog.cpp.
Referenced by FXDEFMAP().
|
virtual |
called when cancel or no button is pressed (can be reimplemented in children)
Reimplemented in GNEOverwriteElement, GNETemplateElementDialog< T >, GNETemplateElementDialog< elementDialogType >, GNETemplateElementDialog< GNEAdditional >, GNETemplateElementDialog< GNEAttributeCarrier >, GNETemplateElementDialog< GNEDemandElement >, GNEFilePathDialog, GNEVClassesDialog, GNENeteditOptionsDialog, GNENetgenerateOptionsDialog, GNESumoOptionsDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, and GNEGeometryPointDialog.
Definition at line 111 of file GNEDialog.cpp.
References closeDialogCanceling().
Referenced by FXDEFMAP(), FXDEFMAP(), and openDialog().
|
virtual |
called when reset button is pressed (must be reimplemented in children)
Reimplemented in GNEAttributeCarrierDialog, GNECalibratorDialog, GNERerouterDialog, GNERerouterIntervalDialog, GNEVariableSpeedSignDialog, GNEVehicleTypeDialog, GNEFilePathDialog, GNEColorDialog, GNEGeometryPointDialog, GNEParametersDialog, GNEVClassesDialog, GNENeteditOptionsDialog, GNENetgenerateOptionsDialog, GNESumoOptionsDialog, GNEPythonToolDialog, GNETemplateElementDialog< T >, GNETemplateElementDialog< elementDialogType >, GNETemplateElementDialog< GNEAdditional >, GNETemplateElementDialog< GNEAttributeCarrier >, and GNETemplateElementDialog< GNEDemandElement >.
Definition at line 123 of file GNEDialog.cpp.
Referenced by FXDEFMAP(), and openDialog().
|
virtual |
called when run button is pressed (must be reimplemented in children)
Reimplemented in GNERunDialog, GNENetgenerateDialog, and GNEPythonToolDialog.
Definition at line 129 of file GNEDialog.cpp.
Referenced by FXDEFMAP().
long GNEDialog::onKeyPress | ( | FXObject * | obj, |
FXSelector | sel, | ||
void * | ptr | ||
) |
called when user presses a key on the dialog
Definition at line 147 of file GNEDialog.cpp.
References closeDialogAborting(), GNEApplicationWindow::getInternalTest(), myApplicationWindow, and myTesting.
Referenced by FXDEFMAP().
long GNEDialog::onKeyRelease | ( | FXObject * | obj, |
FXSelector | sel, | ||
void * | ptr | ||
) |
called when user releases a key on the dialog
Definition at line 163 of file GNEDialog.cpp.
References GNEApplicationWindow::getInternalTest(), myApplicationWindow, and myTesting.
Referenced by FXDEFMAP().
|
protected |
open dialog
Definition at line 173 of file GNEDialog.cpp.
References InternalTestStep::DialogArgument::ABORT, InternalTestStep::DialogArgument::ACCEPT, InternalTestStep::DialogArgument::CANCEL, InternalTestStep::DIALOG, GNEApplicationWindow::getInternalTest(), MODAL, myApplicationWindow, myFocusButton, myOpenType, myTesting, onCmdAbort(), onCmdAccept(), onCmdCancel(), onCmdReset(), InternalTestStep::DialogArgument::RESET, runInternalTest(), and InternalTest::setNextStep().
Referenced by GNEAboutDialog::GNEAboutDialog(), GNEAttributeCarrierDialog::GNEAttributeCarrierDialog(), GNEBasicDialog::GNEBasicDialog(), GNECalibratorDialog::GNECalibratorDialog(), GNEFileDialog::GNEFileDialog(), GNEFilePathDialog::GNEFilePathDialog(), GNEFixAdditionalElementsDialog::GNEFixAdditionalElementsDialog(), GNEFixDemandElementsDialog::GNEFixDemandElementsDialog(), GNEFixNetworkElements::GNEFixNetworkElements(), GNEHelpAttributesDialog::GNEHelpAttributesDialog(), GNENeteditOptionsDialog::GNENeteditOptionsDialog(), GNENetgenerateOptionsDialog::GNENetgenerateOptionsDialog(), GNEOverwriteElement::GNEOverwriteElement(), GNEParametersDialog::GNEParametersDialog(), GNERerouterDialog::GNERerouterDialog(), GNERerouterIntervalDialog::GNERerouterIntervalDialog(), GNERunNetgenerateDialog::GNERunNetgenerateDialog(), GNERunPythonToolDialog::GNERunPythonToolDialog(), GNESumoOptionsDialog::GNESumoOptionsDialog(), GNEVariableSpeedSignDialog::GNEVariableSpeedSignDialog(), GNEVClassesDialog::GNEVClassesDialog(), and GNEVehicleTypeDialog::GNEVehicleTypeDialog().
Invalidated assignment operator.
|
pure virtual |
run internal test
Implemented in GNEBasicDialog, GNEOverwriteElement, GNEAttributeCarrierDialog, GNECalibratorDialog, GNERerouterDialog, GNERerouterIntervalDialog, GNEVariableSpeedSignDialog, GNEVehicleTypeDialog, GNEFileDialog, GNEFilePathDialog, GNEFixElementsDialog< T >, GNEFixElementsDialog< GNEAdditional * >, GNEFixElementsDialog< GNEDemandElement * >, GNEFixElementsDialog< GNENetworkElement * >, GNEAboutDialog, GNEColorDialog, GNEGeometryPointDialog, GNEHelpAttributesDialog, GNEParametersDialog, GNEUndoListDialog, GNEVClassesDialog, GNENeteditOptionsDialog, GNENetgenerateOptionsDialog, GNESumoOptionsDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, GNENetgenerateDialog, GNEPythonToolDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, GNETemplateElementDialog< T >, GNETemplateElementDialog< elementDialogType >, GNETemplateElementDialog< GNEAdditional >, GNETemplateElementDialog< GNEAttributeCarrier >, GNETemplateElementDialog< GNEDemandElement >, and GNERunDialog.
Referenced by openDialog().
|
protected |
update icon
Definition at line 281 of file GNEDialog.cpp.
References GUIIconSubSys::getIcon().
Referenced by GNEFileDialog::GNEFileDialog().
|
protected |
update title
Definition at line 275 of file GNEDialog.cpp.
Referenced by GNEFileDialog::GNEFileDialog().
|
protected |
|
protected |
accept button
Definition at line 138 of file GNEDialog.h.
Referenced by buildDialog(), GNEFileDialog::GNEFileDialog(), and GNERunDialog::updateDialogButtons().
|
protected |
advanced button
Definition at line 156 of file GNEDialog.h.
Referenced by buildDialog(), and GNENetgenerateDialog::updateRunButtons().
|
protected |
FOX needs this.
pointer to the main window
Definition at line 132 of file GNEDialog.h.
Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), GNEFixElementsDialog< T >::getApplicationWindow(), getApplicationWindow(), GNERunDialog::onCmdAbort(), GNEParametersDialog::onCmdAccept(), GNERunNetgenerateDialog::onCmdAccept(), GNERunPythonToolDialog::onCmdAccept(), GNERunDialog::onCmdAccept(), GNENetgenerateDialog::onCmdAdvanced(), GNERunNetgenerateDialog::onCmdBack(), GNERunPythonToolDialog::onCmdBack(), GNEPythonToolDialog::onCmdLoad(), GNENetgenerateDialog::onCmdOpenOutputFile(), GNERunDialog::onCmdRun(), GNENetgenerateDialog::onCmdRun(), GNEPythonToolDialog::onCmdRun(), GNEPythonToolDialog::onCmdSave(), GNERunDialog::onCmdSaveLog(), GNEUndoListDialog::onCmdSelectRow(), GNENetgenerateDialog::onCmdSetGridNetwork(), GNENetgenerateDialog::onCmdSetOutput(), GNENetgenerateDialog::onCmdSetRandomNetwork(), GNENetgenerateDialog::onCmdSetRandomNetworkGridNetwork(), GNENetgenerateDialog::onCmdSetSpiderNetwork(), GNEPythonToolDialog::onCmdShowToolTipsMenu(), onKeyPress(), onKeyRelease(), openDialog(), GNEFixElementsDialog< T >::FixOptions::saveContents(), GNERunDialog::updateDialogButtons(), and GNEUndoListDialog::updateList().
|
protected |
back button
Definition at line 153 of file GNEDialog.h.
Referenced by buildDialog(), and GNERunDialog::updateDialogButtons().
|
protected |
|
protected |
content frame
Definition at line 135 of file GNEDialog.h.
Referenced by buildDialog(), getContentFrame(), GNEAboutDialog::GNEAboutDialog(), GNEAttributeCarrierDialog::GNEAttributeCarrierDialog(), GNEBasicDialog::GNEBasicDialog(), GNECalibratorDialog::GNECalibratorDialog(), GNEFilePathDialog::GNEFilePathDialog(), GNEFixElementsDialog< T >::GNEFixElementsDialog(), GNEHelpAttributesDialog::GNEHelpAttributesDialog(), GNEOverwriteElement::GNEOverwriteElement(), GNEParametersDialog::GNEParametersDialog(), GNERerouterIntervalDialog::GNERerouterIntervalDialog(), and GNEVehicleTypeDialog::GNEVehicleTypeDialog().
|
private |
focus button, used for focusing the default button when dialog is opened
Definition at line 181 of file GNEDialog.h.
Referenced by buildDialog(), and openDialog().
|
private |
open type
Definition at line 184 of file GNEDialog.h.
Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), and openDialog().
|
protected |
|
protected |
result to indicate if this dialog was closed accepting or rejecting changes
Definition at line 159 of file GNEDialog.h.
Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), and getResult().
|
protected |
run button
Definition at line 150 of file GNEDialog.h.
Referenced by buildDialog(), GNERunDialog::updateDialogButtons(), and GNENetgenerateDialog::updateRunButtons().
|
private |
flag to indicate if this dialog is being tested using internal test
Definition at line 187 of file GNEDialog.h.
Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), onKeyPress(), onKeyRelease(), and openDialog().