diff options
author | nyamatongwe <unknown> | 2001-03-31 07:42:08 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-03-31 07:42:08 +0000 |
commit | 3abe54bdaa8d455ca610b9805336283e7a19ee4b (patch) | |
tree | a0d7a2688bbfbc31635fee0c9537bc2553f51f5c | |
parent | 3594f43e3ac140197f6c019f6d11158c5d7ea5c5 (diff) | |
download | scintilla-mirror-3abe54bdaa8d455ca610b9805336283e7a19ee4b.tar.gz |
Start of file drag and drop on GTK+.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index f4602a5b7..d68e4932f 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -456,6 +456,7 @@ void ScintillaGTK::Initialise() { { "STRING", 0, TARGET_STRING }, { "TEXT", 0, TARGET_TEXT }, { "COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT }, + { "text/uri-list", 0, 0 }, }; static const gint n_targets = sizeof(targets) / sizeof(targets[0]); @@ -824,11 +825,17 @@ void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) { if (selection_data->type == GDK_TARGET_STRING) { if (selection_data->length > 0) { char *ptr = reinterpret_cast<char *>(selection_data->data); +printf("Text: %s\n", ptr); // 3rd argument is false because the deletion of the moved data is handle by GetSelection bool isRectangular = ((selection_data->length > 1) && (ptr[selection_data->length-1] == 0 && ptr[selection_data->length-2] == '\n')); DropAt(posDrop, ptr, false, isRectangular); } + } else { + char *ptr = reinterpret_cast<char *>(selection_data->data); +printf("Drop: %ld %d\n", selection_data->type, selection_data->length); +printf("URI: %s\n", selection_data->data); + pdoc->InsertString(currentPos, ptr); } Redraw(); } |