void CGameListCtrl::OnDropFiles(wxDropFilesEvent& event) { if (event.GetNumberOfFiles() != 1) return; if (File::IsDirectory(WxStrToStr(event.GetFiles()[0]))) return; wxFileName file = event.GetFiles()[0]; if (file.GetExt() == "dtm") { if (Core::IsRunning()) return; if (!Movie::IsReadOnly()) { // let's make the read-only flag consistent at the start of a movie. Movie::SetReadOnly(true); main_frame->GetMenuBar()->FindItem(IDM_RECORDREADONLY)->Check(true); } if (Movie::PlayInput(file.GetFullPath().c_str())) main_frame->BootGame(std::string("")); } else if (!Core::IsRunning()) { main_frame->BootGame(WxStrToStr(file.GetFullPath())); } else { DVDInterface::ChangeDisc(WxStrToStr(file.GetFullPath()).c_str()); } }
void MainFrame::OnDropFile(wxDropFilesEvent &event) { int n = event.GetNumberOfFiles(); wxString* f = event.GetFiles(); // ignore all but last wxGetApp().pending_load = f[event.GetNumberOfFiles() - 1]; }
void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) { // By default, load the first file into the text window. if (event.GetNumberOfFiles() > 0) { LoadFile(event.GetFiles()[0]); } }
//----------------------------------------------------------------------------- void WXGLCanvas::OnDropFiles(wxDropFilesEvent& ev) { std::vector<String> files; for(int i=0; i<ev.GetNumberOfFiles(); ++i) { wxCharBuffer chars = ev.GetFiles()[i].ToUTF8(); String str = String::fromUTF8(chars.data()); files.push_back(str); } dispatchFileDroppedEvent(files); }
void AudacityProject::OnDropFiles(wxDropFilesEvent & event) { int numFiles = event.GetNumberOfFiles(); if (numFiles > 0) { wxString *files = event.GetFiles(); int i; for(i=0; i<numFiles; i++) Import(files[i]); } }
void PicViewCtrl::OnDropFiles(wxDropFilesEvent& event) { //g_LogMessage(_T("Enter PicViewCtrl::OnDropFiles")); if(event.GetNumberOfFiles() != 1) { wxMessageBox(_T("Only can drop one files once!")); return; } wxString* filenames = event.GetFiles(); wxCommandEvent evt(wxEVT_DROP_FILES, wxID_ANY); evt.SetString(filenames[0]); wxPostEvent(m_pFrame, evt); return; }
void VHDDExplorer::OnDropFiles(wxDropFilesEvent& event) { int count = event.GetNumberOfFiles(); wxString* dropped = event.GetFiles(); wxBusyCursor busyCursor; wxWindowDisabler disabler; wxBusyInfo busyInfo("Adding files, wait please..."); for(int i=0; i<count; ++i) { LOG_NOTICE(HLE, "Importing '%s'", dropped[i].wx_str()); Import(fmt::ToUTF8(dropped[i]), fmt::ToUTF8(wxFileName(dropped[i]).GetFullName())); } UpdateList(); }