Added NSApplicationDelegate's openFiles for wxOSX-Cocoa.
openFiles (available since OS X 10.3) replaces using the openFile method. It allows for more convenient handling of multiple drops and knowing in advance how much files/folders are dropped instead of openFile with which you only get to respond to a single file/folder drop at a time. By default openFiles calls the newly added MacOpenFiles which calls MacOpenFile multiple times, so ordinarily the behaviour is backwards compatible (both on wxOSX Cocoa and Carbon). The openFile instance method has been removed because it doesn't seem to be called anymore: neither when dropping a single file on the application in the dock or Finder nor when passed as a command-line argument. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -143,7 +143,7 @@ class wxMediaPlayerApp : public wxApp
|
||||
{
|
||||
public:
|
||||
#ifdef __WXMAC__
|
||||
virtual void MacOpenFile(const wxString & fileName );
|
||||
virtual void MacOpenFiles(const wxArrayString & fileNames );
|
||||
#endif
|
||||
|
||||
virtual bool OnInit();
|
||||
@@ -463,10 +463,10 @@ bool wxMediaPlayerApp::OnInit()
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
||||
void wxMediaPlayerApp::MacOpenFile(const wxString & fileName )
|
||||
void wxMediaPlayerApp::MacOpenFiles(const wxArrayString & fileNames )
|
||||
{
|
||||
// Called when a user drags a file over our app
|
||||
m_frame->DoOpenFile(fileName, true /* new page */);
|
||||
// Called when a user drags files over our app
|
||||
m_frame->DoOpenFile(fileNames[0], true /* new page */);
|
||||
}
|
||||
|
||||
#endif // __WXMAC__
|
||||
|
Reference in New Issue
Block a user