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 "model/SRAMFile.hh"
00036 #include "view/Frame.hh"
00037 #include "view/SRAMFileTarget.hh"
00038
00039 using namespace smse;
00040
00041 bool SRAMFileTarget::OnDropFiles(wxCoord, wxCoord, const wxArrayString &files) {
00042 if (files.GetCount() > 0) {
00043
00044 if (frame->sram && frame->sram->isModified()) {
00045 int answer = wxMessageBox(wxT("Save current SRAM?"),
00046 wxT("Warning: Unsaved SRAM file"),
00047 wxYES_NO | wxCANCEL | wxICON_QUESTION);
00048
00049 if (answer == wxYES) {
00050 if (!frame->save()) {
00051 return false;
00052 }
00053 } else if (answer == wxCANCEL) {
00054 return false;
00055 }
00056 }
00057
00058
00059 frame->open(files[0]);
00060 }
00061
00062 return true;
00063 }
00064