Allow loading save states via drag and drop.
This commit is contained in:
parent
9a2c7df8dc
commit
cbd366236a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue