From daccac9672a336b7eae79a2a4efc6c877442f132 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 24 Aug 2003 13:09:06 +0000 Subject: [PATCH] Fl_Text_Display/Editor did not disable the current selection when focus was shifted to another widget (STR #131) Fl_Choice didn't use the normal focus box when the plastic scheme was in use (STR #129) Fl_Text_Editor didn't use selection_color() consistently (STR #130) The fltk_forms, fltk_gl, and fltk_images DSO's and HP-UX shared libraries are now linked against the fltk shared library to provide complete dependency resolution (STR #118) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3081 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 11 +++++++++++ src/Fl_Choice.cxx | 37 +++++++++++++++++++++++++++++-------- src/Fl_Text_Display.cxx | 21 +++++++++++++++------ src/Fl_Text_Editor.cxx | 8 ++++++-- src/Makefile | 34 +++++++++++++++++----------------- 5 files changed, 78 insertions(+), 33 deletions(-) diff --git a/CHANGES b/CHANGES index 5bdd7b0de..ee1cc73de 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,16 @@ CHANGES IN FLTK 1.1.4 + - Fl_Text_Display/Editor did not disable the current + selection when focus was shifted to another widget + (STR #131) + - Fl_Choice didn't use the normal focus box when the + plastic scheme was in use (STR #129) + - Fl_Text_Editor didn't use selection_color() + consistently (STR #130) + - The fltk_forms, fltk_gl, and fltk_images DSO's and + HP-UX shared libraries are now linked against the fltk + shared library to provide complete dependency + resolution (STR #118) - The configure.in file did not work with autoconf 2.57. - FLUID didn't redraw widgets when changing the X, Y, W, or H values in the widget panel (STR #120) diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx index 83d5f6540..d14315e54 100644 --- a/src/Fl_Choice.cxx +++ b/src/Fl_Choice.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.13 2003/01/30 21:41:34 easysw Exp $" +// "$Id: Fl_Choice.cxx,v 1.10.2.5.2.14 2003/08/24 13:09:06 easysw Exp $" // // Choice widget for the Fast Light Tool Kit (FLTK). // @@ -63,12 +63,33 @@ void Fl_Choice::draw() { if (mvalue()) { Fl_Menu_Item m = *mvalue(); if (active_r()) m.activate(); else m.deactivate(); - fl_clip(x() + dx, y() + dy + 1, w() - W, H - 2); - fl_draw_shortcut = 2; // hack value to make '&' disappear - m.draw(x() + dx, y() + dy + 1, w() - W, H - 2, this, - Fl::focus() == this); - fl_draw_shortcut = 0; - fl_pop_clip(); + + // ERCO + int xx = x() + dx, yy = y() + dy + 1, ww = w() - W, hh = H - 2; + if ( Fl::scheme() ) + { + Fl_Label l; + l.value = m.text; + l.image = 0; + l.deimage = 0; + l.type = m.labeltype_; + l.font = m.labelsize_ || m.labelfont_ ? m.labelfont_ : uchar(textfont()); + l.size = m.labelsize_ ? m.labelsize_ : textsize(); + l.color= m.labelcolor_ ? m.labelcolor_ : textcolor(); + if (!m.active()) l.color = fl_inactive((Fl_Color)l.color); + fl_draw_shortcut = 2; // hack value to make '&' disappear + l.draw(xx+3, yy, ww>6 ? ww-6 : 0, hh, FL_ALIGN_LEFT); + fl_draw_shortcut = 0; + if ( Fl::focus() == this ) draw_focus(box(), xx, yy, ww, hh); + } + else + { + fl_clip(xx, yy, ww, hh); + fl_draw_shortcut = 2; // hack value to make '&' disappear + m.draw(xx, yy, ww, hh, this, Fl::focus() == this); + fl_draw_shortcut = 0; + fl_pop_clip(); + } } draw_label(); @@ -130,5 +151,5 @@ int Fl_Choice::handle(int e) { } // -// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.13 2003/01/30 21:41:34 easysw Exp $". +// End of "$Id: Fl_Choice.cxx,v 1.10.2.5.2.14 2003/08/24 13:09:06 easysw Exp $". // diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 0f9211f88..21a68a4aa 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.45 2003/05/04 22:29:01 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.46 2003/08/24 13:09:06 easysw Exp $" // // Copyright 2001-2003 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -1580,12 +1580,12 @@ void Fl_Text_Display::draw_string( int style, int X, int Y, int toX, font = styleRec->font; fsize = styleRec->size; - if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) ) { + if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) && Fl::focus() == this) { background = selection_color(); } else background = color(); foreground = fl_contrast(styleRec->color, background); - } else if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) ) { + } else if ( style & (HIGHLIGHT_MASK | PRIMARY_MASK) && Fl::focus() == this ) { background = selection_color(); foreground = fl_contrast(textcolor(), background); } else { @@ -1628,11 +1628,14 @@ void Fl_Text_Display::clear_rect( int style, int X, int Y, if ( width == 0 ) return; - if ( style & HIGHLIGHT_MASK ) { + if ( Fl::focus() != this ) { + fl_color( color() ); + fl_rectf( X, Y, width, height ); + } else if ( style & HIGHLIGHT_MASK ) { fl_color( fl_contrast(textcolor(), color()) ); fl_rectf( X, Y, width, height ); } else if ( style & PRIMARY_MASK ) { - fl_color( FL_SELECTION_COLOR ); + fl_color( selection_color() ); fl_rectf( X, Y, width, height ); } else { fl_color( color() ); @@ -3042,6 +3045,12 @@ int Fl_Text_Display::handle(int event) { case FL_MOUSEWHEEL: return mVScrollBar->handle(event); + + case FL_FOCUS: + case FL_UNFOCUS: + if (buffer()->primary_selection()->start() != + buffer()->primary_selection()->end()) redraw(); // Redraw selections... + break; } return 0; @@ -3049,5 +3058,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.45 2003/05/04 22:29:01 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.46 2003/08/24 13:09:06 easysw Exp $". // diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index 095219f91..a24096ff2 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Editor.cxx,v 1.9.2.16 2003/05/27 20:20:20 easysw Exp $" +// "$Id: Fl_Text_Editor.cxx,v 1.9.2.17 2003/08/24 13:09:06 easysw Exp $" // // Copyright 2001-2003 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -451,11 +451,15 @@ int Fl_Text_Editor::handle(int event) { switch (event) { case FL_FOCUS: show_cursor(mCursorOn); // redraws the cursor + if (buffer()->primary_selection()->start() != + buffer()->primary_selection()->end()) redraw(); // Redraw selections... Fl::focus(this); return 1; case FL_UNFOCUS: show_cursor(mCursorOn); // redraws the cursor + if (buffer()->primary_selection()->start() != + buffer()->primary_selection()->end()) redraw(); // Redraw selections... case FL_HIDE: if (when() & FL_WHEN_RELEASE) maybe_do_callback(); return 1; @@ -486,5 +490,5 @@ int Fl_Text_Editor::handle(int event) { } // -// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.16 2003/05/27 20:20:20 easysw Exp $". +// End of "$Id: Fl_Text_Editor.cxx,v 1.9.2.17 2003/08/24 13:09:06 easysw Exp $". // diff --git a/src/Makefile b/src/Makefile index 7c7dd125e..d93a3ac6b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.18.2.14.2.53 2003/08/02 13:49:17 easysw Exp $" +# "$Id: Makefile,v 1.18.2.14.2.54 2003/08/24 13:09:06 easysw Exp $" # # Library makefile for the Fast Light Tool Kit (FLTK). # @@ -234,19 +234,19 @@ $(FLLIBNAME): $(FLOBJECTS) $(LIBCOMMAND) $@ $(FLOBJECTS) $(RANLIB) $@ -libfltk_forms.so.1.1: $(FLOBJECTS) +libfltk_forms.so.1.1: $(FLOBJECTS) libfltk.so.1.1 echo $(DSOCOMMAND) $@ ... - $(DSOCOMMAND) $@ $(FLOBJECTS) + $(DSOCOMMAND) $@ $(FLOBJECTS) -L. -lfltk -$(RM) libfltk_forms.so $(LN) libfltk_forms.so.1.1 libfltk_forms.so -libfltk_forms.sl.1.1: $(FLOBJECTS) +libfltk_forms.sl.1.1: $(FLOBJECTS) libfltk.sl.1.1 echo $(DSOCOMMAND) $@ ... - $(DSOCOMMAND) $@ $(FLOBJECTS) + $(DSOCOMMAND) $@ $(FLOBJECTS) -L. -lfltk -$(RM) libfltk_forms.sl $(LN) libfltk_forms.sl.1.1 libfltk_forms.sl -libfltk_forms.1.1.dylib: $(FLOBJECTS) +libfltk_forms.1.1.dylib: $(FLOBJECTS) libfltk.1.1.dylib echo $(DSOCOMMAND) $@ ... $(DSOCOMMAND) $@ \ -install_name $(libdir)/$@ \ @@ -270,19 +270,19 @@ $(GLLIBNAME): $(GLOBJECTS) $(LIBCOMMAND) $@ $(GLOBJECTS) $(RANLIB) $@ -libfltk_gl.so.1.1: $(GLOBJECTS) +libfltk_gl.so.1.1: $(GLOBJECTS) libfltk.so.1.1 echo $(DSOCOMMAND) $@ ... - $(DSOCOMMAND) $@ $(GLOBJECTS) + $(DSOCOMMAND) $@ $(GLOBJECTS) -L. -lfltk -$(RM) libfltk_gl.so $(LN) libfltk_gl.so.1.1 libfltk_gl.so -libfltk_gl.sl.1.1: $(GLOBJECTS) +libfltk_gl.sl.1.1: $(GLOBJECTS) libfltk.sl.1.1 echo $(DSOCOMMAND) $@ ... - $(DSOCOMMAND) $@ $(GLOBJECTS) + $(DSOCOMMAND) $@ $(GLOBJECTS) -L. -lfltk -$(RM) libfltk_gl.sl $(LN) libfltk_gl.sl.1.1 libfltk_gl.sl -libfltk_gl.1.1.dylib: $(GLOBJECTS) +libfltk_gl.1.1.dylib: $(GLOBJECTS) libfltk.1.1.dylib echo $(DSOCOMMAND) $@ ... $(DSOCOMMAND) $@ \ -install_name $(libdir)/$@ \ @@ -306,19 +306,19 @@ $(IMGLIBNAME): $(IMGOBJECTS) $(LIBCOMMAND) $@ $(IMGOBJECTS) $(RANLIB) $@ -libfltk_images.so.1.1: $(IMGOBJECTS) +libfltk_images.so.1.1: $(IMGOBJECTS) libfltk.so.1.1 echo $(DSOCOMMAND) $@ ... - $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMAGELIBS) + $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMAGELIBS) -L. -lfltk -$(RM) libfltk_images.so $(LN) libfltk_images.so.1.1 libfltk_images.so -libfltk_images.sl.1.1: $(IMGOBJECTS) +libfltk_images.sl.1.1: $(IMGOBJECTS) libfltk.sl.1.1 echo $(DSOCOMMAND) $@ ... - $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMAGELIBS) + $(DSOCOMMAND) $@ $(IMGOBJECTS) $(IMAGELIBS) -L. -lfltk -$(RM) libfltk_images.sl $(LN) libfltk_images.sl.1.1 libfltk_images.sl -libfltk_images.1.1.dylib: $(IMGOBJECTS) +libfltk_images.1.1.dylib: $(IMGOBJECTS) libfltk.1.1.dylib echo $(DSOCOMMAND) $@ ... $(DSOCOMMAND) $@ \ -install_name $(libdir)/$@ \ @@ -582,5 +582,5 @@ uninstall: # -# End of "$Id: Makefile,v 1.18.2.14.2.53 2003/08/02 13:49:17 easysw Exp $". +# End of "$Id: Makefile,v 1.18.2.14.2.54 2003/08/24 13:09:06 easysw Exp $". #