From c14e5f0aa3203c166fea28c1601f847dcee49e2e Mon Sep 17 00:00:00 2001 From: anders_k Date: Wed, 22 Apr 2020 21:31:38 +0000 Subject: [PATCH] Improved nsDialogs::SelectFileDialog filter string format documentation git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7174 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/nsDialogs/Readme.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Contrib/nsDialogs/Readme.html b/Contrib/nsDialogs/Readme.html index 29f060d2..4a54bfc3 100644 --- a/Contrib/nsDialogs/Readme.html +++ b/Contrib/nsDialogs/Readme.html @@ -458,9 +458,15 @@ SectionEnd

SelectFileDialog

nsDialogs::SelectFileDialog mode initial_selection filter

-

Displays a file selection dialog to the user. If mode is set to save, displays a file save dialog. If mode is set to open, displays a file open dialog. filter is a list of available file filters separated by pipes. If an empty string is passed, the default is used - All Files|*.*.

+

Displays a file selection dialog to the user. If mode is set to save, displays a file save dialog. If mode is set to open, displays a file open dialog.

initial_selection can be used to provide the user with a default file to look for and/or a default folder to look in. If initial_selection is empty no default filename will be provided for the user and the dialog will start in the current working directory. If initial_selection specifies just a filename, for example "test.exe", the dialog will be set up to look for a file called test.exe in the current working directory. If initial_selection specifies just a directory, for example "C:\Program Files", the dialog starts in the provided directory with no file name provided. If initial_selection specifies a directory and a filename, for example "C:\Windows\System32\calc.exe", the dialog will be set up to look for a file called calc.exe in the directory C:\Windows\System32.

+filter is a list of available file filter pairs separated by pipes. A filter pair consists of a display string and a DOS-style wildcard pattern. If an empty string is passed, the default is used ("All Files|*.*").

Returns the selected file on the stack or an empty string if the user canceled the operation.

+
+nsDialogs::SelectFileDialog open "$DOCUMENTS\Config.ini" ".ini files|*.ini|All Files|*.*"
+Pop $0
+StrCmp $0 "" ...
+

SelectFolderDialog

nsDialogs::SelectFolderDialog title initial_selection