Fix cursor appearance and scrolling of Fl_Text_Editor (patches from Erco)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2964 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2003-04-01 20:14:16 +00:00
parent cd339710f0
commit f5dd08a9b3
2 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,9 @@
CHANGES IN FLTK 1.1.4
- Fl_Text_Editor didn't scroll the buffer when the user
pressed Ctrl+End or Ctrl+Home.
- Fl_Text_Editor didn't show its cursor when the mouse
was moved inside the window.
- FLUID now uses an Fl_Text_Display widget for command
output, which allows you to copy and paste text from
command output into other windows.

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.14 2003/01/30 21:42:50 easysw Exp $"
// "$Id: Fl_Text_Editor.cxx,v 1.9.2.15 2003/04/01 20:14:16 easysw Exp $"
//
// Copyright 2001-2003 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
@ -266,9 +266,11 @@ int Fl_Text_Editor::kf_ctrl_move(int c, Fl_Text_Editor* e) {
switch (c) {
case FL_Home:
e->insert_position(0);
e->scroll(0, 0);
break;
case FL_End:
e->insert_position(e->buffer()->length());
e->scroll(e->count_lines(0, e->buffer()->length(), 1), 0);
break;
case FL_Left:
e->previous_word();
@ -470,17 +472,16 @@ int Fl_Text_Editor::handle(int event) {
if (when()&FL_WHEN_CHANGED) do_callback(); else set_changed();
return 1;
// CET - FIXME - this will clobber the window's current cursor state!
// case FL_ENTER:
case FL_ENTER:
// MRS: WIN32 only? Need to test!
// case FL_MOVE:
// case FL_LEAVE:
// if (Fl::event_inside(text_area)) fl_cursor(FL_CURSOR_INSERT);
// else fl_cursor(FL_CURSOR_DEFAULT);
show_cursor(mCursorOn);
return 1;
}
return Fl_Text_Display::handle(event);
}
//
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.14 2003/01/30 21:42:50 easysw Exp $".
// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.15 2003/04/01 20:14:16 easysw Exp $".
//