Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETemplateElementDialog< T > Class Template Referenceabstract

#include <GNETemplateElementDialog.h>

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

T * getElement () const
 get edited element
 GNETemplateElementDialog (T *element, DialogType type)
 constructor
 GNETemplateElementDialog (T *element, GNEDialog *parentDialog, DialogType type)
 constructor with parent dialog
virtual void runInternalTest (const InternalTestStep::DialogArgument *dialogArgument)=0
 run internal test
 ~GNETemplateElementDialog ()
 destructor
FOX-callbacks

event after press accept button

virtual long onCmdAccept (FXObject *sender, FXSelector sel, void *ptr)=0
 called when accept or yes button is pressed (can be reimplemented in children)
virtual long onCmdReset (FXObject *, FXSelector, void *)=0
 event after press cancel button
long onCmdCancel (FXObject *, FXSelector, void *)
 called when cancel or no button is pressed
long onCmdAbort (FXObject *, FXSelector, void *)
 called when abort is called either closing dialog or pressing abort button
FOX-callbacks
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 acceptElementDialog ()
 close dialog commiting changes
long closeDialogAborting ()
 close dialog aborting the changes
long closeDialogAccepting ()
 close dialog accepting the changes
long closeDialogCanceling ()
 close dialog declining the changes
 GNETemplateElementDialog ()
 default constructor
void openDialog (FXWindow *focusableElement=nullptr)
 open dialog
void resetChanges ()
 reset changes did in this 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
T * myElement = nullptr
 pointer to edited element
GNEDialogmyParentDialog = nullptr
 parent dialog used for restoring focus after closing dialog
FXButton * myReportButton = nullptr
 report button
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
DialogType myType = DialogType::DEFAULT
 dialog type

Private Member Functions

void buildDialog (GUIIcon titleIcon, Buttons buttons)
 build dialog
 GNETemplateElementDialog (const GNETemplateElementDialog &)=delete
 Invalidated copy constructor.
GNETemplateElementDialogoperator= (const GNETemplateElementDialog &)=delete
 Invalidated assignment operator.

Private Attributes

std::string myChangesDescription
 description of changes did in this element dialog
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
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

template<typename T>
class GNETemplateElementDialog< T >

Definition at line 31 of file GNETemplateElementDialog.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

◆ GNETemplateElementDialog() [1/4]

template<typename T>
GNETemplateElementDialog< T >::GNETemplateElementDialog ( T * element,
DialogType type )
inline

constructor

Definition at line 35 of file GNETemplateElementDialog.h.

References GNEDialog::GNEDialog(), myChangesDescription, myElement, and TLF.

Referenced by GNETemplateElementDialog(), and operator=().

Here is the caller graph for this function:

◆ GNETemplateElementDialog() [2/4]

template<typename T>
GNETemplateElementDialog< T >::GNETemplateElementDialog ( T * element,
GNEDialog * parentDialog,
DialogType type )
inline

constructor with parent dialog

Definition at line 47 of file GNETemplateElementDialog.h.

References GNEDialog::GNEDialog(), myChangesDescription, myElement, and TLF.

◆ ~GNETemplateElementDialog()

template<typename T>
GNETemplateElementDialog< T >::~GNETemplateElementDialog ( )
inline

destructor

Definition at line 59 of file GNETemplateElementDialog.h.

◆ GNETemplateElementDialog() [3/4]

template<typename T>
GNETemplateElementDialog< T >::GNETemplateElementDialog ( )
inlineprotected

default constructor

Definition at line 93 of file GNETemplateElementDialog.h.

References GNEDialog::GNEDialog().

◆ GNETemplateElementDialog() [4/4]

template<typename T>
GNETemplateElementDialog< T >::GNETemplateElementDialog ( const GNETemplateElementDialog< T > & )
privatedelete

Invalidated copy constructor.

References GNETemplateElementDialog().

Member Function Documentation

◆ acceptElementDialog()

template<typename T>
long GNETemplateElementDialog< T >::acceptElementDialog ( )
inlineprotected

