From 4f15037e8ea8e32abe01e764f97edfb9341534a7 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 8 Nov 2002 15:57:10 +0000 Subject: Tab moves forward in menu, Shift-Tab moves backward. CTRL-V no longer segfaults Fl_Text_Editor when the clipboard is empty. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2830 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Editor.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Fl_Text_Editor.cxx') diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index eda8a0adb..45addf089 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.12 2002/11/05 19:53:50 matthiaswm Exp $" +// "$Id: Fl_Text_Editor.cxx,v 1.9.2.13 2002/11/08 15:57:10 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -29,6 +29,7 @@ #include #include #include +#include Fl_Text_Editor::Fl_Text_Editor(int X, int Y, int W, int H, const char* l) @@ -458,6 +459,10 @@ int Fl_Text_Editor::handle(int event) { return handle_key(); case FL_PASTE: + if (!Fl::event_text()) { + fl_beep(); + return 1; + } buffer()->remove_selection(); if (insert_mode()) insert(Fl::event_text()); else overstrike(Fl::event_text()); @@ -477,5 +482,5 @@ int Fl_Text_Editor::handle(int event) { } // -// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.12 2002/11/05 19:53:50 matthiaswm Exp $". +// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.13 2002/11/08 15:57:10 easysw Exp $". // -- cgit v1.2.3