+ /*
+ Let the file dialog know what file type should be used initially.
+ If this is not done then when setting the filter index
+ programmatically to 1 the file will still have the extension
+ of the first file type instead of the second one. E.g. when file
+ types are foo and bar, a filename "myletter" with SetDialogIndex(1)
+ would result in saving as myletter.foo, while we want myletter.bar.
+ */
+ if(m_firstFileTypeFilter > 0)
+ {
+ DoOnFilterSelected(m_firstFileTypeFilter);
+ }
+
+ returnCode = [sPanel runModalForDirectory: m_dir.IsEmpty() ? nil : dir.AsNSString() file:file.AsNSString() ];