projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced /'s with \'s as BCC requires \'s for path names
[wxWidgets.git]
/
src
/
gtk
/
dnd.cpp
diff --git
a/src/gtk/dnd.cpp
b/src/gtk/dnd.cpp
index e9db01eda47c94c2878f03dbb331d1499b7cb153..a95bf1c889202e58aa569d587fc9a8c9d0b41bb1 100644
(file)
--- a/
src/gtk/dnd.cpp
+++ b/
src/gtk/dnd.cpp
@@
-50,6
+50,11
@@
extern void wxapp_uninstall_thread_wakeup();
extern bool g_blockEventsOnDrag;
extern bool g_blockEventsOnDrag;
+// the trace mask we use with wxLogTrace() - call
+// wxLog::AddTraceMask(TRACE_DND) to enable the trace messages from here
+// (there are quite a few of them, so don't enable this by default)
+static const wxChar *TRACE_DND = _T("dnd");
+
//----------------------------------------------------------------------------
// standard icons
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// standard icons
//----------------------------------------------------------------------------
@@
-230,12
+235,12
@@
static gboolean target_drag_drop( GtkWidget *widget,
show a dialog as a reaction to a drop and this
wouldn't work without events */
g_blockEventsOnDrag = FALSE;
show a dialog as a reaction to a drop and this
wouldn't work without events */
g_blockEventsOnDrag = FALSE;
-
+
bool ret = drop_target->OnDrop( x, y );
if (!ret)
{
bool ret = drop_target->OnDrop( x, y );
if (!ret)
{
- wxLog
Debug(
wxT( "Drop target: OnDrop returned FALSE") );
+ wxLog
Trace(TRACE_DND,
wxT( "Drop target: OnDrop returned FALSE") );
/* cancel the whole thing */
gtk_drag_finish( context,
/* cancel the whole thing */
gtk_drag_finish( context,
@@
-245,7
+250,7
@@
static gboolean target_drag_drop( GtkWidget *widget,
}
else
{
}
else
{
- wxLog
Debug(
wxT( "Drop target: OnDrop returned TRUE") );
+ wxLog
Trace(TRACE_DND,
wxT( "Drop target: OnDrop returned TRUE") );
#if wxUSE_THREADS
/* disable GUI threads */
#if wxUSE_THREADS
/* disable GUI threads */
@@
-311,7
+316,7
@@
static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
return;
}
return;
}
- wxLog
Debug(
wxT( "Drop target: data received event") );
+ wxLog
Trace(TRACE_DND,
wxT( "Drop target: data received event") );
/* inform the wxDropTarget about the current GtkSelectionData.
this is only valid for the duration of this call */
/* inform the wxDropTarget about the current GtkSelectionData.
this is only valid for the duration of this call */
@@
-325,14
+330,14
@@
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 ) ) )
{
- wxLog
Debug(
wxT( "Drop target: OnData returned TRUE") );
+ wxLog
Trace(TRACE_DND,
wxT( "Drop target: OnData returned TRUE") );
/* tell GTK that data transfer was successfull */
gtk_drag_finish( context, TRUE, FALSE, time );
}
else
{
/* tell GTK that data transfer was successfull */
gtk_drag_finish( context, TRUE, FALSE, time );
}
else
{
- wxLog
Debug(
wxT( "Drop target: OnData returned FALSE") );
+ wxLog
Trace(TRACE_DND,
wxT( "Drop target: OnData returned FALSE") );
/* tell GTK that data transfer was not successfull */
gtk_drag_finish( context, FALSE, FALSE, time );
/* tell GTK that data transfer was not successfull */
gtk_drag_finish( context, FALSE, FALSE, time );
@@
-406,7
+411,8
@@
GdkAtom wxDropTarget::GetMatchingPair()
wxDataFormat format( formatAtom );
#ifdef __WXDEBUG__
wxDataFormat format( formatAtom );
#ifdef __WXDEBUG__
- wxLogDebug( wxT("Drop target: drag has format: %s"), format.GetId().c_str() );
+ wxLogTrace(TRACE_DND, wxT("Drop target: drag has format: %s"),
+ format.GetId().c_str());
#endif // Debug
if (m_dataObject->IsSupportedFormat( format ))
#endif // Debug
if (m_dataObject->IsSupportedFormat( format ))
@@
-504,7
+510,8
@@
source_drag_data_get (GtkWidget *WXUNUSED(widget),
wxDataFormat format( selection_data->target );
wxDataFormat format( selection_data->target );
- wxLogDebug( wxT("Drop source: format requested: %s"), format.GetId().c_str() );
+ wxLogTrace(TRACE_DND, wxT("Drop source: format requested: %s"),
+ format.GetId().c_str());
drop_source->m_retValue = wxDragCancel;
drop_source->m_retValue = wxDragCancel;
@@
-512,19
+519,19
@@
source_drag_data_get (GtkWidget *WXUNUSED(widget),
if (!data)
{
if (!data)
{
- wxLog
Debug(
wxT("Drop source: no data object") );
+ wxLog
Trace(TRACE_DND,
wxT("Drop source: no data object") );
return;
}
if (!data->IsSupportedFormat(format))
{
return;
}
if (!data->IsSupportedFormat(format))
{
- wxLog
Debug(
wxT("Drop source: unsupported format") );
+ wxLog
Trace(TRACE_DND,
wxT("Drop source: unsupported format") );
return;
}
if (data->GetDataSize(format) == 0)
{
return;
}
if (data->GetDataSize(format) == 0)
{
- wxLog
Debug(
wxT("Drop source: empty data") );
+ wxLog
Trace(TRACE_DND,
wxT("Drop source: empty data") );
return;
}
return;
}
@@
-563,9
+570,9
@@
source_drag_data_get (GtkWidget *WXUNUSED(widget),
// "drag_data_delete"
//----------------------------------------------------------------------------
// "drag_data_delete"
//----------------------------------------------------------------------------
-static void source_drag_data_delete( GtkWidget
*WXUNUSED(widget),
- GdkDragContext
*WXUNUSED(context)
,
- wxDropSource
*WXUNUSED(drop_source) )
+static void source_drag_data_delete( GtkWidget *WXUNUSED(widget),
+ GdkDragContext
*context
,
+ wxDropSource *WXUNUSED(drop_source) )
{
if (g_isIdle)
wxapp_install_idle_handler();
{
if (g_isIdle)
wxapp_install_idle_handler();
@@
-748,7
+755,7
@@
wxDragResult wxDropSource::DoDragDrop( bool allowMove )
// still in drag
if (g_blockEventsOnDrag)
return (wxDragResult) wxDragNone;
// still in drag
if (g_blockEventsOnDrag)
return (wxDragResult) wxDragNone;
-
+
// disabled for now
g_blockEventsOnDrag = TRUE;
// disabled for now
g_blockEventsOnDrag = TRUE;
@@
-763,7
+770,7
@@
wxDragResult wxDropSource::DoDragDrop( bool allowMove )
for (size_t i = 0; i < m_data->GetFormatCount(); i++)
{
GdkAtom atom = array[i];
for (size_t i = 0; i < m_data->GetFormatCount(); i++)
{
GdkAtom atom = array[i];
- wxLog
Debug( wxT("Drop source: Supported atom %s"), gdk_atom_name( atom )
);
+ wxLog
Trace(TRACE_DND, wxT("Drop source: Supported atom %s"), gdk_atom_name( atom )
);
gtk_target_list_add( target_list, atom, 0, 0 );
}
delete[] array;
gtk_target_list_add( target_list, atom, 0, 0 );
}
delete[] array;
@@
-793,11
+800,12
@@
wxDragResult wxDropSource::DoDragDrop( bool allowMove )
/* don't start dragging if no button is down */
if (button_number)
{
/* don't start dragging if no button is down */
if (button_number)
{
- GdkDragAction action = GDK_ACTION_COPY;
- if (allowMove) action = (GdkDragAction)(GDK_ACTION_MOVE|GDK_ACTION_COPY);
+ int action = GDK_ACTION_COPY;
+ if ( allowMove )
+ action |= GDK_ACTION_MOVE;
GdkDragContext *context = gtk_drag_begin( m_widget,
target_list,
GdkDragContext *context = gtk_drag_begin( m_widget,
target_list,
- action,
+
(GdkDragAction)
action,
button_number, /* number of mouse button which started drag */
(GdkEvent*) &event );
button_number, /* number of mouse button which started drag */
(GdkEvent*) &event );