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

#include <GNERunDialog.h>

Inheritance diagram for GNERunDialog:
[legend]
Collaboration diagram for GNERunDialog:
[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

void addEvent (GUIEvent *event, const bool signal)
 add event in the queue
virtual std::string getRunCommand () const =0
 get run command
 GNERunDialog (GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, const bool closeIfSucess)
 FOX-declaration.
virtual void runInternalTest (const InternalTestStep::DialogArgument *dialogArgument)=0
 run internal test
 ~GNERunDialog ()
 destructor
FOX-callbacks
long onCmdAbort (FXObject *, FXSelector, void *)
 event after press abort button
long onCmdRun (FXObject *, FXSelector, void *)
 event after press rerun button
virtual long onCmdBack (FXObject *, FXSelector, void *)=0
 event after press back button
virtual long onCmdAccept (FXObject *, FXSelector, void *)=0
 event after press close button
long onCmdSaveLog (FXObject *, FXSelector, void *)
 event after press save button
long onThreadEvent (FXObject *, FXSelector, void *)
 called when the thread signals an event
FOX-callbacks
virtual long onCmdCancel (FXObject *, FXSelector, void *)
 called when cancel or no button is pressed (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 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
 FOX_CONSTRUCTOR (GNERunDialog)
 FOX needs this.
void openDialog (FXWindow *focusableElement=nullptr)
 open dialog
void updateDialogButtons ()
 update dialog buttons
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
const bool myCloseIfSucess = false
 flag to close dialog automatically if sucess
FXVerticalFrame * myContentFrame = nullptr
 content frame
FXButton * myCopyButton = nullptr
 copy button
bool myError = false
 flag to check if there is an error
MFXSynchQue< GUIEvent * > myEvents
 List of received events.
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
FXText * myText = nullptr
 text
FXEX::MFXThreadEvent myThreadEvent
 io-event with the runner thread
DialogType myType = DialogType::DEFAULT
 dialog type
bool myWarning = false
 flag to check if there is a warning

Private Member Functions

void buildDialog (GUIIcon titleIcon, Buttons buttons)
 build dialog
 GNERunDialog (const GNERunDialog &)=delete
 Invalidated copy constructor.
GNERunDialogoperator= (const GNERunDialog &)=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

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
void setRestoringFocusWindow (FXWindow *window)
 wet FXWindows uses for restoring focus
enum class  ResizeMode { STATIC , RESIZABLE }
enum class  Result {
  ACCEPT , CANCEL , ABORT , ACCEPT_ALL ,
  CANCEL_ALL
}
 list of possible results when closing the dialog More...

Detailed Description

Definition at line 37 of file GNERunDialog.h.

Member Enumeration Documentation

◆ Buttons

enum class GNEDialog::Buttons
stronginherited
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

enum class GNEDialog::OpenType
stronginherited

Open dialog type.

Enumerator
MODAL 
NON_MODAL 

Definition at line 58 of file GNEDialog.h.

◆ ResizeMode

enum class GNEDialog::ResizeMode
stronginherited
Enumerator
STATIC 
RESIZABLE 

Definition at line 64 of file GNEDialog.h.

◆ Result

enum class GNEDialog::Result
stronginherited

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

◆ GNERunDialog() [1/2]

GNERunDialog::GNERunDialog ( GNEApplicationWindow * applicationWindow,
const std::string & name,
GUIIcon titleIcon,
const bool closeIfSucess )

◆ ~GNERunDialog()

GNERunDialog::~GNERunDialog ( )

destructor

Definition at line 72 of file GNERunDialog.cpp.

◆ GNERunDialog() [2/2]

GNERunDialog::GNERunDialog ( const GNERunDialog & )
privatedelete

Invalidated copy constructor.

References GNERunDialog().

Member Function Documentation

◆ addEvent()

void GNERunDialog::addEvent ( GUIEvent * event,
const bool signal )

add event in the queue

Definition at line 76 of file GNERunDialog.cpp.

References myEvents, and myThreadEvent.

◆ buildDialog()

◆ closeDialogAborting()

long GNEDialog::closeDialogAborting ( )
protectedinherited

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 ( )
protectedinherited

◆ closeDialogCanceling()

◆ FOX_CONSTRUCTOR()

GNERunDialog::FOX_CONSTRUCTOR ( GNERunDialog )
protected

FOX needs this.

References GNERunDialog().

◆ getApplicationWindow()

GNEApplicationWindow * GNEDialog::getApplicationWindow ( ) const
inherited

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
inherited

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
inherited

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:

◆ getRunCommand()

virtual std::string GNERunDialog::getRunCommand ( ) const
pure virtual

get run command

Implemented in GNERunNetgenerateDialog, and GNERunPythonToolDialog.

◆ onCmdAbort()

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

event after press abort button

Reimplemented from GNEDialog.

Reimplemented in GNERunNetgenerateDialog, and GNERunPythonToolDialog.

Definition at line 87 of file GNERunDialog.cpp.

References GNEDialog::closeDialogCanceling(), and GNEDialog::myApplicationWindow.

◆ onCmdAccept()

virtual long GNERunDialog::onCmdAccept ( FXObject * ,
FXSelector ,
void *  )
pure virtual

event after press close button

Reimplemented from GNEDialog.

Implemented in GNERunNetgenerateDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, and GNERunPythonToolDialog.

Referenced by onThreadEvent().

Here is the caller graph for this function:

◆ onCmdAdvanced()

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

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()

virtual long GNERunDialog::onCmdBack ( FXObject * ,
FXSelector ,
void *  )
pure virtual

event after press back button

Reimplemented from GNEDialog.

Implemented in GNERunNetgenerateDialog, GNERunNetgenerateDialog, GNERunPythonToolDialog, and GNERunPythonToolDialog.

◆ onCmdCancel()

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

◆ onCmdCopy()

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

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 *  )
virtualinherited

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 *  )
virtualinherited

