Committing in .
added some #ifdef __WXDEBUG__ in the proper places around wxLogTrace(TRACE_DND... statements Modified Files: wxWidgets/src/gtk/dnd.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -334,7 +334,9 @@ static gboolean target_drag_drop( GtkWidget *widget,
|
|||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned FALSE") );
|
wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned FALSE") );
|
||||||
|
#endif
|
||||||
|
|
||||||
/* cancel the whole thing */
|
/* cancel the whole thing */
|
||||||
gtk_drag_finish( context,
|
gtk_drag_finish( context,
|
||||||
@@ -344,7 +346,9 @@ static gboolean target_drag_drop( GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned true") );
|
wxLogTrace(TRACE_DND, wxT( "Drop target: OnDrop returned true") );
|
||||||
|
#endif
|
||||||
|
|
||||||
#if wxUSE_THREADS
|
#if wxUSE_THREADS
|
||||||
/* disable GUI threads */
|
/* disable GUI threads */
|
||||||
@@ -412,7 +416,9 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT( "Drop target: data received event") );
|
wxLogTrace(TRACE_DND, wxT( "Drop target: data received event") );
|
||||||
|
#endif
|
||||||
|
|
||||||
/* inform the wxDropTarget about the current GtkSelectionData.
|
/* inform the wxDropTarget about the current GtkSelectionData.
|
||||||
this is only valid for the duration of this call */
|
this is only valid for the duration of this call */
|
||||||
@@ -422,14 +428,18 @@ static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
|
|||||||
|
|
||||||
if ( wxIsDragResultOk( drop_target->OnData( x, y, result ) ) )
|
if ( wxIsDragResultOk( drop_target->OnData( x, y, result ) ) )
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned true") );
|
wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned true") );
|
||||||
|
#endif
|
||||||
|
|
||||||
/* tell GTK that data transfer was successful */
|
/* tell GTK that data transfer was successful */
|
||||||
gtk_drag_finish( context, TRUE, FALSE, time );
|
gtk_drag_finish( context, TRUE, FALSE, time );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned FALSE") );
|
wxLogTrace(TRACE_DND, wxT( "Drop target: OnData returned FALSE") );
|
||||||
|
#endif
|
||||||
|
|
||||||
/* tell GTK that data transfer was not successful */
|
/* tell GTK that data transfer was not successful */
|
||||||
gtk_drag_finish( context, FALSE, FALSE, time );
|
gtk_drag_finish( context, FALSE, FALSE, time );
|
||||||
@@ -601,8 +611,10 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget),
|
|||||||
|
|
||||||
wxDataFormat format( selection_data->target );
|
wxDataFormat format( selection_data->target );
|
||||||
|
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT("Drop source: format requested: %s"),
|
wxLogTrace(TRACE_DND, wxT("Drop source: format requested: %s"),
|
||||||
format.GetId().c_str());
|
format.GetId().c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
drop_source->m_retValue = wxDragCancel;
|
drop_source->m_retValue = wxDragCancel;
|
||||||
|
|
||||||
@@ -610,19 +622,25 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget),
|
|||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT("Drop source: no data object") );
|
wxLogTrace(TRACE_DND, wxT("Drop source: no data object") );
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data->IsSupportedFormat(format))
|
if (!data->IsSupportedFormat(format))
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT("Drop source: unsupported format") );
|
wxLogTrace(TRACE_DND, wxT("Drop source: unsupported format") );
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data->GetDataSize(format) == 0)
|
if (data->GetDataSize(format) == 0)
|
||||||
{
|
{
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT("Drop source: empty data") );
|
wxLogTrace(TRACE_DND, wxT("Drop source: empty data") );
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,7 +879,9 @@ wxDragResult wxDropSource::DoDragDrop(int flags)
|
|||||||
for (size_t i = 0; i < count; i++)
|
for (size_t i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
GdkAtom atom = array[i];
|
GdkAtom atom = array[i];
|
||||||
|
#ifdef __WXDEBUG__
|
||||||
wxLogTrace(TRACE_DND, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom ));
|
wxLogTrace(TRACE_DND, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom ));
|
||||||
|
#endif
|
||||||
gtk_target_list_add( target_list, atom, 0, 0 );
|
gtk_target_list_add( target_list, atom, 0, 0 );
|
||||||
}
|
}
|
||||||
delete[] array;
|
delete[] array;
|
||||||
|
Reference in New Issue
Block a user