close dialog commiting changes

Definition at line 100 of file GNETemplateElementDialog.h.

References GNEDialog::closeDialogAccepting(), and myElement.

◆ buildDialog()

◆ closeDialogAborting()

long GNEDialog::closeDialogAborting ( )
protectedinherited

close dialog aborting the changes

Definition at line 333 of file GNEDialog.cpp.

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

Referenced by onCmdAbort(), GNEOverwriteElement::onCmdAbort(), GNETemplateElementDialog< T >::onCmdAbort(), and GNEFixElementsDialog< GNEAdditional * >::updateIcon().

Here is the caller graph for this function:

◆ closeDialogAccepting()

long GNEDialog::closeDialogAccepting ( )
protectedinherited

◆ closeDialogCanceling()

◆ getApplicationWindow()

GNEApplicationWindow * GNEDialog::getApplicationWindow ( ) const
inherited

get pointer to the application window

Definition at line 139 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 145 of file GNEDialog.cpp.

References myContentFrame.

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

Here is the caller graph for this function:

◆ getElement()

◆ getResult()

GNEDialog::Result GNEDialog::getResult ( ) const
inherited

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

Definition at line 133 of file GNEDialog.cpp.

References myResult.

Referenced by GNECalibratorDialog::CalibratorFlowsList::addNewElement(), GNEViewNet::addRestrictedLane(), GNEViewNet::aksChangeSupermode(), GNESelectorFrame::SelectionOperation::askContinueIfLock(), GNEViewNet::askMergeJunctions(), GNENetHelper::SavingStatus::askSaveAdditionalElements(), GNENetHelper::SavingStatus::askSaveDataElements(), GNENetHelper::SavingStatus::askSaveDemandElements(), GNENetHelper::SavingStatus::askSaveMeanDataElements(), GNENetHelper::SavingStatus::askSaveNetwork(), GNEDataHandler::checkDuplicatedDataSet(), GNEMeanDataHandler::checkDuplicatedMeanDataElement(), GNEAdditionalHandler::checkElement(), GNERouteHandler::checkElement(), GNENet::cleanInvalidCrossings(), GNEApplicationWindow::computeJunctionWithVolatileOptions(), GNETypeFrame::TypeEditor::deleteType(), GNETLSEditorFrame::isTLSSaved(), GNENet::joinSelectedJunctions(), GNEApplicationWindow::loadOSM(), GNEFileSelector::onCmdAccept(), GNEDistributionFrame::DistributionValuesEditor::onCmdAddRow(), GNEFileSelector::onCmdCopy(), GNEFileSelector::onCmdDelete(), GNEPythonToolDialog::onCmdLoad(), GNEOptionsEditor::onCmdLoadOptions(), GNEFileSelector::onCmdMove(), GNEApplicationWindow::onCmdOpenAdditionalElements(), GNEApplicationWindow::onCmdOpenDataElements(), GNEApplicationWindow::onCmdOpenDemandElements(), GNEOptionsEditorRow::OptionFilename::onCmdOpenDialog(), GNEApplicationWindow::onCmdOpenEdgeTypes(), GNEAttributesEditorType::onCmdOpenEditParametersDialog(), GNEAttributesEditorType::onCmdOpenExtendedAttributesDialog(), GNEAttributesEditorRow::onCmdOpenFileDialog(), GNEApplicationWindow::onCmdOpenForeign(), GNEApplicationWindow::onCmdOpenMeanDataElements(), GNEApplicationWindow::onCmdOpenNetconvertConfig(), GNEApplicationWindow::onCmdOpenNeteditConfig(), GNEApplicationWindow::onCmdOpenNetwork(), GNEApplicationWindow::onCmdOpenOptionsDialog(), GNENetgenerateDialog::onCmdOpenOutputFile(), GNEVehicleTypeDialog::VTypeAttributes::onCmdOpenParametersEditor(), GNEApplicationWindow::onCmdOpenSumoConfig(), GNEApplicationWindow::onCmdOpenSumoOptionsDialog(), GNEApplicationWindow::onCmdOpenTLSPrograms(), GNETLSEditorFrame::TLSAttributes::onCmdParametersDialog(), GNEPythonToolDialog::onCmdSave(), GNEApplicationWindow::onCmdSaveAdditionalElementsAs(), GNEApplicationWindow::onCmdSaveAdditionalElementsUnified(), GNEApplicationWindow::onCmdSaveDataElementsAs(), GNEApplicationWindow::onCmdSaveDataElementsUnified(), GNEApplicationWindow::onCmdSaveDemandElementsAs(), GNEApplicationWindow::onCmdSaveDemandElementsUnified(), GNEApplicationWindow::onCmdSaveEdgeTypesAs(), GNEApplicationWindow::onCmdSaveJoinedJunctionsAs(), GNEApplicationWindow::onCmdSaveJuPedSimElementsAs(), GNERunDialog::onCmdSaveLog(), GNEApplicationWindow::onCmdSaveMeanDataElementsAs(), GNEApplicationWindow::onCmdSaveMeanDataElementsUnified(), GNEApplicationWindow::onCmdSaveNeteditConfigAs(), GNEApplicationWindow::onCmdSaveNetwork(), GNEApplicationWindow::onCmdSaveNetworkAs(), GNEOptionsEditor::onCmdSaveOptions(), GNEApplicationWindow::onCmdSavePlainXMLAs(), GNEApplicationWindow::onCmdSaveSumoConfigAs(), GNEApplicationWindow::onCmdSaveTLSProgramsAs(), GNEViewNet::onCmdSetCustomGeometryPoint(), GNETAZFrame::TAZChildDefaultParameters::onCmdSetZeroFringeProbabilities(), GNEViewNet::removeRestrictedLane(), GNEViewNet::restrictLane(), GNENet::saveAdditionals(), GNENet::saveDemandElements(), and GNEPythonToolDialogElements::FileNameArgument::updateFromDialog().

