本文整理汇总了C++中wxDropFilesEvent类的典型用法代码示例。如果您正苦于以下问题:C++ wxDropFilesEvent类的具体用法?C++ wxDropFilesEvent怎么用?C++ wxDropFilesEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxDropFilesEvent类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDropFile
void MainFrame::OnDropFile(wxDropFilesEvent &event)
{
int n = event.GetNumberOfFiles();
wxString* f = event.GetFiles();
// ignore all but last
wxGetApp().pending_load = f[event.GetNumberOfFiles() - 1];
}
示例2: OnDropFiles
void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)
{
// By default, load the first file into the text window.
if (event.GetNumberOfFiles() > 0)
{
LoadFile(event.GetFiles()[0]);
}
}
示例3: OnDropFiles
//-----------------------------------------------------------------------------
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);
}
示例4: OnDropFiles
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]);
}
}
示例5: OnDropFiles
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;
}
示例6: OnDropFiles
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();
}