Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEOptionsEditor Class Reference

#include <GNEOptionsEditor.h>

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

Public Member Functions

 GNEOptionsEditor (GNEDialog *dialog, const std::string &titleName, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer)
 Constructor.
 
bool isOptionModified () const
 check if option was modified
 
void resetAllOptions ()
 reset options
 
void runInternalTest (const InternalTestStep::DialogArgument *dialogArgument)
 run internal test
 
 ~GNEOptionsEditor ()
 Destructor.
 
FOX-callbacks
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
 

Protected Member Functions

 GNEOptionsEditor ()
 FOX needs this.
 

Protected Attributes

OptionsContmyCopyOfOptionsContainer = nullptr
 copy of edited Option container, used for reset
 
GNEDialogmyDialog = nullptr
 reference to dialog
 
OptionsContmyOptionsContainer
 reference to edited Option container
 
bool myOptionsModified = false
 flag for check if options was modified
 
const OptionsContmyOriginalOptionsContainer
 reference to original Option container, used for restoring
 

Private Member Functions

 GNEOptionsEditor (const GNEOptionsEditor &)=delete
 Invalidated copy constructor.
 
bool loadConfiguration (const std::string &file)
 load configuration
 
GNEOptionsEditoroperator= (const GNEOptionsEditor &)=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< GNEOptionsEditorRow::OptionRow * > myOptionRowEntries
 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 GNEOptionsEditorRow
 FOX-declaration.
 

Detailed Description

Definition at line 43 of file GNEOptionsEditor.h.

Constructor & Destructor Documentation

◆ GNEOptionsEditor() [1/3]

GNEOptionsEditor::GNEOptionsEditor ( GNEDialog dialog,
const std::string &  titleName,
OptionsCont optionsContainer,
const OptionsCont originalOptionsContainer 
)

◆ ~GNEOptionsEditor()

GNEOptionsEditor::~GNEOptionsEditor ( )

Destructor.

Definition at line 160 of file GNEOptionsEditor.cpp.

References myCopyOfOptionsContainer.

◆ GNEOptionsEditor() [2/3]

GNEOptionsEditor::GNEOptionsEditor ( )
protected

FOX needs this.

Definition at line 270 of file GNEOptionsEditor.cpp.

◆ GNEOptionsEditor() [3/3]

GNEOptionsEditor::GNEOptionsEditor ( const GNEOptionsEditor )
privatedelete

Invalidated copy constructor.

Member Function Documentation

◆ isOptionModified()

bool GNEOptionsEditor::isOptionModified ( ) const

check if option was modified

Definition at line 172 of file GNEOptionsEditor.cpp.

References myOptionsModified.

Referenced by GNENeteditOptionsDialog::isOptionModified(), GNENetgenerateOptionsDialog::isOptionModified(), and GNESumoOptionsDialog::isOptionModified().

Here is the caller graph for this function:

◆ loadConfiguration()

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

load configuration

Definition at line 328 of file GNEOptionsEditor.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:

◆ onCmdLoadOptions()

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

load options

Definition at line 243 of file GNEOptionsEditor.cpp.

References GNEDialog::ACCEPT, GNEDialog::getApplicationWindow(), GNEFileDialog::LOAD_SINGLE, loadConfiguration(), myDialog, myOptionRowEntries, GNEFileDialog::NETEDIT, TL, and SUMOXMLDefinitions::XMLFileExtensions.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdResetDefault()

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

reset default

Definition at line 261 of file GNEOptionsEditor.cpp.

References myOptionRowEntries.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSaveOptions()

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

save options

Definition at line 226 of file GNEOptionsEditor.cpp.

References GNEDialog::ACCEPT, GNEDialog::getApplicationWindow(), myDialog, myOptionsContainer, GNEFileDialog::NETEDIT, GNEFileDialog::SAVE, TL, StringUtils::transcodeToLocal(), OptionsCont::writeConfiguration(), and SUMOXMLDefinitions::XMLFileExtensions.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSearch()

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

called when user searches

Definition at line 195 of file GNEOptionsEditor.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSelectTopic()

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

called when user select a topic in the list

Definition at line 186 of file GNEOptionsEditor.cpp.

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

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdShowToolTipsMenu()

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

enable/disable show toolTip

Definition at line 206 of file GNEOptionsEditor.cpp.

References MFXCheckableButton::amChecked(), MFXStaticToolTip::enableStaticToolTip(), GNEDialog::getApplicationWindow(), GUIMainWindow::getStaticTooltipMenu(), GNEApplicationWindow::getViewNet(), myDialog, myShowToolTipsMenu, and MFXCheckableButton::setChecked().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ resetAllOptions()

void GNEOptionsEditor::resetAllOptions ( )

reset options

Definition at line 177 of file GNEOptionsEditor.cpp.

