Unfinished code for wxDragCopy vs. wxDragMove,
Corrected key accel code for wxFrame as children of wxFrame.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4139
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
wxSimpleDataObjectList::Node *node = m_dataObjects.Item( m_preferred );
{
wxSimpleDataObjectList::Node *node = m_dataObjects.Item( m_preferred );
+#ifdef __WXGTK__
+ wxCHECK_MSG( node, wxDataFormat(wxDF_INVALID), wxT("no preferred format") );
+#else
wxCHECK_MSG( node, wxDataFormat((unsigned short) wxDF_INVALID), wxT("no preferred format") );
wxCHECK_MSG( node, wxDataFormat((unsigned short) wxDF_INVALID), wxT("no preferred format") );
wxDataObjectSimple* dataObj = node->GetData();
wxDataObjectSimple* dataObj = node->GetData();
this is only valid for the duration of this call */
drop_target->SetDragContext( context );
this is only valid for the duration of this call */
drop_target->SetDragContext( context );
- /* TODO: what should be the default behaviour? Copy or move? */
wxDragResult result = wxDragMove;
wxDragResult result = wxDragMove;
+ if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
if (drop_target->m_firstMotion)
{
if (drop_target->m_firstMotion)
{
result = drop_target->OnDragOver( x, y, result );
}
result = drop_target->OnDragOver( x, y, result );
}
- /* we don't yet handle which "actions" (i.e. copy or move)
- the target accepts. so far we simply accept the
- suggested action. TODO. */
bool ret = result != wxDragNone;
if (ret)
bool ret = result != wxDragNone;
if (ret)
+ {
+ GdkDragAction action = GDK_ACTION_MOVE;
+ if (result == wxDragCopy) action == GDK_ACTION_COPY;
gdk_drag_status( context, context->suggested_action, time );
gdk_drag_status( context, context->suggested_action, time );
/* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL );
/* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL );
this is only valid for the duration of this call */
drop_target->SetDragTime( time );
this is only valid for the duration of this call */
drop_target->SetDragTime( time );
+/*
+ wxDragResult result = wxDragMove;
+ if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
+*/
+
bool ret = drop_target->OnDrop( x, y );
if (!ret)
bool ret = drop_target->OnDrop( x, y );
if (!ret)
GdkAtom format = drop_target->GetMatchingPair();
wxASSERT( format );
GdkAtom format = drop_target->GetMatchingPair();
wxASSERT( format );
+/*
+ GdkDragAction action = GDK_ACTION_MOVE;
+ if (result == wxDragCopy) action == GDK_ACTION_COPY;
+ context->action = action;
+*/
/* this should trigger an "drag_data_received" event */
gtk_drag_get_data( widget,
context,
/* this should trigger an "drag_data_received" event */
gtk_drag_get_data( widget,
context,
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent()) top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native hot keys */
gtk_accel_group_detach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native hot keys */
gtk_accel_group_detach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent())
- top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native hot keys */
gtk_accel_group_attach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native hot keys */
gtk_accel_group_attach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent())
- top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_attach( m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_attach( m_accel, GTK_OBJECT(top_frame->m_widget) );
m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent())
- top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_detach( m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_detach( m_accel, GTK_OBJECT(top_frame->m_widget) );
this is only valid for the duration of this call */
drop_target->SetDragContext( context );
this is only valid for the duration of this call */
drop_target->SetDragContext( context );
- /* TODO: what should be the default behaviour? Copy or move? */
wxDragResult result = wxDragMove;
wxDragResult result = wxDragMove;
+ if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
if (drop_target->m_firstMotion)
{
if (drop_target->m_firstMotion)
{
result = drop_target->OnDragOver( x, y, result );
}
result = drop_target->OnDragOver( x, y, result );
}
- /* we don't yet handle which "actions" (i.e. copy or move)
- the target accepts. so far we simply accept the
- suggested action. TODO. */
bool ret = result != wxDragNone;
if (ret)
bool ret = result != wxDragNone;
if (ret)
+ {
+ GdkDragAction action = GDK_ACTION_MOVE;
+ if (result == wxDragCopy) action == GDK_ACTION_COPY;
gdk_drag_status( context, context->suggested_action, time );
gdk_drag_status( context, context->suggested_action, time );
/* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL );
/* after this, invalidate the drop_target's GdkDragContext */
drop_target->SetDragContext( (GdkDragContext*) NULL );
this is only valid for the duration of this call */
drop_target->SetDragTime( time );
this is only valid for the duration of this call */
drop_target->SetDragTime( time );
+/*
+ wxDragResult result = wxDragMove;
+ if (context->suggested_action == GDK_ACTION_COPY) result = wxDragCopy;
+*/
+
bool ret = drop_target->OnDrop( x, y );
if (!ret)
bool ret = drop_target->OnDrop( x, y );
if (!ret)
GdkAtom format = drop_target->GetMatchingPair();
wxASSERT( format );
GdkAtom format = drop_target->GetMatchingPair();
wxASSERT( format );
+/*
+ GdkDragAction action = GDK_ACTION_MOVE;
+ if (result == wxDragCopy) action == GDK_ACTION_COPY;
+ context->action = action;
+*/
/* this should trigger an "drag_data_received" event */
gtk_drag_get_data( widget,
context,
/* this should trigger an "drag_data_received" event */
gtk_drag_get_data( widget,
context,
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent()) top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native hot keys */
gtk_accel_group_detach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native hot keys */
gtk_accel_group_detach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
#if (GTK_MINOR_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent())
- top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native hot keys */
gtk_accel_group_attach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native hot keys */
gtk_accel_group_attach( menu->m_accel, GTK_OBJECT(top_frame->m_widget) );
m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
m_invokingWindow = win;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent())
- top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_attach( m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_attach( m_accel, GTK_OBJECT(top_frame->m_widget) );
m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
m_invokingWindow = (wxWindow*) NULL;
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
wxWindow *top_frame = win;
- while (top_frame->GetParent())
- top_frame = top_frame->GetParent();
+ while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
+ top_frame = top_frame->GetParent();
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_detach( m_accel, GTK_OBJECT(top_frame->m_widget) );
/* support for native key accelerators indicated by underscroes */
gtk_accel_group_detach( m_accel, GTK_OBJECT(top_frame->m_widget) );