コード例 #1
0
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());
	}
}
コード例 #2
0
ファイル: wxvbam.cpp プロジェクト: MrSwiss/visualboyadvance-m
void MainFrame::OnDropFile(wxDropFilesEvent &event)
{
	int n = event.GetNumberOfFiles();
	wxString* f = event.GetFiles();
	// ignore all but last
	wxGetApp().pending_load = f[event.GetNumberOfFiles() - 1];
}
コード例 #3
0
ファイル: textctrl.cpp プロジェクト: czxxjtu/wxPython-1
void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)
{
    // By default, load the first file into the text window.
    if (event.GetNumberOfFiles() > 0)
    {
        LoadFile(event.GetFiles()[0]);
    }
}
コード例 #4
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);
}
コード例 #5
0
ファイル: Project.cpp プロジェクト: tuanmasterit/audacity
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]);
   }
}
コード例 #6
0
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;
}
コード例 #7
0
ファイル: VHDDManager.cpp プロジェクト: Aishou/rpcs3
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();
}