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 --- FL/Fl.H | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'FL/Fl.H') diff --git a/FL/Fl.H b/FL/Fl.H index e387af6ed..51146a871 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -1,5 +1,5 @@ // -// "$Id: Fl.H,v 1.8.2.11.2.13 2002/01/09 21:50:02 easysw Exp $" +// "$Id: Fl.H,v 1.8.2.11.2.14 2002/03/07 19:22:55 spitzak Exp $" // // Main header file for the Fast Light Tool Kit (FLTK). // @@ -169,11 +169,14 @@ public: static FL_EXPORT void add_handler(int (*h)(int)); // cut/paste: + static FL_EXPORT void copy(const char* stuff, int len, int clipboard = 0); + static FL_EXPORT void paste(Fl_Widget &receiver, int clipboard /*=0*/); + static FL_EXPORT int dnd(); + // These are for back-compatability only: static FL_EXPORT Fl_Widget* selection_owner() {return selection_owner_;} static FL_EXPORT void selection_owner(Fl_Widget*); - static FL_EXPORT void selection(Fl_Widget &owner, const char* stuff, int len); + static FL_EXPORT void selection(Fl_Widget &owner, const char*, int len); static FL_EXPORT void paste(Fl_Widget &receiver); - static FL_EXPORT int dnd(); // screen size: #if defined(WIN32) || defined(__APPLE__) @@ -244,5 +247,5 @@ public: #endif // !Fl_H // -// End of "$Id: Fl.H,v 1.8.2.11.2.13 2002/01/09 21:50:02 easysw Exp $". +// End of "$Id: Fl.H,v 1.8.2.11.2.14 2002/03/07 19:22:55 spitzak Exp $". // -- cgit v1.2.3