◆ onCmdRun()

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

event after press rerun button

Reimplemented from GNEDialog.

Definition at line 96 of file GNERunDialog.cpp.

References GNEDialog::myApplicationWindow, myError, myText, myWarning, and updateDialogButtons().

◆ onCmdSaveLog()

long GNERunDialog::onCmdSaveLog ( FXObject * ,
FXSelector ,
void *  )

event after press save button

Definition at line 118 of file GNERunDialog.cpp.

References GNEDialog::ACCEPT, OutputDevice::close(), OutputDevice::getDevice(), GNEDialog::myApplicationWindow, myText, GNEFileDialog::NETEDIT, GNEFileDialog::SAVE, TL, and SUMOXMLDefinitions::TXTFileExtensions.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onKeyPress()

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

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 )
inherited

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:

◆ onThreadEvent()

long GNERunDialog::onThreadEvent ( FXObject * ,
FXSelector ,
void *  )

called when the thread signals an event

Definition at line 136 of file GNERunDialog.cpp.

References ERROR_OCCURRED, GUIEvent_Message::getMsg(), GUIEvent::getOwnType(), MESSAGE_OCCURRED, myCloseIfSucess, myError, myEvents, myText, myWarning, onCmdAccept(), OUTPUT_OCCURRED, TOOL_ENDED, updateDialogButtons(), and WARNING_OCCURRED.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ openDialog()

◆ operator=()

GNERunDialog & GNERunDialog::operator= ( const GNERunDialog & )
privatedelete

Invalidated assignment operator.

References GNERunDialog().

◆ runInternalTest()

virtual void GNERunDialog::runInternalTest ( const InternalTestStep::DialogArgument * dialogArgument)
pure virtual

◆ setRestoringFocusWindow()

void GNEDialog::setRestoringFocusWindow ( FXWindow * window)
inherited

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:

◆ updateDialogButtons()

void GNERunDialog::updateDialogButtons ( )
protected

update dialog buttons

