Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDialog Class Referenceabstract

#include <GNEDialog.h>

Inheritance diagram for GNEDialog:
[legend]
Collaboration diagram for GNEDialog:
[legend]

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_OK , OK_COPY_REPORT
}
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 depending of Buttons)
virtual long onCmdRun (FXObject *, FXSelector, void *)
 called when run button is pressed (must be reimplemented in children depending of Buttons)
virtual long onCmdBack (FXObject *, FXSelector, void *)
 called when back button is pressed (must be reimplemented in children depending of Buttons)
virtual long onCmdAdvanced (FXObject *, FXSelector, void *)
 called when advanced 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 onCmdReport (FXObject *, FXSelector, void *)
 called when report button is pressed (must be reimplemented in children depending of Buttons)
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
GNEApplicationWindowmyApplicationWindow = nullptr
 FOX needs this.
FXButton * myBackButton = nullptr
 back button
FXButton * myCancelButton = nullptr
 cancel button
FXVerticalFrame * myContentFrame = nullptr
 content frame
FXButton * myCopyButton = nullptr
 copy button
FXButton * myReportButton = nullptr
 report button
FXButton * myResetButton = nullptr
 reset button
FXWindow * myRestoringFocusWindow = nullptr
 FXWindows that restoring focus window.
Result myResult = Result::CANCEL
 result to indicate if this dialog was closed accepting or rejecting changes
FXButton * myRunButton = nullptr
 run button
DialogType myType = DialogType::DEFAULT
 dialog type

Private Member Functions

void buildDialog (GUIIcon titleIcon, Buttons buttons)
 build dialog
 GNEDialog (const GNEDialog &)=delete
 Invalidated copy constructor.
GNEDialogoperator= (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 , ACCEPT_ALL ,
  CANCEL_ALL
}
 list of possible results when closing the dialog More...
 GNEDialog (GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, DialogType type, Buttons buttons, OpenType openType, ResizeMode resizeMode)
 basic constructor
 GNEDialog (GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, DialogType type, Buttons buttons, OpenType openType, ResizeMode resizeMode, const int width, const int height)
 constructor with layout explicit
Result getResult () const
 get result to indicate if this dialog was closed accepting or rejecting changes
GNEApplicationWindowgetApplicationWindow () const
 get pointer to the application window
FXVerticalFrame * getContentFrame () const
 get content frame
virtual void runInternalTest (const InternalTestStep::DialogArgument *dialogArgument)=0
 run internal test
void setRestoringFocusWindow (FXWindow *window)
 wet FXWindows uses for restoring focus

Detailed Description

Definition at line 38 of file GNEDialog.h.

Member Enumeration Documentation

◆ Buttons

Enumerator
OK 
YES_NO 
YES_NO_CANCEL 
ACCEPT 
ACCEPT_CANCEL 
ACCEPT_CANCEL_RESET 
SAVE_DONTSAVE_CANCEL 
RUN_CANCEL_RESET 
RUN_ADVANCED_CANCEL 
RERUN_BACK_OK 
OK_COPY_REPORT 

Definition at line 43 of file GNEDialog.h.

◆ OpenType

Open dialog type.

Enumerator
MODAL 
NON_MODAL 

Definition at line 58 of file GNEDialog.h.

◆ ResizeMode

Enumerator
STATIC 
RESIZABLE 

Definition at line 64 of file GNEDialog.h.

◆ Result

enum class GNEDialog::Result
strong

list of possible results when closing the dialog

Enumerator
ACCEPT 
CANCEL 
ABORT 
ACCEPT_ALL 
CANCEL_ALL 

Definition at line 70 of file GNEDialog.h.

Constructor & Destructor Documentation

◆ GNEDialog() [1/3]

GNEDialog::GNEDialog ( GNEApplicationWindow * applicationWindow,
const std::string & name,
GUIIcon titleIcon,
DialogType type,
Buttons buttons,
OpenType openType,
ResizeMode resizeMode )

basic constructor

Definition at line 60 of file GNEDialog.cpp.

