Browse Source

Updated the documentation to include a MacOS caveat to the FileChooser

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
43cff0ce48
2 changed files with 12 additions and 5 deletions
  1. +6
    -5
      modules/juce_gui_basics/filebrowser/juce_FileChooser.h
  2. +6
    -0
      modules/juce_gui_basics/native/juce_mac_FileChooser.mm

+ 6
- 5
modules/juce_gui_basics/filebrowser/juce_FileChooser.h View File

@@ -87,11 +87,12 @@ public:
file. If you create such a temporary file, you need
to delete it yourself, once it is not needed anymore.
@param filePatternsAllowed a set of file patterns to specify which files
can be selected - each pattern should be
separated by a comma or semi-colon, e.g. "*" or
"*.jpg;*.gif". An empty string means that all
files are allowed
@param filePatternsAllowed a set of file patterns to specify which files can be
selected - each pattern should be separated by a comma or
semi-colon, e.g. "*" or "*.jpg;*.gif". The native MacOS
file browser only supports wildcard that specify
extensions, so "*.jpg" is OK but "myfilename*" will not
work. An empty string means that all files are allowed
@param useOSNativeDialogBox if true, then a native dialog box will be used
if possible; if false, then a Juce-based
browser dialog box will always be used


+ 6
- 0
modules/juce_gui_basics/native/juce_mac_FileChooser.mm View File

@@ -37,6 +37,12 @@ static NSMutableArray* createAllowedTypesArray (const StringArray& filters)
for (int i = 0; i < filters.size(); ++i)
{
#if defined (MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
// From OS X 10.6 you can only specify allowed extensions, so any filters containing wildcards
// must be of the form "*.extension"
jassert (filters[i].indexOf ("*") <= 0);
#endif
const String f (filters[i].replace ("*.", ""));
if (f == "*")


Loading…
Cancel
Save