Merge branch 'dvc-multi-format-dnd'
Accept multiple data formats via drag-and-drop in wxDataViewCtrl. See #2478, #2616.
This commit is contained in:
@@ -211,7 +211,7 @@ public:
|
||||
// dnd iface
|
||||
|
||||
bool EnableDragSource( const wxDataFormat &format );
|
||||
bool EnableDropTarget( const wxDataFormat &format );
|
||||
bool EnableDropTarget( const wxVector<wxDataFormat> &formats );
|
||||
|
||||
gboolean row_draggable( GtkTreeDragSource *drag_source, GtkTreePath *path );
|
||||
gboolean drag_data_delete( GtkTreeDragSource *drag_source, GtkTreePath* path );
|
||||
@@ -3794,9 +3794,17 @@ bool wxDataViewCtrlInternal::EnableDragSource( const wxDataFormat &format )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxDataViewCtrlInternal::EnableDropTarget( const wxDataFormat &format )
|
||||
bool wxDataViewCtrlInternal::EnableDropTarget( const wxVector<wxDataFormat>& formats )
|
||||
{
|
||||
wxGtkString atom_str( gdk_atom_name( format ) );
|
||||
if (formats.empty())
|
||||
{
|
||||
gtk_tree_view_unset_rows_drag_dest(GTK_TREE_VIEW(m_owner->GtkGetTreeView()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Use all formats, not just the first one.
|
||||
wxGtkString atom_str( gdk_atom_name( formats[0] ) );
|
||||
m_dropTargetTargetEntryTarget = wxCharBuffer( atom_str );
|
||||
|
||||
m_dropTargetTargetEntry.target = m_dropTargetTargetEntryTarget.data();
|
||||
@@ -4931,10 +4939,10 @@ bool wxDataViewCtrl::EnableDragSource( const wxDataFormat &format )
|
||||
return m_internal->EnableDragSource( format );
|
||||
}
|
||||
|
||||
bool wxDataViewCtrl::EnableDropTarget( const wxDataFormat &format )
|
||||
bool wxDataViewCtrl::DoEnableDropTarget( const wxVector<wxDataFormat>& formats )
|
||||
{
|
||||
wxCHECK_MSG( m_internal, false, "model must be associated before calling EnableDragTarget" );
|
||||
return m_internal->EnableDropTarget( format );
|
||||
return m_internal->EnableDropTarget( formats );
|
||||
}
|
||||
|
||||
bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
|
||||
|
||||
Reference in New Issue
Block a user