changeset 2022:b4c1aa2d99dc

ComplexButton: fix its content widget coordinates (absolute in fltk-1.3)
author Jorge Arellano Cid <jcid@dillo.org>
date Mon, 16 May 2011 13:57:33 -0400
parents e63f6fc75427
children 263540f2e5fa 223cf05a7e6a
files dw/fltkcomplexbutton.cc
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkcomplexbutton.cc	Mon May 16 13:57:30 2011 -0400
+++ b/dw/fltkcomplexbutton.cc	Mon May 16 13:57:33 2011 -0400
@@ -73,8 +73,11 @@
   if (Fl::focus() == this) draw_focus();
 
   // ComplexButton is a Group; draw its children
-  for (int i = children () - 1; i >= 0; i--)
+  for (int i = children () - 1; i >= 0; i--) {
+     // set absolute coordinates for fltk-1.3  --jcid
+     child (i)->position(x()+(w()-child(i)->w())/2,y()+(h()-child(i)->h())/2);
      draw_child (*child (i));
+  }
 }
 
 int ComplexButton::handle(int event) {