References GNEDialog(), GUIDesignGNEDialogResizable, GUIDesignGNEDialogStatic, myApplicationWindow, myOpenType, and myType.

Referenced by GNEAboutDialog::GNEAboutDialog(), GNEBasicDialog::GNEBasicDialog(), GNEColorDialog::GNEColorDialog(), GNECrashDialog::GNECrashDialog(), GNEDialog(), GNEDialog(), GNEDistributionRefDialog::GNEDistributionRefDialog(), GNEErrorBasicDialog::GNEErrorBasicDialog(), GNEErrorBasicDialog::GNEErrorBasicDialog(), GNEFileDialog::GNEFileDialog(), GNEFilePathDialog::GNEFilePathDialog(), GNEFixElementsDialog< T >::GNEFixElementsDialog(), GNEGeometryPointDialog::GNEGeometryPointDialog(), GNEHelpAttributesDialog::GNEHelpAttributesDialog(), GNEHelpBasicDialog::GNEHelpBasicDialog(), GNEInformationBasicDialog::GNEInformationBasicDialog(), GNEInformationBasicDialog::GNEInformationBasicDialog(), GNENeteditOptionsDialog::GNENeteditOptionsDialog(), GNENetgenerateDialog::GNENetgenerateDialog(), GNENetgenerateOptionsDialog::GNENetgenerateOptionsDialog(), GNEOverwriteElement::GNEOverwriteElement(), GNEParametersDialog::GNEParametersDialog(), GNEPythonToolDialog::GNEPythonToolDialog(), GNERunDialog::GNERunDialog(), GNESaveDialog::GNESaveDialog(), GNESumoOptionsDialog::GNESumoOptionsDialog(), GNETemplateElementDialog< T >::GNETemplateElementDialog(), GNETemplateElementDialog< T >::GNETemplateElementDialog(), GNEUndoListDialog::GNEUndoListDialog(), GNEVClassesDialog::GNEVClassesDialog(), GNEWarningBasicDialog::GNEWarningBasicDialog(), GNEWarningBasicDialog::GNEWarningBasicDialog(), operator=(), and runInternalTest().

Here is the caller graph for this function:

◆ GNEDialog() [2/3]

GNEDialog::GNEDialog ( GNEApplicationWindow * applicationWindow,
const std::string & name,
GUIIcon titleIcon,
DialogType type,
Buttons buttons,
OpenType openType,
ResizeMode resizeMode,
const int width,
const int height )

constructor with layout explicit

Definition at line 76 of file GNEDialog.cpp.

References GUIDesignGNEDialogResizableExplicit, GUIDesignGNEDialogStaticExplicit, myApplicationWindow, myOpenType, and myType.

◆ GNEDialog() [3/3]

GNEDialog::GNEDialog ( const GNEDialog & )
privatedelete

Invalidated copy constructor.

References GNEDialog().

Member Function Documentation

◆ buildDialog()

◆ closeDialogAborting()

long GNEDialog::closeDialogAborting ( )
protected

close dialog aborting the changes

Definition at line 295 of file GNEDialog.cpp.

References ABORT, MODAL, myApplicationWindow, myOpenType, myRestoringFocusWindow, myResult, and myTesting.

Referenced by onCmdAbort(), GNEOverwriteElement::onCmdAbort(), GNETemplateElementDialog< T >::onCmdAbort(), and onKeyPress().

Here is the caller graph for this function:

◆ closeDialogAccepting()

long GNEDialog::closeDialogAccepting ( )
protected

◆ closeDialogCanceling()

◆ getApplicationWindow()

GNEApplicationWindow * GNEDialog::getApplicationWindow ( ) const

get pointer to the application window

Definition at line 102 of file GNEDialog.cpp.

References myApplicationWindow.

Referenced by GNEPythonToolDialog::buildArguments().

Here is the caller graph for this function:

◆ getContentFrame()

FXVerticalFrame * GNEDialog::getContentFrame ( ) const

get content frame

