}
InvalidateUpdateRect();
- WXLO_DEBUG(("Selection is %s : l%d,%ld/%ld,%ld",
- m_Selection.m_valid ? "valid" : "invalid",
- m_Selection.m_CursorA.x, m_Selection.m_CursorA.y,
- m_Selection.m_CursorB.x, m_Selection.m_CursorB.y));
+#ifdef DEBUG
+ if ( m_Selection.m_valid )
+ {
+ WXLO_DEBUG(("Selection is %s : %ld,%ld/%ld,%ld",
+ m_Selection.m_valid ? "valid" : "invalid",
+ m_Selection.m_CursorA.x, m_Selection.m_CursorA.y,
+ m_Selection.m_CursorB.x, m_Selection.m_CursorB.y));
+ }
+#endif
}
wxLayoutObject *
-#define wxUSE_PRIVATE_CLIPBOARD_FORMAT 0
+#define wxUSE_PRIVATE_CLIPBOARD_FORMAT 1
// ----------------------------------------------------------------------------
// event tables
{
#if wxUSE_PRIVATE_CLIPBOARD_FORMAT
wxLayoutDataObject wxldo;
- if (wxTheClipboard->IsSupported( wxldo.GetFormat() ))
+ if ( wxTheClipboard->GetData(wxldo) )
{
- wxTheClipboard->GetData(wxldo);
- {
- }
//FIXME: missing functionality m_llist->Insert(wxldo.GetList());
+ wxLayoutImportText(m_llist, wxldo.GetLayoutData());
+ SetDirty();
}
else
#endif
m_llist->EndSelection();
}
- wxLayoutDataObject wldo;
- wxLayoutList *llist = m_llist->GetSelection(&wldo, invalidate);
+#if wxUSE_PRIVATE_CLIPBOARD_FORMAT
+ // the data object which holds all different data objects, one for each
+ // format we support
+ wxDataObjectComposite *data = new wxDataObjectComposite;
+#endif
+
+ wxLayoutDataObject *wldo = new wxLayoutDataObject;
+ wxLayoutList *llist = m_llist->GetSelection(wldo, invalidate);
if(! llist)
return FALSE;
// Export selection as text:
text = text.Mid(0,len-1);
}
- if (wxTheClipboard->Open())
- {
- wxTextDataObject *data = new wxTextDataObject( text );
- bool rc = wxTheClipboard->SetData( data );
+ if (!wxTheClipboard->Open())
+ return FALSE;
+
#if wxUSE_PRIVATE_CLIPBOARD_FORMAT
- rc |= wxTheClipboard->AddData( &wldo );
+ data->Add(wldo, TRUE /* preferred */);
+ data->Add(new wxTextDataObject(text));
+#else
+ wxTextDataObject *data = new wxTextDataObject( text );
#endif
- wxTheClipboard->Close();
- return rc;
- }
-
- return FALSE;
+
+ bool rc = wxTheClipboard->SetData( data );
+
+ wxTheClipboard->Close();
+ return rc;
}
bool
//-----------------------------------------------------------------------------
static void
-selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data, gpointer WXUNUSED(data) )
+selection_handler( GtkWidget *WXUNUSED(widget),
+ GtkSelectionData *selection_data,
+ guint WXUNUSED(info),
+ guint WXUNUSED(time),
+ gpointer WXUNUSED(data) )
{
if (!wxTheClipboard) return;
//-----------------------------------------------------------------------------
static void
-selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data, gpointer WXUNUSED(data) )
+selection_handler( GtkWidget *WXUNUSED(widget),
+ GtkSelectionData *selection_data,
+ guint WXUNUSED(info),
+ guint WXUNUSED(time),
+ gpointer WXUNUSED(data) )
{
if (!wxTheClipboard) return;