References myOptionRowEntries, and myOptionsModified.

Referenced by GNENeteditOptionsDialog::onCmdCancel(), GNENetgenerateOptionsDialog::onCmdCancel(), GNESumoOptionsDialog::onCmdCancel(), GNENeteditOptionsDialog::onCmdReset(), GNENetgenerateOptionsDialog::onCmdReset(), and GNESumoOptionsDialog::onCmdReset().

Here is the caller graph for this function:

◆ runInternalTest()

void GNEOptionsEditor::runInternalTest ( const InternalTestStep::DialogArgument dialogArgument)

run internal test

Definition at line 166 of file GNEOptionsEditor.cpp.

Referenced by GNENeteditOptionsDialog::runInternalTest(), GNENetgenerateOptionsDialog::runInternalTest(), and GNESumoOptionsDialog::runInternalTest().

Here is the caller graph for this function:

◆ updateVisibleEntriesBySearch()

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

update visible entries by search

Definition at line 305 of file GNEOptionsEditor.cpp.

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

Referenced by onCmdSearch().

Here is the caller graph for this function:

◆ updateVisibleEntriesByTopic()

bool GNEOptionsEditor::updateVisibleEntriesByTopic ( )
private

update visible entries by selected topic

Definition at line 277 of file GNEOptionsEditor.cpp.

References myEntriesFrame, myOptionRowEntries, and myTreeItemTopics.

Referenced by onCmdSearch(), and onCmdSelectTopic().

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ GNEOptionsEditorRow

friend class GNEOptionsEditorRow
friend

FOX-declaration.

declare friend class

Definition at line 48 of file GNEOptionsEditor.h.

Field Documentation

◆ myCopyOfOptionsContainer

OptionsCont* GNEOptionsEditor::myCopyOfOptionsContainer = nullptr
protected

copy of edited Option container, used for reset

Definition at line 107 of file GNEOptionsEditor.h.

Referenced by ~GNEOptionsEditor().

◆ myDescriptionSearchCheckButton

MFXCheckButtonTooltip* GNEOptionsEditor::myDescriptionSearchCheckButton = nullptr
private

checkbox for enable/disable search by description

Definition at line 129 of file GNEOptionsEditor.h.

Referenced by updateVisibleEntriesBySearch().

◆ myDialog

GNEDialog* GNEOptionsEditor::myDialog = nullptr
protected

reference to dialog

Definition at line 101 of file GNEOptionsEditor.h.

Referenced by onCmdLoadOptions(), onCmdSaveOptions(), and onCmdShowToolTipsMenu().

◆ myEntriesFrame

FXVerticalFrame* GNEOptionsEditor::myEntriesFrame = nullptr
private

vertical frame for entries

Definition at line 126 of file GNEOptionsEditor.h.

Referenced by updateVisibleEntriesBySearch(), and updateVisibleEntriesByTopic().

◆ myIgnoredEntries

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

ignores entries

Definition at line 144 of file GNEOptionsEditor.h.

◆ myIgnoredTopics

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

ignores topics

Definition at line 141 of file GNEOptionsEditor.h.

◆ myOptionRowEntries

std::vector<GNEOptionsEditorRow::OptionRow*> GNEOptionsEditor::myOptionRowEntries
private

◆ myOptionsContainer

◆ myOptionsModified

bool GNEOptionsEditor::myOptionsModified = false
protected

flag for check if options was modified

Definition at line 113 of file GNEOptionsEditor.h.

Referenced by isOptionModified(), and resetAllOptions().

◆ myOriginalOptionsContainer

const OptionsCont& GNEOptionsEditor::myOriginalOptionsContainer
protected

reference to original Option container, used for restoring

Definition at line 110 of file GNEOptionsEditor.h.

◆ myRootItem

FXTreeItem* GNEOptionsEditor::myRootItem = nullptr
private

root item

Definition at line 123 of file GNEOptionsEditor.h.

◆ mySearchButton

MFXTextFieldSearch* GNEOptionsEditor::mySearchButton = nullptr
private

search button

Definition at line 132 of file GNEOptionsEditor.h.

Referenced by onCmdSearch(), and onCmdSelectTopic().

◆ myShowToolTipsMenu

MFXCheckableButton* GNEOptionsEditor::myShowToolTipsMenu = nullptr
private

checkable button for show toolTips

Definition at line 117 of file GNEOptionsEditor.h.

Referenced by onCmdShowToolTipsMenu().

◆ myTopicsTreeList

FXTreeList* GNEOptionsEditor::myTopicsTreeList = nullptr
private

Topics elements tree.

Definition at line 120 of file GNEOptionsEditor.h.

◆ myTreeItemTopics

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

map with topics and their associated FXTreeItem

Definition at line 135 of file GNEOptionsEditor.h.

Referenced by updateVisibleEntriesByTopic().


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