From fcb49a7b139aaa5a0509c1718c107b372839cf47 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 26 Dec 2002 01:15:32 +0000 Subject: [PATCH] Fl_Text_Display/Editor would not receive FL_FOCUS events on mouse clicks which resulted in not showing the insertion cursor. Fluid would not register changes to Fl_Text_Editor widgets unless Enter was pressed. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2885 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/function_panel.cxx | 3 ++- fluid/function_panel.fl | 7 ++++--- fluid/function_panel.h | 2 +- fluid/widget_panel.cxx | 3 ++- fluid/widget_panel.fl | 5 +++-- fluid/widget_panel.h | 2 +- src/Fl_Text_Display.cxx | 9 ++++++--- 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx index 5bb17c7ce..ffdb78eac 100644 --- a/fluid/function_panel.cxx +++ b/fluid/function_panel.cxx @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0102 +// generated by Fast Light User Interface Designer (fluid) version 1.0103 #include "function_panel.h" #include @@ -82,6 +82,7 @@ Fl_Window* make_code_panel() { Fl_Group::current()->resizable(o); o->buffer(new Fl_Text_Buffer); o->textfont(FL_COURIER); + o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE); } o->end(); Fl_Group::current()->resizable(o); diff --git a/fluid/function_panel.fl b/fluid/function_panel.fl index 722c3629d..7ea45f9e0 100644 --- a/fluid/function_panel.fl +++ b/fluid/function_panel.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0102 +version 1.0103 header_name {.h} code_name {.cxx} decl {\#include } {} @@ -54,10 +54,11 @@ Function {make_code_panel()} {open Fl_Group {} {open xywh {10 10 525 120} box DOWN_FRAME resizable } { - Fl_Text_Editor code_input { + Fl_Text_Editor code_input {selected xywh {12 12 521 116} box NO_BOX resizable code0 {o->buffer(new Fl_Text_Buffer);} code1 {o->textfont(FL_COURIER);} + code2 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} } } Fl_Return_Button code_panel_ok { @@ -399,7 +400,7 @@ Function {make_widgetbin()} {open } Fl_Button {} { user_data {"Fl_Output"} - callback type_make_cb selected + callback type_make_cb tooltip Output xywh {284 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[27]);} } diff --git a/fluid/function_panel.h b/fluid/function_panel.h index 51b60805c..013b1a8d8 100644 --- a/fluid/function_panel.h +++ b/fluid/function_panel.h @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0102 +// generated by Fast Light User Interface Designer (fluid) version 1.0103 #ifndef function_panel_h #define function_panel_h diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index b62a6e234..e42a63fb6 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0102 +// generated by Fast Light User Interface Designer (fluid) version 1.0103 #include "widget_panel.h" @@ -452,6 +452,7 @@ Fl_Double_Window* make_widget_panel() { Fl_Group::current()->resizable(o); o->buffer(new Fl_Text_Buffer()); o->textfont(FL_COURIER); + o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE); } o->end(); Fl_Group::current()->resizable(o); diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl index ad216ec55..a875c5b01 100644 --- a/fluid/widget_panel.fl +++ b/fluid/widget_panel.fl @@ -1,11 +1,11 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0102 +version 1.0103 header_name {.h} code_name {.cxx} Function {make_widget_panel()} {open } { Fl_Window {} {open - xywh {318 157 415 370} type Double resizable hotspot visible + xywh {366 151 415 370} type Double resizable hotspot visible } { Fl_Tabs {} { callback {propagate_load((Fl_Group *)o,v);} open @@ -417,6 +417,7 @@ image} tooltip {The callback function or code for the widget.} xywh {102 177 291 86} box NO_BOX align 4 textfont 4 resizable code0 {o->buffer(new Fl_Text_Buffer());} code1 {o->textfont(FL_COURIER);} + code2 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} } } Fl_Box {} { diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h index a93f13fac..96da542ba 100644 --- a/fluid/widget_panel.h +++ b/fluid/widget_panel.h @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0102 +// generated by Fast Light User Interface Designer (fluid) version 1.0103 #ifndef widget_panel_h #define widget_panel_h diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 0b77ea2e2..e95cc391b 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.39 2002/11/19 16:45:32 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.40 2002/12/26 01:15:32 matthiaswm Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -2973,7 +2973,10 @@ int Fl_Text_Display::handle(int event) { } case FL_PUSH: { - Fl::focus(this); // Take focus from any child widgets... + if (Fl::focus() != this) { + Fl::focus(this); + handle(FL_FOCUS); + } if (Fl::event_state()&FL_SHIFT) return handle(FL_DRAG); dragging = 1; int pos = xy_to_position(Fl::event_x(), Fl::event_y(), CURSOR_POS); @@ -3035,5 +3038,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.39 2002/11/19 16:45:32 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.40 2002/12/26 01:15:32 matthiaswm Exp $". //