New wxDataObject, DnD and Clipboard code

A few more minor fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-12-14 16:13:49 +00:00
parent 450cab2dff
commit 8b53e5a226
21 changed files with 1347 additions and 666 deletions

View File

@@ -632,15 +632,43 @@ shape_motion (GtkWidget *widget,
void gtk_drag_callback( GtkWidget *widget, GdkEvent *event, wxDropSource *source )
{
wxDataObject *data = source->m_data;
size_t size = data->GetDataSize();
char *ptr = new char[size];
data->GetDataHere( ptr );
gtk_widget_dnd_data_set( widget, event, ptr, size );
delete ptr;
wxDataObject *data = source->m_data;
switch (data->GetFormat())
{
case wxDF_TEXT:
{
wxTextDataObject *text_object = (wxTextDataObject*) data;
wxString text = text_object->GetText();
gtk_widget_dnd_data_set( widget,
event,
(unsigned char*) text.c_str,
(int) text.Length() );
break;
}
case wxDF_FILENAME:
{
wxFileDataObject *file_object = (wxFileDataObject*) data;
wxString text = file_object->GetFiles();
gtk_widget_dnd_data_set( widget,
event,
(unsigned char*) text.c_str,
(int) text.Length() );
break;
}
default:
{
return;
}
}
source->m_retValue = wxDragCopy;
}
@@ -695,7 +723,6 @@ wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
wxASSERT_MSG( m_data, "wxDragSource: no data" );
if (!m_data) return (wxDragResult) wxDragNone;
if (m_data->GetDataSize() == 0) return (wxDragResult) wxDragNone;
static GtkWidget *drag_icon = NULL;
static GtkWidget *drop_icon = NULL;
@@ -801,7 +828,7 @@ void wxDropSource::RegisterWindow(void)
wxString formats;
wxDataFormat df = m_data->GetPreferredFormat();
wxDataFormat df = m_data->GetFormat();
switch (df)
{