Allow loading save states via drag and drop.

This commit is contained in:
Rachel Bryk 2013-09-27 08:38:12 -04:00
parent 9a2c7df8dc
commit cbd366236a
2 changed files with 15 additions and 0 deletions

View File

@ -108,6 +108,19 @@ CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title
wxIcon IconTemp;
IconTemp.CopyFromBitmap(wxGetBitmapFromMemory(Dolphin_png));
SetIcon(IconTemp);
DragAcceptFiles(true);
Connect(wxEVT_DROP_FILES, wxDropFilesEventHandler(CRenderFrame::OnDropFiles), NULL, this);
}
void CRenderFrame::OnDropFiles(wxDropFilesEvent& event)
{
if (event.GetNumberOfFiles() != 1)
return;
if (File::IsDirectory(event.GetFiles()[0].ToStdString()))
return;
State::LoadAs(event.GetFiles()[0].ToStdString());
}
#ifdef _WIN32

View File

@ -74,10 +74,12 @@ class CRenderFrame : public wxFrame
long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
private:
void OnDropFiles(wxDropFilesEvent& event);
#ifdef _WIN32
// Receive WndProc messages
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
#endif
};
class CFrame : public CRenderFrame