35 GNEFileDialog(applicationWindow, applicationWindow, elementFile, extensions, openMode, configType) {
40 const std::string elementFile,
const std::vector<std::string>& extensions,
56 setWidth(getApp()->reg().readIntEntry(
"GNEFileDialog",
"width", getWidth()));
57 setHeight(getApp()->reg().readIntEntry(
"GNEFileDialog",
"height", getHeight()));
59 myFileSelector->showHiddenFiles((getApp()->reg().readUnsignedEntry(
"GNEFileDialog",
"showhidden",
myFileSelector->showHiddenFiles()) == 1) ? TRUE : FALSE);
72 getApp()->reg().writeIntEntry(
"GNEFileDialog",
"width", getWidth());
73 getApp()->reg().writeIntEntry(
"GNEFileDialog",
"height", getHeight());
74 getApp()->reg().writeUnsignedEntry(
"GNEFileDialog",
"style",
myFileSelector->getFileBoxStyle());
75 getApp()->reg().writeUnsignedEntry(
"GNEFileDialog",
"showhidden",
myFileSelector->showHiddenFiles());
94std::vector<std::string>
96 std::vector<std::string> filenames;
116 for (
const auto& extension : extensions) {
123 if (extensions.size() > 0) {
124 return (filename + extensions.front());
133 const FXString directory =
myFileSelector->getDirectory().c_str();
136 if (directory.length() > 0) {
138 }
else if (filename.length() > 0) {
FXString gCurrentFolder
The folder used as last.
GUIIcon
An enumeration of icons used by the gui applications.
The main window of Netedit.
void setRestoringFocusWindow(FXWindow *window)
wet FXWindows uses for restoring focus
void updateIcon(GUIIcon newIcon)
update icon
void openDialog(FXWindow *focusableElement=nullptr)
open dialog
FXButton * myAcceptButton
accept button
long closeDialogAccepting()
close dialog accepting the changes
OpenType
Open dialog type.
GNEDialog(GNEApplicationWindow *applicationWindow, const std::string &name, GUIIcon titleIcon, DialogType type, Buttons buttons, OpenType openType, ResizeMode resizeMode)
basic constructor
void updateTitle(const std::string &newTitle)
update title
void runInternalTest(const InternalTestStep::DialogArgument *dialogArgument)
run internal test
std::vector< std::string > getFilenames() const
Return empty-string terminated list of selected file names, or NULL if none selected.
std::string getDirectory() const
Return directory.
std::string assureExtension(const std::string &filename) const
check extensions
GNEFileSelector * myFileSelector
the file selector widget
long onCmdAccept(FXObject *, FXSelector, void *)
called when accept or yes button is pressed (can be reimplemented in children)
~GNEFileDialog()
destructor
std::string getFilename() const
Return file name, if any.
GNEFileDialog(GNEApplicationWindow *applicationWindow, const std::string elementFile, const std::vector< std::string > &extensions, GNEFileDialog::OpenMode openMode, GNEFileDialog::ConfigType configType)
constructor
dialog arguments, used for certain modal dialogs that can not be edited using tab
const std::string & getCustomAction() const
get custom action
int getIndex() const
get index
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.