Definition at line 108 of file GNEDialog.cpp.

References myContentFrame.

Referenced by GNEColorDialog::GNEColorDialog(), and GNEVClassesDialog::GNEVClassesDialog().

Here is the caller graph for this function:

◆ getResult()

GNEDialog::Result GNEDialog::getResult ( ) const

get result to indicate if this dialog was closed accepting or rejecting changes

Definition at line 96 of file GNEDialog.cpp.

References myResult.

Referenced by GNEDataHandler::checkDuplicatedDataSet(), GNEMeanDataHandler::checkDuplicatedMeanDataElement(), GNEAdditionalHandler::checkElement(), GNERouteHandler::checkElement(), and GNEDistributionFrame::DistributionValuesEditor::onCmdAddRow().

Here is the caller graph for this function:

◆ onCmdAbort()

long GNEDialog::onCmdAbort ( FXObject * ,
FXSelector ,
void *  )
virtual

called when abort is called either closing dialog or pressing abort button (can be reimplemented in children)

Reimplemented in GNEOverwriteElement, GNERunDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, GNETemplateElementDialog< T >, GNETemplateElementDialog< elementDialogType >, GNETemplateElementDialog< GNEAdditional >, GNETemplateElementDialog< GNEAttributeCarrier >, and GNETemplateElementDialog< GNEDemandElement >.

Definition at line 132 of file GNEDialog.cpp.

References closeDialogAborting().

Referenced by GNEFixElementsDialog< GNEAdditional * >::buildDialog(), and FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdAccept()

◆ onCmdAdvanced()

long GNEDialog::onCmdAdvanced ( FXObject * ,
FXSelector ,
void *  )
virtual

called when advanced button is pressed (must be reimplemented in children depending of Buttons)

Reimplemented in GNENetgenerateDialog.

Definition at line 156 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdBack()

long GNEDialog::onCmdBack ( FXObject * ,
FXSelector ,
void *  )
virtual

called when back button is pressed (must be reimplemented in children depending of Buttons)

Reimplemented in GNERunDialog, GNERunNetgenerateDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, and GNERunPythonToolDialog.

Definition at line 150 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdCancel()

long GNEDialog::onCmdCancel ( FXObject * ,
FXSelector ,
void *  )
virtual

◆ onCmdCopy()

long GNEDialog::onCmdCopy ( FXObject * ,
FXSelector ,
void *  )
virtual

called when copy button is pressed (must be reimplemented in children depending of Buttons)

Reimplemented in GNECrashDialog.

Definition at line 162 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdReport()

long GNEDialog::onCmdReport ( FXObject * ,
FXSelector ,
void *  )
virtual

called when report button is pressed (must be reimplemented in children depending of Buttons)

Reimplemented in GNECrashDialog.

Definition at line 168 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdReset()

long GNEDialog::onCmdReset ( FXObject * ,
FXSelector ,
void *  )
virtual

◆ onCmdRun()

long GNEDialog::onCmdRun ( FXObject * ,
FXSelector ,
void *  )
virtual

called when run button is pressed (must be reimplemented in children depending of Buttons)

Reimplemented in GNENetgenerateDialog, GNENetgenerateOptionsDialog, GNEPythonToolDialog, and GNERunDialog.

Definition at line 144 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onKeyPress()

long GNEDialog::onKeyPress ( FXObject * obj,
FXSelector sel,
void * ptr )

called when user presses a key on the dialog

Definition at line 174 of file GNEDialog.cpp.

References closeDialogAborting(), myApplicationWindow, and myTesting.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onKeyRelease()

long GNEDialog::onKeyRelease ( FXObject * obj,
FXSelector sel,
void * ptr )

called when user releases a key on the dialog

Definition at line 190 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ openDialog()

◆ operator=()

GNEDialog & GNEDialog::operator= ( const GNEDialog & src)
privatedelete

Invalidated assignment operator.

References GNEDialog().

◆ runInternalTest()

◆ setRestoringFocusWindow()

