Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNEOptionsDialog Class Reference

#include <GNEOptionsDialog.h>

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

Public Member Functions

FXuint openModalDialog (InternalTest *internalTests, FXuint placement=PLACEMENT_CURSOR)
 Run modal invocation of the dialog.
 
void runInternalTest (const InternalTestStep::DialogTest *modalArguments)
 run internal test
 
 ~GNEOptionsDialog ()
 Destructor.
 
FOX-callbacks
long onCmdCancel (FXObject *, FXSelector, void *)
 called when user press cancel button
 
long onCmdReset (FXObject *, FXSelector, void *)
 called when user press reset button
 
long onCmdRunNetgenerate (FXObject *, FXSelector, void *)
 called when user press reset button
 
long onCmdSelectTopic (FXObject *, FXSelector, void *)
 called when user select a topic in the list
 
long onCmdSearch (FXObject *, FXSelector, void *)
 called when user searches
 
long onCmdShowToolTipsMenu (FXObject *, FXSelector, void *)
 enable/disable show toolTip
 
long onCmdSaveOptions (FXObject *, FXSelector, void *)
 save options
 
long onCmdLoadOptions (FXObject *, FXSelector, void *)
 load options
 
long onCmdResetDefault (FXObject *, FXSelector, void *)
 reset default
 
FOX-callbacks
long onCmdAccept (FXObject *, FXSelector, void *)
 called when accept button is pressed
 
long onCmdInternalTest (FXObject *, FXSelector, void *ptr)
 event used in internal tests
 

Static Public Member Functions

