Fl_Output didn't grab input focus, and so was unable to handle CTRL-C

to copy selected text, and wouldn't know when to redraw itself when
it lost focus...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2057 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2002-04-08 18:32:16 +00:00
parent 6fa4abfe54
commit 84950c0af7
3 changed files with 18 additions and 5 deletions
+4
View File
@@ -1,5 +1,9 @@
CHANGES IN FLTK 1.1.0b13 CHANGES IN FLTK 1.1.0b13
- Fl_Output didn't take input focus when needed, so it
was unable to support CTRL-C for copying text in the
field and did not unhighlight selections when the
widget lost focus.
- The fl_filename_name() function didn't handle a NULL - The fl_filename_name() function didn't handle a NULL
input string. input string.
- The input field used by the fl_input() and - The input field used by the fl_input() and
+8 -2
View File
@@ -1,5 +1,5 @@
// //
// "$Id: Fl_Input_.cxx,v 1.21.2.11.2.7 2002/03/07 19:22:56 spitzak Exp $" // "$Id: Fl_Input_.cxx,v 1.21.2.11.2.8 2002/04/08 18:32:16 easysw Exp $"
// //
// Common input widget routines for the Fast Light Tool Kit (FLTK). // Common input widget routines for the Fast Light Tool Kit (FLTK).
// //
@@ -696,6 +696,11 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
case FL_PUSH: case FL_PUSH:
handle_mouse(X, Y, W, H, Fl::event_state(FL_SHIFT)); handle_mouse(X, Y, W, H, Fl::event_state(FL_SHIFT));
if (Fl::focus() != this) {
Fl::focus(this);
handle(FL_FOCUS);
}
return 1; return 1;
case FL_DRAG: case FL_DRAG:
@@ -707,6 +712,7 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
copy(0); copy(0);
return 1; return 1;
// MRS: FL_SELECTIONCLEAR is no longer used...
// case FL_SELECTIONCLEAR: // case FL_SELECTIONCLEAR:
// minimal_update(mark_, position_); // minimal_update(mark_, position_);
// mark_ = position_; // mark_ = position_;
@@ -858,5 +864,5 @@ Fl_Input_::~Fl_Input_() {
} }
// //
// End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.7 2002/03/07 19:22:56 spitzak Exp $". // End of "$Id: Fl_Input_.cxx,v 1.21.2.11.2.8 2002/04/08 18:32:16 easysw Exp $".
// //
+6 -3
View File
@@ -1,5 +1,5 @@
// //
// "$Id: Fl_Output.cxx,v 1.6.2.3.2.1 2002/01/01 15:11:31 easysw Exp $" // "$Id: Fl_Output.cxx,v 1.6.2.3.2.2 2002/04/08 18:32:16 easysw Exp $"
// //
// Output widget for the Fast Light Tool Kit (FLTK). // Output widget for the Fast Light Tool Kit (FLTK).
// //
@@ -38,7 +38,10 @@ void Fl_Output::draw() {
} }
int Fl_Output::handle(int event) { int Fl_Output::handle(int event) {
if (event == FL_FOCUS) return 0; if (event == FL_KEYBOARD && Fl::event_text()[0] == 0x03) {
// Handle CTRL-C for copy...
return copy(1);
}
Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; Fl_Boxtype b = box() ? box() : FL_DOWN_BOX;
return Fl_Input_::handletext(event, return Fl_Input_::handletext(event,
x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b), x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b),
@@ -46,5 +49,5 @@ int Fl_Output::handle(int event) {
} }
// //
// End of "$Id: Fl_Output.cxx,v 1.6.2.3.2.1 2002/01/01 15:11:31 easysw Exp $". // End of "$Id: Fl_Output.cxx,v 1.6.2.3.2.2 2002/04/08 18:32:16 easysw Exp $".
// //