Merge pull request #665 from andr3wmac/multiformat

Support for large lists of shape formats.
This commit is contained in:
Daniel Buckmaster 2014-07-08 14:14:54 +02:00
commit cf5d48e6ef
10 changed files with 154 additions and 20 deletions

View file

@ -42,3 +42,29 @@ function getLoadFilename(%filespec, %callback, %currentFile)
%dlg.delete();
}
// Opens a choose file dialog with format filters already loaded
// in. This avoids the issue of passing a massive list of format
// filters into a function as an arguement.
function getLoadFormatFilename(%callback, %currentFile)
{
%dlg = new OpenFileDialog()
{
Filters = getFormatFilters() @ "(All Files (*.*)|*.*|";
DefaultFile = %currentFile;
ChangePath = false;
MustExist = true;
MultipleFiles = false;
};
if ( filePath( %currentFile ) !$= "" )
%dlg.DefaultPath = filePath(%currentFile);
if ( %dlg.Execute() )
{
eval(%callback @ "(\"" @ %dlg.FileName @ "\");");
$Tools::FileDialogs::LastFilePath = filePath( %dlg.FileName );
}
%dlg.delete();
}