◆ onCmdAbort()

template<typename T>
long GNETemplateElementDialog< T >::onCmdAbort ( FXObject * ,
FXSelector ,
void *  )
inlinevirtual

called when abort is called either closing dialog or pressing abort button

Reimplemented from GNEDialog.

Definition at line 84 of file GNETemplateElementDialog.h.

References GNEDialog::closeDialogAborting(), and myElement.

◆ onCmdAccept()

template<typename T>
virtual long GNETemplateElementDialog< T >::onCmdAccept ( FXObject * ,
FXSelector ,
void *  )
pure virtual

called when accept or yes button is pressed (can be reimplemented in children)

Reimplemented from GNEDialog.

Implemented in GNEAttributeCarrierDialog, GNECalibratorDialog, GNERerouterDialog, GNERerouterIntervalDialog, GNEVariableSpeedSignDialog, and GNEVehicleTypeDialog.

◆ 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 187 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdBack()

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

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

Reimplemented in GNERunDialog, GNERunNetgenerateDialog, GNERunNetgenerateDialog, and GNERunPythonToolDialog.

Definition at line 181 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdCancel()

template<typename T>
long GNETemplateElementDialog< T >::onCmdCancel ( FXObject * ,
FXSelector ,
void *  )
inlinevirtual

called when cancel or no button is pressed

Reimplemented from GNEDialog.

Definition at line 78 of file GNETemplateElementDialog.h.

References GNEDialog::closeDialogCanceling(), and myElement.

◆ 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 193 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 199 of file GNEDialog.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdReset()

template<typename T>
virtual long GNETemplateElementDialog< T >::onCmdReset ( FXObject * ,
FXSelector ,
void *  )
pure virtual

◆ onCmdRun()

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

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

Reimplemented in GNENetgenerateDialog, GNENetgenerateOptionsDialog, GNEPythonToolDialog, and GNERunDialog.

Definition at line 175 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 )
inherited

called when user presses a key on the dialog

Definition at line 205 of file GNEDialog.cpp.

References 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 228 of file GNEDialog.cpp.

