filedata implementation streamlined
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -190,6 +190,8 @@ bool wxDropTarget::GetData()
|
|||||||
UInt16 flavors;
|
UInt16 flavors;
|
||||||
bool firstFileAdded = false;
|
bool firstFileAdded = false;
|
||||||
|
|
||||||
|
wxString filenamesPassed ;
|
||||||
|
|
||||||
CountDragItems( (DragReference)m_currentDrag, &items );
|
CountDragItems( (DragReference)m_currentDrag, &items );
|
||||||
for (UInt16 index = 1; index <= items; ++index)
|
for (UInt16 index = 1; index <= items; ++index)
|
||||||
{
|
{
|
||||||
@@ -261,23 +263,13 @@ bool wxDropTarget::GetData()
|
|||||||
|
|
||||||
case kDragFlavorTypeHFS:
|
case kDragFlavorTypeHFS:
|
||||||
{
|
{
|
||||||
wxFileDataObject *fdo = dynamic_cast<wxFileDataObject*>(m_dataObject);
|
if (theData != NULL)
|
||||||
wxASSERT( fdo != NULL );
|
|
||||||
|
|
||||||
if ((theData != NULL) && (fdo != NULL))
|
|
||||||
{
|
{
|
||||||
HFSFlavor* theFile = (HFSFlavor*) theData;
|
HFSFlavor* theFile = (HFSFlavor*) theData;
|
||||||
wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec );
|
wxString name = wxMacFSSpec2MacFilename( &theFile->fileSpec );
|
||||||
|
|
||||||
if ( !firstFileAdded )
|
|
||||||
{
|
|
||||||
// reset file list
|
|
||||||
fdo->SetData( 0, "" );
|
|
||||||
firstFileAdded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!name.IsEmpty())
|
if (!name.IsEmpty())
|
||||||
fdo->AddFile( name );
|
filenamesPassed += name + wxT("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -293,6 +285,11 @@ bool wxDropTarget::GetData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( filenamesPassed.Len() > 0 )
|
||||||
|
{
|
||||||
|
wxCharBuffer buf = filenamesPassed.fn_str();
|
||||||
|
m_dataObject->SetData( wxDataFormat( wxDF_FILENAME ) , strlen( buf ) , (const char*) buf );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user