From 5f55e1cd63883c8d48a0e212e8910f6dfd536a50 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Thu, 7 Mar 2002 19:22:58 +0000 Subject: Back-ported cut & paste code from fltk2.0. This code splits the cut & paste into two buffers. The "SELECTION" is used for the currently highlighted text and for middle-mouse paste and (if possible) for handling drag & drop. The "CLIPBOARD" is for Ctrl+C and Ctrl+V style cut & paste. This matches how Motif, GTK, and KDE 3.0 work. But many older X applications (including KDE 2) can only see SELECTION, this results in cut & paste incompatability that is familiar to X users. However this now moves fltk over to the majority camp. On all systems this eliminates the annoying inability to select a region and replace it with Ctrl+V. On Mac and Win32 the SELECTION is local to the application, so middle-mouse paste only works between fields in the application. There may be tricks (special clipboard data types? use drag & drop?) to make it communicate, but unless there are standards it would be fltk-only. The file Fl_cutpaste.cxx has been deleted, so update the IDE files! The Win32 and Mac versions have NOT BEEN TESTED! I tried to be careful editing them but they may need some work. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1989 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Editor.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Fl_Text_Editor.cxx') diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index 1324615b4..6e4e78fec 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Editor.cxx,v 1.9.2.4 2002/01/01 15:11:31 easysw Exp $" +// "$Id: Fl_Text_Editor.cxx,v 1.9.2.5 2002/03/07 19:22:56 spitzak Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -344,7 +344,7 @@ int Fl_Text_Editor::kf_delete(int, Fl_Text_Editor* e) { int Fl_Text_Editor::kf_copy(int, Fl_Text_Editor* e) { if (!e->buffer()->selected()) return 1; const char *copy = e->buffer()->selection_text(); - if (*copy) Fl::selection(*e, copy, strlen(copy)); + if (*copy) Fl::copy(copy, strlen(copy), 1); free((void*)copy); e->show_insert_position(); return 1; @@ -358,7 +358,7 @@ int Fl_Text_Editor::kf_cut(int c, Fl_Text_Editor* e) { int Fl_Text_Editor::kf_paste(int, Fl_Text_Editor* e) { kill_selection(e); - Fl::paste(*e); + Fl::paste(*e, 1); e->show_insert_position(); return 1; } @@ -402,7 +402,7 @@ int Fl_Text_Editor::handle(int event) { if (event == FL_PUSH && Fl::event_button() == 2) { dragType = -1; - Fl::paste(*this); + Fl::paste(*this, 0); Fl::focus(this); return 1; } @@ -439,5 +439,5 @@ int Fl_Text_Editor::handle(int event) { } // -// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.4 2002/01/01 15:11:31 easysw Exp $". +// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.5 2002/03/07 19:22:56 spitzak Exp $". // -- cgit v1.2.3