From a5110a375d35d7212bcf37102b4e63c3865b0940 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 29 Jul 2002 22:55:33 +0000 Subject: Don't allow paste inside readonly() input widgets. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2552 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Input_.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 498996fc9..04e456258 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.15 2002/07/23 16:28:19 easysw Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.16 2002/07/29 22:55:33 easysw Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -690,6 +690,11 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { return 1; case FL_PASTE: { + if (readonly()) { + fl_beep(FL_BEEP_ERROR); + return 1; + } + // strip trailing control characters and spaces before pasting: const char* t = Fl::event_text(); const char* e = t+Fl::event_length(); @@ -835,5 +840,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.15 2002/07/23 16:28:19 easysw Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.16 2002/07/29 22:55:33 easysw Exp $". // -- cgit v1.2.3