diff --git a/src/app/file_selector.cpp b/src/app/file_selector.cpp index 4ce3c975a..85d2e7014 100644 --- a/src/app/file_selector.cpp +++ b/src/app/file_selector.cpp @@ -55,7 +55,7 @@ std::string show_file_selector(const std::string& title, dlg->addFilter("*." + tok, tok + " files (*." + tok + ")"); dlg->addFilter("*.*", "All files (*.*)"); - if (dlg->show(she::instance()->defaultDisplay()->nativeHandle())) + if (dlg->show(she::instance()->defaultDisplay())) res = dlg->getFileName(); dlg->dispose(); diff --git a/src/she/native_dialogs.h b/src/she/native_dialogs.h index 3cf56a04f..e33121f9c 100644 --- a/src/she/native_dialogs.h +++ b/src/she/native_dialogs.h @@ -8,11 +8,10 @@ #define SHE_NATIVE_DIALOGS_H_INCLUDED #pragma once -#include "she/display_handle.h" - #include namespace she { + class Display; class FileDialog { public: @@ -25,7 +24,7 @@ namespace she { virtual void addFilter(const std::string& extension, const std::string& description) = 0; virtual std::string getFileName() = 0; virtual void setFileName(const std::string& filename) = 0; - virtual bool show(DisplayHandle parent) = 0; + virtual bool show(Display* parent) = 0; }; class NativeDialogs { diff --git a/src/she/win/native_dialogs.cpp b/src/she/win/native_dialogs.cpp index 7599b59b0..68f84d832 100644 --- a/src/she/win/native_dialogs.cpp +++ b/src/she/win/native_dialogs.cpp @@ -12,6 +12,7 @@ #include "base/path.h" #include "base/string.h" +#include "she/display.h" #include "she/error.h" #include @@ -68,13 +69,13 @@ public: m_initialDir = base::from_utf8(base::get_file_path(filename)); } - bool show(DisplayHandle parent) override { + bool show(Display* parent) override { std::wstring filtersWStr = getFiltersForGetOpenFileName(); OPENFILENAME ofn; ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = (HWND)parent; + ofn.hwndOwner = (HWND)parent->nativeHandle(); ofn.hInstance = GetModuleHandle(NULL); ofn.lpstrFilter = filtersWStr.c_str(); ofn.nFilterIndex = m_defFilter;