if (!ret)
{
- wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") );
+ wxLogDebug( wxT( "Drop target: OnDrop returned FALSE") );
/* cancel the whole thing */
gtk_drag_finish( context,
if (!m_dataObject->IsSupportedFormat( dragFormat ))
return FALSE;
- if (dragFormat.GetType() == wxDF_TEXT)
- {
- wxTextDataObject *text_object = (wxTextDataObject*)m_dataObject;
- text_object->SetText( (const char*)m_dragData->data );
- return TRUE;
- }
-
- if (dragFormat.GetType() == wxDF_FILENAME)
- {
- wxFileDataObject *file_object = (wxFileDataObject*)m_dataObject;
- file_object->SetData( 0, (const char*)m_dragData->data );
- return TRUE;
- }
-
m_dataObject->SetData( dragFormat, (size_t)m_dragData->length, (const void*)m_dragData->data );
return TRUE;
wxDragResult wxDropSource::DoDragDrop( bool allowMove )
{
- wxASSERT_MSG( m_data, wxT("wxDragSource: no data") );
+ wxASSERT_MSG( m_data, wxT("Drop source: no data") );
if (!m_data)
return (wxDragResult) wxDragNone;
for (size_t i = 0; i < m_data->GetFormatCount(); i++)
{
GdkAtom atom = array[i];
- wxLogDebug( wxT("Supported atom %s"), gdk_atom_name( atom ) );
+ wxLogDebug( wxT("Drop source: Supported atom %s"), gdk_atom_name( atom ) );
gtk_target_list_add( target_list, atom, 0, 0 );
}
delete[] array;
PrepareIcon( 0, 0, context );
while (m_waiting) gtk_main_iteration();;
+
+ if (context->action == GDK_ACTION_COPY)
+ return m_retValue = wxDragCopy;
+ if (context->action == GDK_ACTION_MOVE)
+ return m_retValue = wxDragMove;
}
#if wxUSE_THREADS