mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 22:04:26 +08:00
Make sure cursor switches between I and pointer as needed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2577 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+20
-8
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Fl_Text_Display.cxx,v 1.12.2.24 2002/08/09 03:17:30 easysw Exp $"
|
// "$Id: Fl_Text_Display.cxx,v 1.12.2.25 2002/08/12 20:24:31 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Copyright 2001-2002 by Bill Spitzak and others.
|
// Copyright 2001-2002 by Bill Spitzak and others.
|
||||||
// Original code Copyright Mark Edel. Permission to distribute under
|
// Original code Copyright Mark Edel. Permission to distribute under
|
||||||
@@ -1884,19 +1884,31 @@ void fl_text_drag_me(int pos, Fl_Text_Display* d) {
|
|||||||
int Fl_Text_Display::handle(int event) {
|
int Fl_Text_Display::handle(int event) {
|
||||||
if (!buffer()) return 0;
|
if (!buffer()) return 0;
|
||||||
// This isn't very elegant!
|
// This isn't very elegant!
|
||||||
if (!Fl::event_inside(text_area.x, text_area.y, text_area.w, text_area.h)
|
if (!Fl::event_inside(text_area.x, text_area.y, text_area.w, text_area.h) &&
|
||||||
&& !dragging && event != FL_LEAVE && event != FL_ENTER) {
|
!dragging && event != FL_LEAVE && event != FL_ENTER &&
|
||||||
|
event != FL_MOVE) {
|
||||||
return Fl_Group::handle(event);
|
return Fl_Group::handle(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case FL_ENTER:
|
case FL_ENTER:
|
||||||
if (active_r()) fl_cursor(FL_CURSOR_INSERT);
|
case FL_MOVE:
|
||||||
return 1;
|
if (active_r()) {
|
||||||
|
if (Fl::event_inside(text_area.x, text_area.y, text_area.w, text_area.h)) fl_cursor(FL_CURSOR_INSERT);
|
||||||
|
else fl_cursor(FL_CURSOR_DEFAULT);
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
case FL_LEAVE:
|
case FL_LEAVE:
|
||||||
if (active_r()) fl_cursor(FL_CURSOR_DEFAULT);
|
if (active_r()) {
|
||||||
return 1;
|
fl_cursor(FL_CURSOR_DEFAULT);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
case FL_PUSH: {
|
case FL_PUSH: {
|
||||||
Fl::focus(this); // Take focus from any child widgets...
|
Fl::focus(this); // Take focus from any child widgets...
|
||||||
@@ -1961,5 +1973,5 @@ int Fl_Text_Display::handle(int event) {
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.24 2002/08/09 03:17:30 easysw Exp $".
|
// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.25 2002/08/12 20:24:31 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user