diff options
| author | Bill Spitzak <spitzak@gmail.com> | 1999-10-30 20:21:30 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 1999-10-30 20:21:30 +0000 |
| commit | c3bd173a570d04961ffc1ccda39ea4a64846e030 (patch) | |
| tree | a67dc078e94f17d43d53634450162cfc02786a8e /src/Fl_Input_.cxx | |
| parent | 936b75f917739fcff4fb8c74673ec3d6c94df29e (diff) | |
More fixes to the text editing to make the NT users happy.
With all the recent check-ins, the result is that text editing is a
combination of the best parts of "CUA" and X/Motif text editing
(in my opinion). It mostly acts like CUA with these additions:
1. Clicking in a field the first time selects the entire field (this is a
necessary modification so that it works in point-to-type window managers
and still looks like Windoze, in Windoze it appears that all text fields
are switched to all-selected when the window is "activated").
2. The middle mouse button acts like the left one and *then* does "paste".
Unlike Motif you can replace text by selecting it with the middle mouse button.
3. *drag* of the left mouse button does "copy". Unlike Motif, other methods
of selecting text (like double-click) does not do "copy".
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@807 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Input_.cxx')
| -rw-r--r-- | src/Fl_Input_.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 28c551039..6791b4b36 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.21.2.1 1999/10/15 09:01:44 bill Exp $" +// "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -352,7 +352,7 @@ void Fl_Input_::handle_mouse(int X, int Y, p = e; if (e >= value_+size_) break; } - const char *l, *r, *t; double f0 = 0; + const char *l, *r, *t; double f0 = Fl::event_x()-X+xscroll_; for (l = p, r = e; l<r; ) { double f; t = l+(r-l+1)/2; @@ -387,6 +387,14 @@ void Fl_Input_::handle_mouse(int X, int Y, while (!wordboundary(newpos)) newpos--; } } + // if the multiple click does not increase the selection, revert + // to single-click behavior: + if (!drag && (mark() > position() ? + (newmark >= position() && newpos <= mark()) : + (newmark >= mark() && newpos <= position()))) { + Fl::event_clicks(0); + newmark = newpos = l-value(); + } } position(newpos, newmark); } @@ -737,5 +745,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.21.2.1 1999/10/15 09:01:44 bill Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $". // |