void GNEDialog::setRestoringFocusWindow ( FXWindow * window)

wet FXWindows uses for restoring focus

Definition at line 114 of file GNEDialog.cpp.

References myRestoringFocusWindow.

Referenced by GNEFileDialog::GNEFileDialog().

Here is the caller graph for this function:

◆ updateIcon()

void GNEDialog::updateIcon ( GUIIcon newIcon)
protected

update icon

Definition at line 321 of file GNEDialog.cpp.

References GUIIconSubSys::getIcon().

Referenced by GNEFileDialog::GNEFileDialog().

Here is the caller graph for this function:

◆ updateTitle()

void GNEDialog::updateTitle ( const std::string & newTitle)
protected

update title

Definition at line 315 of file GNEDialog.cpp.

Referenced by GNEFileDialog::GNEFileDialog().

Here is the caller graph for this function:

Field Documentation

◆ myAbortButton

FXButton* GNEDialog::myAbortButton = nullptr
protected

abort button

Definition at line 161 of file GNEDialog.h.

Referenced by buildDialog().

◆ myAcceptButton

FXButton* GNEDialog::myAcceptButton = nullptr
protected

◆ myAdvancedButton

FXButton* GNEDialog::myAdvancedButton = nullptr
protected

advanced button

Definition at line 173 of file GNEDialog.h.

Referenced by buildDialog(), and GNENetgenerateDialog::updateRunButtons().

◆ myApplicationWindow

◆ myBackButton

FXButton* GNEDialog::myBackButton = nullptr
protected

back button

Definition at line 170 of file GNEDialog.h.

Referenced by buildDialog(), and GNERunDialog::updateDialogButtons().

◆ myCancelButton

FXButton* GNEDialog::myCancelButton = nullptr
protected

cancel button

Definition at line 158 of file GNEDialog.h.

Referenced by buildDialog().

◆ myContentFrame

◆ myCopyButton

FXButton* GNEDialog::myCopyButton = nullptr
protected

copy button

Definition at line 176 of file GNEDialog.h.

Referenced by buildDialog(), and GNECrashDialog::GNECrashDialog().

◆ myFocusButton

FXButton* GNEDialog::myFocusButton = nullptr
private

focus button, used for focusing the default button when dialog is opened

Definition at line 207 of file GNEDialog.h.

Referenced by buildDialog().

◆ myOpenType

OpenType GNEDialog::myOpenType
private

open type

Definition at line 210 of file GNEDialog.h.

Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), GNEDialog(), and GNEDialog().

◆ myReportButton

FXButton* GNEDialog::myReportButton = nullptr
protected

report button

Definition at line 179 of file GNEDialog.h.

Referenced by buildDialog().

◆ myResetButton

FXButton* GNEDialog::myResetButton = nullptr
protected

reset button

Definition at line 164 of file GNEDialog.h.

Referenced by buildDialog().

◆ myRestoringFocusWindow

FXWindow* GNEDialog::myRestoringFocusWindow = nullptr
protected

FXWindows that restoring focus window.

Definition at line 149 of file GNEDialog.h.

Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), and setRestoringFocusWindow().

◆ myResult

Result GNEDialog::myResult = Result::CANCEL
protected

result to indicate if this dialog was closed accepting or rejecting changes

Definition at line 185 of file GNEDialog.h.

Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), getResult(), GNESaveDialog::onCmdAccept(), and GNESaveDialog::onCmdCancel().

◆ myRunButton

FXButton* GNEDialog::myRunButton = nullptr
protected

◆ myTesting

bool GNEDialog::myTesting = false
private

flag to indicate if this dialog is being tested using internal test

Definition at line 213 of file GNEDialog.h.

Referenced by closeDialogAborting(), closeDialogAccepting(), closeDialogCanceling(), and onKeyPress().

◆ myType

DialogType GNEDialog::myType = DialogType::DEFAULT
protected

dialog type

Definition at line 182 of file GNEDialog.h.

Referenced by GNEDialog(), and GNEDialog().


The documentation for this class was generated from the following files: