00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifdef HAVE_CONFIG_H
00026 #include <config.h>
00027 #endif
00028
00029 #include <wx/wxprec.h>
00030
00031 #ifndef WX_PRECOMP
00032 #include <wx/wx.h>
00033 #endif
00034
00035 #include "view/FileDropTarget.hh"
00036 #include "view/MainFrame.hh"
00037
00038 using namespace emuWorks;
00039
00040 bool FileDropTarget::OnDropFiles(wxCoord, wxCoord, const wxArrayString &files) {
00041 int size = files.GetCount();
00042
00043 if (size > 0) {
00044 wxString filename = files[0];
00045
00046 wxString ext = filename.Mid(filename.Length() - 4);
00047
00048 if (ext.CmpNoCase(wxT(".sav")) != 0) {
00049 wxMessageBox(wxT("Only NES SRAM (*.sav) files can be dropped."),
00050 wxT("Error: Invalid File Drop"),
00051 wxICON_ERROR | wxOK);
00052
00053 return false;
00054 }
00055
00056 owner->load(filename);
00057 }
00058
00059 return true;
00060 }
00061