summaryrefslogtreecommitdiff
path: root/src/Fl_Input_.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-12-12 08:57:30 +0000
committerBill Spitzak <spitzak@gmail.com>2000-12-12 08:57:30 +0000
commitf5375b6ab64edbe5e5b017b053fb1385613ceef9 (patch)
tree2d8ba8726b5a04e93cd7c08c3b2651c8ab976c36 /src/Fl_Input_.cxx
parent0d0b0662300a6ca9f339ec6bdbdf555dec7f26a8 (diff)
Fl_Gl_Window does not set drawbuffer(BACKBUFFER) for single-buffered
windows. Fl_Input::replace(...) correctly updates the display if the replaced region does not include the mark, point, or selected region. Added Fl::add_check(...), Fl::remove_check, and Fl::has_check. These are similar to idle callbacks but are only called just before it waits for new events. They can be used to watch for changes in global state and respond to them. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1347 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Input_.cxx')
-rw-r--r--src/Fl_Input_.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index ba932cf7e..7f4d40f13 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input_.cxx,v 1.21.2.9 2000/09/19 07:21:19 spitzak Exp $"
+// "$Id: Fl_Input_.cxx,v 1.21.2.10 2000/12/12 08:57:30 spitzak Exp $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
@@ -586,7 +586,7 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
size_ += ilen;
}
undowidget = this;
- mark_ = position_ = undoat = b+ilen;
+ undoat = b+ilen;
#ifdef WORDWRAP
// Insertions into the word at the end of the line will cause it to
@@ -597,8 +597,15 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
if (type() == FL_MULTILINE_INPUT)
while (b > 0 && !isspace(index(b))) b--;
#endif
-
+
+ // make sure we redraw the old selection or cursor:
+ if (mark_ < b) b = mark_;
+ if (position_ < b) b = position_;
+
minimal_update(b);
+
+ mark_ = position_ = undoat;
+
if (when()&FL_WHEN_CHANGED) do_callback(); else set_changed();
return 1;
}
@@ -810,5 +817,5 @@ Fl_Input_::~Fl_Input_() {
}
//
-// End of "$Id: Fl_Input_.cxx,v 1.21.2.9 2000/09/19 07:21:19 spitzak Exp $".
+// End of "$Id: Fl_Input_.cxx,v 1.21.2.10 2000/12/12 08:57:30 spitzak Exp $".
//