From 7bde142766976ad98b3674e863991e3a070fa2f5 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <michael.r.sweet@gmail.com>
Date: Tue, 30 Jul 2002 15:10:32 +0000
Subject: [PATCH] Fl_Input_ and Fl_Text_Display now change the mouse pointer to
 the I beam when the mouse enters them...

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2556 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
---
 CHANGES                 |  3 +++
 src/Fl_Input_.cxx       |  8 ++++++--
 src/Fl_Text_Display.cxx | 14 +++++++++++---
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/CHANGES b/CHANGES
index 6b5d66b2c..9eb4b9f3d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
 CHANGES IN FLTK 1.1.0
 
 	- Documentation updates.
+	- The mouse pointer now changes to the I beam
+	  (FL_CURSOR_INSERT) when moved over an input field or
+	  text widget.
 	- "make install" didn't automatically (re)compile the
 	  FLUID executable.
 	- Added an Fl::get_boxtype() method to get the current
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 04e456258..c27752dc1 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.16 2002/07/29 22:55:33 easysw Exp $"
+// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.17 2002/07/30 15:10:32 easysw Exp $"
 //
 // Common input widget routines for the Fast Light Tool Kit (FLTK).
 //
@@ -653,7 +653,11 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
   switch (event) {
 
   case FL_ENTER:
+    fl_cursor(FL_CURSOR_INSERT);
+    return 1;
+
   case FL_LEAVE:
+    fl_cursor(FL_CURSOR_DEFAULT);
     return 1;
 
   case FL_FOCUS:
@@ -840,5 +844,5 @@ Fl_Input_::~Fl_Input_() {
 }
 
 //
-// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.16 2002/07/29 22:55:33 easysw Exp $".
+// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.17 2002/07/30 15:10:32 easysw Exp $".
 //
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index e1d67fef5..aae33ad68 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1,5 +1,5 @@
 //
-// "$Id: Fl_Text_Display.cxx,v 1.12.2.21 2002/07/10 15:33:52 easysw Exp $"
+// "$Id: Fl_Text_Display.cxx,v 1.12.2.22 2002/07/30 15:10:32 easysw Exp $"
 //
 // Copyright 2001-2002 by Bill Spitzak and others.
 // Original code Copyright Mark Edel.  Permission to distribute under
@@ -1886,11 +1886,19 @@ int Fl_Text_Display::handle(int event) {
   if (!buffer()) return 0;
   // This isn't very elegant!
   if (!Fl::event_inside(text_area.x, text_area.y, text_area.w, text_area.h)
-      && !dragging) {
+      && !dragging && event != FL_LEAVE && event != FL_ENTER) {
     return Fl_Group::handle(event);
   }
 
   switch (event) {
+    case FL_ENTER:
+      fl_cursor(FL_CURSOR_INSERT);
+      return 1;
+
+    case FL_LEAVE:
+      fl_cursor(FL_CURSOR_DEFAULT);
+      return 1;
+
     case FL_PUSH: {
         Fl::focus(this); // Take focus from any child widgets...
         if (Fl::event_state()&FL_SHIFT) return handle(FL_DRAG);
@@ -1954,5 +1962,5 @@ int Fl_Text_Display::handle(int event) {
 
 
 //
-// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.21 2002/07/10 15:33:52 easysw Exp $".
+// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.22 2002/07/30 15:10:32 easysw Exp $".
 //