Author: manolo
Date: 2012-05-15 04:54:01 -0700 (Tue, 15 May 2012)
New Revision: 9497
Log:
More for FLTK1 compatibility.

Modified:
   branches/branch-3.0/include/FL/Fl_Widget.H

Modified: branches/branch-3.0/include/FL/Fl_Widget.H
===================================================================
--- branches/branch-3.0/include/FL/Fl_Widget.H  2012-05-15 09:31:29 UTC (rev 
9496)
+++ branches/branch-3.0/include/FL/Fl_Widget.H  2012-05-15 11:54:01 UTC (rev 
9497)
@@ -106,11 +106,19 @@
   }
   
   void x(int v) {
-    ((fltk3::Widget_I*)_p)->x(_ctor_dx(v));
+    if (!as_window() || window()) { // except for top windows
+      fltk3::Group *g = ((fltk3::Widget*)_p)->parent();
+      if (!g->as_window()) v -= g->dx_window(); // transform to group-relative 
coords
+    }
+    ((fltk3::Widget_I*)_p)->x(v);
   }
   
   void y(int v) {
-    ((fltk3::Widget_I*)_p)->y(_ctor_dy(v));
+    if (!as_window() || window()) { // except for top windows
+      fltk3::Group *g = ((fltk3::Widget*)_p)->parent();
+      if (!g->as_window()) v -= g->dy_window(); // transform to group-relative 
coords
+    }
+    ((fltk3::Widget_I*)_p)->y(v);
   }
   
   void w(int v) {
@@ -255,9 +263,12 @@
   int damage_resize(int,int,int,int);
   
   void position(int x, int y) {
-    if (!as_window() || !window()) { // except for top windows
-      x = _ctor_dx(x); // transform to group-relative coords
-      y = _ctor_dy(y);
+    if (!as_window() || window()) { // except for top windows
+      fltk3::Group *g = ((fltk3::Widget*)_p)->parent();
+      if ( !g->as_window()) {
+       x -= g->dx_window(); // transform to group-relative coords
+       y -= g->dy_window();
+      }
     }
     ((fltk3::Widget_I*)_p)->position(x, y);
   }

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

Reply via email to