X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b02da6b18713d069cc9f4077f9b43df7a11bc7fb..ce52ac88bc9e689db478bbe86c3559ad1edc5959:/src/gtk/dnd.cpp?ds=sidebyside diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index b0f7ef082f..25b6eb46f6 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -230,7 +230,7 @@ static gboolean target_drag_drop( GtkWidget *widget, if (!ret) { - wxLogDebug( wxT( "Drop target: OnDrop returned TRUE") ); + wxLogDebug( wxT( "Drop target: OnDrop returned FALSE") ); /* cancel the whole thing */ gtk_drag_finish( context, @@ -426,20 +426,6 @@ bool wxDropTarget::GetData() 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; @@ -713,7 +699,7 @@ void wxDropSource::PrepareIcon( int hot_x, int hot_y, GdkDragContext *context ) 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; @@ -734,7 +720,7 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove ) 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; @@ -777,6 +763,11 @@ wxDragResult wxDropSource::DoDragDrop( bool allowMove ) 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