Merge pull request #920 from starburst997/patch-1
Fix for #919 - Add Filter to FileDialog save (Windows only)
This commit is contained in:
@@ -163,11 +163,12 @@ namespace lime {
|
||||
|
||||
std::wstring* FileDialog::SaveFile (std::wstring* filter, std::wstring* defaultPath) {
|
||||
|
||||
// TODO: Filters
|
||||
|
||||
#ifdef HX_WINDOWS
|
||||
|
||||
const wchar_t* path = tinyfd_saveFileDialogW (L"", defaultPath ? defaultPath->c_str () : 0, 0, NULL, NULL);
|
||||
std::wstring temp (L"*.");
|
||||
const wchar_t* filters[] = {filter ? (temp + *filter).c_str () : NULL};
|
||||
|
||||
const wchar_t* path = tinyfd_saveFileDialogW (L"", defaultPath ? defaultPath->c_str () : 0, filter ? 1 : 0, filter ? filters : NULL, NULL);
|
||||
|
||||
if (path) {
|
||||
|
||||
@@ -178,6 +179,8 @@ namespace lime {
|
||||
|
||||
#else
|
||||
|
||||
// TODO: Filters
|
||||
|
||||
char* _defaultPath = 0;
|
||||
|
||||
if (defaultPath) {
|
||||
@@ -207,4 +210,4 @@ namespace lime {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user