Author: spitzak
Date: 2007-06-08 14:17:53 -0400 (Fri, 08 Jun 2007)
New Revision: 5895
Log:
Fixed a lot of highlighting problems with BarGroup (turn on it's
highlight color to test).


Modified:
   trunk/src/BarGroup.cxx

Modified: trunk/src/BarGroup.cxx
===================================================================
--- trunk/src/BarGroup.cxx      2007-06-08 18:17:00 UTC (rev 5894)
+++ trunk/src/BarGroup.cxx      2007-06-08 18:17:53 UTC (rev 5895)
@@ -66,13 +66,14 @@
   switch (event) {
   case ENTER:
   case MOVE:
-    if (highlight_color() && takesevents()) {
+    if (takesevents()) {
       glyph_box(r);
       bool hl = event_inside(r);
       if (hl != highlighted) {
        highlighted = hl;
-       redraw(DAMAGE_HIGHLIGHT);
+       if (highlight_color()) redraw(DAMAGE_HIGHLIGHT);
       }
+      if (hl) {fltk::belowmouse(this); return 1;}
     }
     break;
   case LEAVE:
@@ -107,7 +108,7 @@
     if (pushed) {
       opened(!open_);
       pushed = false;
-      highlighted = true;
+      highlighted = event_inside(fltk::Rectangle(glyph_size_, glyph_size_));
       redraw(DAMAGE_HIGHLIGHT);
       do_callback();
     } else if (highlighted) {
@@ -132,7 +133,9 @@
       //flags(saved);
     }
   } else if (damage() & ~(DAMAGE_CHILD|DAMAGE_HIGHLIGHT)) {
+    clear_flag(HIGHLIGHT);
     draw_box();
+    // draw the label inside it:
     Rectangle r(w(),h());
     Flags flags = this->flags();
     drawstyle(style(), flags|OUTPUT);
@@ -146,6 +149,7 @@
     }
     draw_label(r, flags);
   }
+  // draw the open/close button:
   if (damage() & (DAMAGE_EXPOSE|DAMAGE_HIGHLIGHT|DAMAGE_ALL)) {
     Flags flags = OUTPUT;
     if (pushed) flags |= PUSHED;

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to