References myApplicationWindow, and myTesting.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ openDialog()

◆ operator=()

template<typename T>
GNETemplateElementDialog & GNETemplateElementDialog< T >::operator= ( const GNETemplateElementDialog< T > & )
privatedelete

Invalidated assignment operator.

References GNETemplateElementDialog().

◆ resetChanges()

template<typename T>
void GNETemplateElementDialog< T >::resetChanges ( )
inlineprotected

reset changes did in this dialog.

Definition at line 106 of file GNETemplateElementDialog.h.

References myChangesDescription, and myElement.

◆ runInternalTest()

template<typename T>
virtual void GNETemplateElementDialog< T >::runInternalTest ( const InternalTestStep::DialogArgument * dialogArgument)
pure virtual

◆ updateIcon()

void GNEDialog::updateIcon ( GUIIcon newIcon)
protectedinherited

update icon

Definition at line 359 of file GNEDialog.cpp.

References GUIIconSubSys::getIcon().

Referenced by GNEFileDialog::buildFileDialog().

Here is the caller graph for this function:

◆ updateTitle()

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

update title

Definition at line 353 of file GNEDialog.cpp.

Referenced by GNEFileDialog::buildFileDialog().

Here is the caller graph for this function:

Field Documentation

◆ myAbortButton

FXButton* GNEDialog::myAbortButton = nullptr
protectedinherited

abort button

Definition at line 168 of file GNEDialog.h.

Referenced by buildDialog().

◆ myAcceptButton

FXButton* GNEDialog::myAcceptButton = nullptr
protectedinherited

◆ myAdvancedButton

FXButton* GNEDialog::myAdvancedButton = nullptr
protectedinherited

advanced button

Definition at line 180 of file GNEDialog.h.

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

◆ myApplicationWindow

◆ myBackButton

FXButton* GNEDialog::myBackButton = nullptr
protectedinherited

back button

Definition at line 177 of file GNEDialog.h.

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

◆ myCancelButton

FXButton* GNEDialog::myCancelButton = nullptr
protectedinherited

cancel button

Definition at line 165 of file GNEDialog.h.

Referenced by buildDialog().

◆ myChangesDescription

template<typename T>
std::string GNETemplateElementDialog< T >::myChangesDescription
private

description of changes did in this element dialog

Definition at line 114 of file GNETemplateElementDialog.h.

Referenced by GNETemplateElementDialog(), GNETemplateElementDialog(), and resetChanges().

◆ myContentFrame

◆ myCopyButton

FXButton* GNEDialog::myCopyButton = nullptr
protectedinherited

copy button

Definition at line 183 of file GNEDialog.h.

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

◆ myElement

template<typename T>
T* GNETemplateElementDialog< T >::myElement = nullptr
protected

◆ myFocusButton

FXButton* GNEDialog::myFocusButton = nullptr
privateinherited

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

Definition at line 214 of file GNEDialog.h.

Referenced by buildDialog(), and openDialog().

◆ myOpenType

OpenType GNEDialog::myOpenType
privateinherited

◆ myParentDialog

GNEDialog* GNEDialog::myParentDialog = nullptr
protectedinherited

parent dialog used for restoring focus after closing dialog

Definition at line 156 of file GNEDialog.h.

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

◆ myReportButton

FXButton* GNEDialog::myReportButton = nullptr
protectedinherited

report button

Definition at line 186 of file GNEDialog.h.

Referenced by buildDialog().

◆ myResetButton

FXButton* GNEDialog::myResetButton = nullptr
protectedinherited

reset button

Definition at line 171 of file GNEDialog.h.

Referenced by buildDialog().

◆ myResult

Result GNEDialog::myResult = Result::CANCEL
protectedinherited

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

Definition at line 192 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 220 of file GNEDialog.h.

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

◆ myType

DialogType GNEDialog::myType = DialogType::DEFAULT
protectedinherited

dialog type

Definition at line 189 of file GNEDialog.h.

Referenced by GNEDialog(), GNEDialog(), and openDialog().


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