Definition at line 192 of file GNERunDialog.cpp.

References GUIIconSubSys::getIcon(), GNEDialog::myAcceptButton, GNEDialog::myApplicationWindow, GNEDialog::myBackButton, GNEDialog::myRunButton, START, STOP, and TL.

Referenced by GNERunDialog(), onCmdRun(), and onThreadEvent().

Here is the caller graph for this function:

◆ updateIcon()

void GNEDialog::updateIcon ( GUIIcon newIcon)
protectedinherited

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)
protectedinherited

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
protectedinherited

abort button

Definition at line 161 of file GNEDialog.h.

Referenced by buildDialog().

◆ myAcceptButton

FXButton* GNEDialog::myAcceptButton = nullptr
protectedinherited

◆ myAdvancedButton

FXButton* GNEDialog::myAdvancedButton = nullptr
protectedinherited

advanced button

Definition at line 173 of file GNEDialog.h.

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

◆ myApplicationWindow

◆ myBackButton

FXButton* GNEDialog::myBackButton = nullptr
protectedinherited

back button

Definition at line 170 of file GNEDialog.h.

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

◆ myCancelButton

FXButton* GNEDialog::myCancelButton = nullptr
protectedinherited

cancel button

Definition at line 158 of file GNEDialog.h.

Referenced by buildDialog().

◆ myCloseIfSucess

const bool GNERunDialog::myCloseIfSucess = false
protected

flag to close dialog automatically if sucess

Definition at line 86 of file GNERunDialog.h.

Referenced by GNERunDialog(), and onThreadEvent().

◆ myContentFrame

◆ myCopyButton

FXButton* GNEDialog::myCopyButton = nullptr
protectedinherited

copy button

Definition at line 176 of file GNEDialog.h.

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

◆ myError

bool GNERunDialog::myError = false
protected

flag to check if there is an error

Definition at line 101 of file GNERunDialog.h.

Referenced by GNERunPythonToolDialog::onCmdAccept(), onCmdRun(), and onThreadEvent().

◆ myEvents

MFXSynchQue<GUIEvent*> GNERunDialog::myEvents
protected

List of received events.

Definition at line 92 of file GNERunDialog.h.

Referenced by addEvent(), and onThreadEvent().

◆ myFocusButton

FXButton* GNEDialog::myFocusButton = nullptr
privateinherited

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
privateinherited

open type

Definition at line 210 of file GNEDialog.h.

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

◆ myReportButton

FXButton* GNEDialog::myReportButton = nullptr
protectedinherited

report button

Definition at line 179 of file GNEDialog.h.

Referenced by buildDialog().

◆ myResetButton

FXButton* GNEDialog::myResetButton = nullptr
protectedinherited

reset button

Definition at line 164 of file GNEDialog.h.

Referenced by buildDialog().

◆ myRestoringFocusWindow

FXWindow* GNEDialog::myRestoringFocusWindow = nullptr
protectedinherited

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
protectedinherited

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
protectedinherited

◆ myTesting

bool GNEDialog::myTesting = false
privateinherited

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().

◆ myText

FXText* GNERunDialog::myText = nullptr
protected

text

Definition at line 89 of file GNERunDialog.h.

Referenced by GNERunDialog(), onCmdRun(), onCmdSaveLog(), and onThreadEvent().

◆ myThreadEvent

FXEX::MFXThreadEvent GNERunDialog::myThreadEvent
protected

io-event with the runner thread

Definition at line 95 of file GNERunDialog.h.

Referenced by addEvent(), and GNERunDialog().

◆ myType

DialogType GNEDialog::myType = DialogType::DEFAULT
protectedinherited

dialog type

Definition at line 182 of file GNEDialog.h.

Referenced by GNEDialog(), and GNEDialog().

◆ myWarning

bool GNERunDialog::myWarning = false
protected

flag to check if there is a warning

Definition at line 98 of file GNERunDialog.h.

Referenced by onCmdRun(), and onThreadEvent().


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