Fix for #919 - Add Filter to FileDialog save (Windows only)

This commit is contained in:
Jean-Denis Boivin
2017-02-11 15:57:35 -05:00
committed by GitHub
parent 95a3a75fd4
commit ece483048c

View File

@@ -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 {
}
}
}