mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Change she::FileDialog::show() argument from DisplayHandle to Display
This is because we could make use of Display member functions inside the FileDialog::show() implementation.
This commit is contained in:
parent
2a5c93e333
commit
7826e38382
@ -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();
|
||||
|
@ -8,11 +8,10 @@
|
||||
#define SHE_NATIVE_DIALOGS_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "she/display_handle.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
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 {
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "base/path.h"
|
||||
#include "base/string.h"
|
||||
#include "she/display.h"
|
||||
#include "she/error.h"
|
||||
|
||||
#include <windows.h>
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user