diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-07-30 18:10:03 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-07-30 18:10:03 +0000 |
| commit | 1cea00ad00e75262cedd3a96f2e7ac39a7b640c8 (patch) | |
| tree | e06d749c17387f3a1054eaf1b34d348f187ab406 /src/Fl_Input_.cxx | |
| parent | 7bde142766976ad98b3674e863991e3a070fa2f5 (diff) | |
Don't paste if there is no data to paste.
Change the cursor in Fl_File_Input based on the location in the field.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2557 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Input_.cxx')
| -rw-r--r-- | src/Fl_Input_.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index c27752dc1..d270c8b07 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.17 2002/07/30 15:10:32 easysw Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.18 2002/07/30 18:10:03 easysw Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -694,11 +694,15 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) { return 1; case FL_PASTE: { + // Don't allow pastes into readonly widgets... if (readonly()) { fl_beep(FL_BEEP_ERROR); return 1; } + // See if we have anything to paste... + if (!Fl::event_text() || !Fl::event_length()) return 1; + // strip trailing control characters and spaces before pasting: const char* t = Fl::event_text(); const char* e = t+Fl::event_length(); @@ -844,5 +848,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.17 2002/07/30 15:10:32 easysw Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.18 2002/07/30 18:10:03 easysw Exp $". // |