static std::pair< int, bool > Options (GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
 Constructor for options dialogs.
 
static std::pair< int, bool > Run (GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
 Constructor for run dialogs.
 

Protected Member Functions

 GNEOptionsDialog ()
 FOX needs this.
 

Protected Attributes

GNEApplicationWindowmyGNEApp
 pointer to main window parent
 
OptionsContmyOptionsContainer
 reference to edited Option container
 
bool myOptionsModified = false
 flag for check if options was modified
 
const OptionsContmyOriginalOptionsContainer
 reference to original Option container
 
bool myTesting = false
 flag to indicate if this dialog is being tested using internal test
 

Private Member Functions

FXuint execute (FXuint placement=PLACEMENT_CURSOR)
 make execute private
 
 GNEOptionsDialog (const GNEOptionsDialog &)=delete
 Invalidated copy constructor.
 
 GNEOptionsDialog (GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName, const bool runDialog)
 Constructor.
 
bool loadConfiguration (const std::string &file)
 load configuration
 
GNEOptionsDialogoperator= (const GNEOptionsDialog &)=delete
 Invalidated assignment operator.
 
void updateVisibleEntriesBySearch (std::string searchText)
 update visible entries by search
 
bool updateVisibleEntriesByTopic ()
 update visible entries by selected topic
 

Private Attributes

MFXCheckButtonTooltipmyDescriptionSearchCheckButton = nullptr
 checkbox for enable/disable search by description
 
FXVerticalFrame * myEntriesFrame = nullptr
 vertical frame for entries
 
const std::set< std::string > myIgnoredEntries = {"geometry.remove", "edges.join", "geometry.split", "ramps.guess", "ramps.set"}
 ignores entries
 
const std::set< std::string > myIgnoredTopics = {"Configuration"}
 ignores topics
 
std::vector< GNEOptionsDialogElements::InputOption * > myInputOptionEntries
 Input option entries.
 
FXTreeItem * myRootItem = nullptr
 root item
 
MFXTextFieldSearchmySearchButton = nullptr
 search button
 
MFXCheckableButtonmyShowToolTipsMenu = nullptr
 checkable button for show toolTips
 
FXTreeList * myTopicsTreeList = nullptr
 Topics elements tree.
 
std::map< FXTreeItem *, std::string > myTreeItemTopics
 map with topics and their associated FXTreeItem
 

Friends

class GNEOptionsDialogElements
 FOX-declaration.
 

Detailed Description

@briefA Dialog for setting options (see OptionsCont)

Definition at line 46 of file GNEOptionsDialog.h.

Constructor & Destructor Documentation

◆ ~GNEOptionsDialog()

GNEOptionsDialog::~GNEOptionsDialog ( )

Destructor.

Definition at line 88 of file GNEOptionsDialog.cpp.

◆ GNEOptionsDialog() [1/3]

GNEOptionsDialog::GNEOptionsDialog ( )
protected

FOX needs this.

Definition at line 204 of file GNEOptionsDialog.cpp.

Referenced by Options(), and Run().

Here is the caller graph for this function:

◆ GNEOptionsDialog() [2/3]

GNEOptionsDialog::GNEOptionsDialog ( GNEApplicationWindow GNEApp,
GUIIcon  icon,
OptionsCont optionsContainer,
const OptionsCont originalOptionsContainer,
const char *  titleName,
const bool  runDialog 
)
private

Constructor.

Parameters
[in]GNEAppnetedit App
[in]optionsContaineredited option container
[in]originalOptionsContaineroriginal options container
[in]titleNameThe title to show
[in]iconwindows icon
[in]runDialogcheck if this is a run dialog

Definition at line 290 of file GNEOptionsDialog.cpp.

References ACCEPT, GUIDesigns::buildFXButton(), CANCEL, MFXGroupBoxModule::getCollapsableFrame(), OptionsCont::getDescription(), GUIIconSubSys::getIcon(), GUIMainWindow::getStaticTooltipMenu(), OptionsCont::getSubTopics(), OptionsCont::getSubTopicsEntries(), OptionsCont::getTypeName(), OptionsCont::getValueString(), GUIDesignAuxiliarFrame, GUIDesignAuxiliarHorizontalFrame, GUIDesignAuxiliarVerticalFrame, GUIDesignButtonConfiguration, GUIDesignButtonOK, GUIDesignCheckButtonThick, GUIDesignContentsFrame, GUIDesignHeight, GUIDesignHorizontalFrame, GUIDesignHorizontalFrameNoPadding, GUIDesignLabelThickedFixed, GUIDesignMFXCheckableButtonSquare, GUIDesignTextField, GUIDesignTextFieldNCol, GUIDesignTreeListFixedWidth, MID_CANCEL, MID_CHOOSEN_LOAD, MID_CHOOSEN_SAVE, MID_GNE_BUTTON_DEFAULT, MID_GNE_RESET, MID_GNE_RUNNETGENERATE, MID_GNE_SEARCH_USEDESCRIPTION, MID_GNE_SELECT, MID_GNE_SET_ATTRIBUTE, MID_SHOWTOOLTIPS_MENU, myDescriptionSearchCheckButton, myEntriesFrame, myGNEApp, myIgnoredEntries, myIgnoredTopics, myInputOptionEntries, myOptionsContainer, myRootItem, mySearchButton, myShowToolTipsMenu, myTopicsTreeList, myTreeItemTopics, OPEN, RESET, SAVE, MFXCheckableButton::setChecked(), MFXCheckButtonTooltip::setToolTipText(), SHOWTOOLTIPS_MENU, TL, and TREELISTWIDTH.

◆ GNEOptionsDialog() [3/3]

GNEOptionsDialog::GNEOptionsDialog ( const GNEOptionsDialog )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ execute()

FXuint MFXDialogBox::execute ( FXuint  placement = PLACEMENT_CURSOR)
privateinherited

make execute private

Definition at line 128 of file MFXDialogBox.cpp.

◆ loadConfiguration()

bool GNEOptionsDialog::loadConfiguration ( const std::string &  file)
private

load configuration

Definition at line 263 of file GNEOptionsDialog.cpp.

References OptionsLoader::errorOccurred(), myOptionsContainer, OptionsCont::resetWritable(), TL, StringUtils::transcode(), StringUtils::transcodeToLocal(), WRITE_ERROR, and WRITE_MESSAGE.

Referenced by onCmdLoadOptions().

Here is the caller graph for this function:

◆ onCmdAccept()

long MFXDialogBox::onCmdAccept ( FXObject *  ,
FXSelector  ,
void *   
)
inherited

called when accept button is pressed

Definition at line 93 of file MFXDialogBox.cpp.

References MFXDialogBox::myTesting.

Referenced by FXDEFMAP(), and GNEAllowVClassesDialog::onCmdAccept().

Here is the caller graph for this function:

◆ onCmdCancel()

long GNEOptionsDialog::onCmdCancel ( FXObject *  ,
FXSelector  ,
void *   
)

called when user press cancel button

Definition at line 98 of file GNEOptionsDialog.cpp.

References myInputOptionEntries.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdInternalTest()

long MFXDialogBox::onCmdInternalTest ( FXObject *  ,
FXSelector  ,
void *  ptr 
)
inherited

event used in internal tests

Definition at line 115 of file MFXDialogBox.cpp.

References MFXDialogBox::runInternalTest().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdLoadOptions()

long GNEOptionsDialog::onCmdLoadOptions ( FXObject *  ,
FXSelector  ,
void *   
)

load options

Definition at line 180 of file GNEOptionsDialog.cpp.

References loadConfiguration(), myInputOptionEntries, and GNEApplicationWindowHelper::openOptionFileDialog().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdReset()

long GNEOptionsDialog::onCmdReset ( FXObject *  ,
FXSelector  ,
void *   
)

called when user press reset button

Definition at line 109 of file GNEOptionsDialog.cpp.

References myInputOptionEntries.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdResetDefault()

long GNEOptionsDialog::onCmdResetDefault ( FXObject *  ,
FXSelector  ,
void *   
)

reset default

Definition at line 195 of file GNEOptionsDialog.cpp.

References myInputOptionEntries.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdRunNetgenerate()

long GNEOptionsDialog::onCmdRunNetgenerate ( FXObject *  ,
FXSelector  ,
void *   
)

called when user press reset button

Definition at line 119 of file GNEOptionsDialog.cpp.

References MID_GNE_RUNNETGENERATE, and myGNEApp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSaveOptions()

long GNEOptionsDialog::onCmdSaveOptions ( FXObject *  ,
FXSelector  ,
void *   
)

save options

Definition at line 166 of file GNEOptionsDialog.cpp.

References myOptionsContainer, GNEApplicationWindowHelper::openOptionFileDialog(), StringUtils::transcodeToLocal(), and OptionsCont::writeConfiguration().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSearch()

long GNEOptionsDialog::onCmdSearch ( FXObject *  ,
FXSelector  ,
void *   
)

called when user searches

Definition at line 137 of file GNEOptionsDialog.cpp.

References MFXTextFieldIcon::getText(), mySearchButton, updateVisibleEntriesBySearch(), and updateVisibleEntriesByTopic().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSelectTopic()

long GNEOptionsDialog::onCmdSelectTopic ( FXObject *  ,
FXSelector  ,
void *   
)

called when user select a topic in the list

Definition at line 128 of file GNEOptionsDialog.cpp.

References MFXTextFieldIcon::getText(), mySearchButton, and updateVisibleEntriesByTopic().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdShowToolTipsMenu()

long GNEOptionsDialog::onCmdShowToolTipsMenu ( FXObject *  ,
FXSelector  ,
void *   
)

enable/disable show toolTip

Definition at line 148 of file GNEOptionsDialog.cpp.

References MFXCheckableButton::amChecked(), MFXStaticToolTip::enableStaticToolTip(), GUIGlChildWindow::getShowToolTipsMenu(), GUIMainWindow::getStaticTooltipMenu(), GNEApplicationWindow::getViewNet(), GNEViewNet::getViewParent(), myGNEApp, myShowToolTipsMenu, and MFXCheckableButton::setChecked().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ openModalDialog()

FXuint MFXDialogBox::openModalDialog ( InternalTest internalTests,
FXuint  placement = PLACEMENT_CURSOR 
)
inherited

Run modal invocation of the dialog.

Definition at line 64 of file MFXDialogBox.cpp.

References InternalTest::getCurrentStep(), InternalTestStep::getModalDialogTestSteps(), and MFXDialogBox::myTesting.

Referenced by GNETLSEditorFrame::TLSAttributes::onCmdParametersDialog(), GNEAllowVClassesDialog::openDialog(), GNEFixElementsDialog::openFixDialog(), Options(), and Run().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ Options()

std::pair< int, bool > GNEOptionsDialog::Options ( GNEApplicationWindow GNEApp,
GUIIcon  icon,
OptionsCont optionsContainer,
const OptionsCont originalOptionsContainer,
const char *  titleName 
)
static

Constructor for options dialogs.

Parameters
[in]GNEAppnetedit App
[in]optionsContaineredited option container
[in]originalOptionsContaineroriginal options container
[in]iconwindows icon
[in]nameThe title to show
Returns
pair with int (TRUE, FALSE) depending of execution, and bool for check if options were modified

Definition at line 71 of file GNEOptionsDialog.cpp.

References GNEApplicationWindow::getInternalTest(), GNEOptionsDialog(), myOptionsModified, and MFXDialogBox::openModalDialog().

Referenced by GNEApplicationWindow::loadOSM(), GNEApplicationWindow::onCmdOpenOptionsDialog(), and GNEApplicationWindow::onCmdOpenSumoOptionsDialog().

Here is the caller graph for this function:

◆ Run()

std::pair< int, bool > GNEOptionsDialog::Run ( GNEApplicationWindow GNEApp,
GUIIcon  icon,
OptionsCont optionsContainer,
const OptionsCont originalOptionsContainer,
const char *  titleName 
)
static

Constructor for run dialogs.

Parameters
[in]GNEAppnetedit App
[in]optionsContaineredited option container
[in]originalOptionsContaineroriginal options container
[in]iconwindows icon
[in]nameThe title to show
Returns
pair with int (TRUE, FALSE) depending of execution, and bool for check if options were modified

Definition at line 80 of file GNEOptionsDialog.cpp.

References GNEApplicationWindow::getInternalTest(), GNEOptionsDialog(), myOptionsModified, and MFXDialogBox::openModalDialog().

Referenced by GNEApplicationWindow::onCmdOpenNetgenerateOptionsDialog().

Here is the caller graph for this function:

◆ runInternalTest()

void GNEOptionsDialog::runInternalTest ( const InternalTestStep::DialogTest modalArguments)
virtual

run internal test

Reimplemented from MFXDialogBox.

Definition at line 92 of file GNEOptionsDialog.cpp.

◆ updateVisibleEntriesBySearch()

void GNEOptionsDialog::updateVisibleEntriesBySearch ( std::string  searchText)
private

update visible entries by search

Definition at line 240 of file GNEOptionsDialog.cpp.

References myDescriptionSearchCheckButton, myEntriesFrame, myInputOptionEntries, and StringUtils::to_lower_case().

Referenced by onCmdSearch().

Here is the caller graph for this function:

◆ updateVisibleEntriesByTopic()

bool GNEOptionsDialog::updateVisibleEntriesByTopic ( )
private

update visible entries by selected topic

Definition at line 212 of file GNEOptionsDialog.cpp.

References myEntriesFrame, myInputOptionEntries, and myTreeItemTopics.

Referenced by onCmdSearch(), and onCmdSelectTopic().

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ GNEOptionsDialogElements

FOX-declaration.

declare friend class

Definition at line 51 of file GNEOptionsDialog.h.

Field Documentation

◆ myDescriptionSearchCheckButton

MFXCheckButtonTooltip* GNEOptionsDialog::myDescriptionSearchCheckButton = nullptr
private

checkbox for enable/disable search by description

Definition at line 146 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog(), and updateVisibleEntriesBySearch().

◆ myEntriesFrame

FXVerticalFrame* GNEOptionsDialog::myEntriesFrame = nullptr
private

vertical frame for entries

Definition at line 143 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog(), updateVisibleEntriesBySearch(), and updateVisibleEntriesByTopic().

◆ myGNEApp

GNEApplicationWindow* GNEOptionsDialog::myGNEApp
protected

pointer to main window parent

Definition at line 121 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog(), onCmdRunNetgenerate(), and onCmdShowToolTipsMenu().

◆ myIgnoredEntries

const std::set<std::string> GNEOptionsDialog::myIgnoredEntries = {"geometry.remove", "edges.join", "geometry.split", "ramps.guess", "ramps.set"}
private

ignores entries

Definition at line 161 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog().

◆ myIgnoredTopics

const std::set<std::string> GNEOptionsDialog::myIgnoredTopics = {"Configuration"}
private

ignores topics

Definition at line 158 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog().

◆ myInputOptionEntries

std::vector<GNEOptionsDialogElements::InputOption*> GNEOptionsDialog::myInputOptionEntries
private

◆ myOptionsContainer

◆ myOptionsModified

bool GNEOptionsDialog::myOptionsModified = false
protected

flag for check if options was modified

Definition at line 130 of file GNEOptionsDialog.h.

Referenced by Options(), and Run().

◆ myOriginalOptionsContainer

const OptionsCont& GNEOptionsDialog::myOriginalOptionsContainer
protected

reference to original Option container

Definition at line 127 of file GNEOptionsDialog.h.

◆ myRootItem

FXTreeItem* GNEOptionsDialog::myRootItem = nullptr
private

root item

Definition at line 140 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog().

◆ mySearchButton

MFXTextFieldSearch* GNEOptionsDialog::mySearchButton = nullptr
private

search button

Definition at line 149 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog(), onCmdSearch(), and onCmdSelectTopic().

◆ myShowToolTipsMenu

MFXCheckableButton* GNEOptionsDialog::myShowToolTipsMenu = nullptr
private

checkable button for show toolTips

Definition at line 134 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog(), and onCmdShowToolTipsMenu().

◆ myTesting

bool MFXDialogBox::myTesting = false
protectedinherited

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

Definition at line 66 of file MFXDialogBox.h.

Referenced by MFXDialogBox::onCmdAccept(), MFXDialogBox::onCmdCancel(), and MFXDialogBox::openModalDialog().

◆ myTopicsTreeList

FXTreeList* GNEOptionsDialog::myTopicsTreeList = nullptr
private

Topics elements tree.

Definition at line 137 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog().

◆ myTreeItemTopics

std::map<FXTreeItem*, std::string> GNEOptionsDialog::myTreeItemTopics
private

map with topics and their associated FXTreeItem

Definition at line 152 of file GNEOptionsDialog.h.

Referenced by GNEOptionsDialog(), and updateVisibleEntriesByTopic().


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