Author: matt
Date: 2012-05-10 15:06:06 -0700 (Thu, 10 May 2012)
New Revision: 9479
Log:
More group-relative fixes (never thought it was so laborous). Still missing: 
Fluid and everything depending on it, Widget::resize(), shapedwindow on OSX, 
resizebox

Modified:
   branches/branch-3.0/include/fltk3/Spinner.h
   branches/branch-3.0/src/fltk3/Counter.cxx
   branches/branch-3.0/src/fltk3/Table.cxx
   branches/branch-3.0/src/fltk3/Tree.cxx
   branches/branch-3.0/src/fltk3/ValueOutput.cxx
   branches/branch-3.0/src/fltk3/cocoa_font.cxx
   branches/branch-3.0/test/scroll.cxx
   branches/branch-3.0/test/sudoku.cxx
   branches/branch-3.0/test/unittest_circles.cxx
   branches/branch-3.0/test/unittest_images.cxx
   branches/branch-3.0/test/unittest_lines.cxx
   branches/branch-3.0/test/unittest_points.cxx
   branches/branch-3.0/test/unittest_rects.cxx
   branches/branch-3.0/test/unittest_scrollbarsize.cxx
   branches/branch-3.0/test/unittest_text.cxx
   branches/branch-3.0/test/utf8.cxx

Modified: branches/branch-3.0/include/fltk3/Spinner.h
===================================================================
--- branches/branch-3.0/include/fltk3/Spinner.h 2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/include/fltk3/Spinner.h 2012-05-10 22:06:06 UTC (rev 
9479)
@@ -126,10 +126,9 @@
      */
     Spinner(int X, int Y, int W, int H, const char *L = 0)
     : fltk3::Group(X, Y, W, H, L),
-    input_(X, Y, W - H / 2 - 2, H),
-    up_button_(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2, "@-42<"),
-    down_button_(X + W - H / 2 - 2, Y + H - H / 2,
-                 H / 2 + 2, H / 2, "@-42>") {
+    input_(0, 0, W - H / 2 - 2, H),
+    up_button_(W - H / 2 - 2, 0, H / 2 + 2, H / 2, "@-42<"),
+    down_button_(W - H / 2 - 2, H - H / 2, H / 2 + 2, H / 2, "@-42>") {
       end();
       
       value_   = 1.0;
@@ -193,12 +192,10 @@
     /** Sets the minimum and maximum values for the widget. */
     void               range(double a, double b) { minimum_ = a; maximum_ = b; 
}
     void               resize(int X, int Y, int W, int H) {
-      Group::resize(X,Y,W,H);
-      
-      input_.resize(X, Y, W - H / 2 - 2, H);
-      up_button_.resize(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2);
-      down_button_.resize(X + W - H / 2 - 2, Y + H - H / 2,
-                          H / 2 + 2, H / 2);
+      Group::resize(X,Y,W,H);      
+      input_.resize(0, 0, W - H / 2 - 2, H);
+      up_button_.resize(W - H / 2 - 2, 0, H / 2 + 2, H / 2);
+      down_button_.resize(W - H / 2 - 2, H - H / 2, H / 2 + 2, H / 2);
     }
     /**
      Sets or returns the amount to change the value when the user clicks a 
button. 

Modified: branches/branch-3.0/src/fltk3/Counter.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Counter.cxx   2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/src/fltk3/Counter.cxx   2012-05-10 22:06:06 UTC (rev 
9479)
@@ -45,26 +45,26 @@
   int xx[5], ww[5];
   if (type() == fltk3::NORMAL_COUNTER) {
     int W = w()*15/100;
-    xx[1] = x();        ww[1] = W;
-    xx[2] = x()+1*W;     ww[2] = W;
-    xx[0] = x()+2*W;     ww[0] = w()-4*W;
-    xx[3] = x()+w()-2*W; ww[3] = W;
-    xx[4] = x()+w()-1*W; ww[4] = W;
+    xx[1] = 0;  ww[1] = W;
+    xx[2] = 1*W;     ww[2] = W;
+    xx[0] = 2*W;     ww[0] = w()-4*W;
+    xx[3] = w()-2*W; ww[3] = W;
+    xx[4] = w()-1*W; ww[4] = W;
   } else {
     int W = w()*20/100;
     xx[1] = 0;          ww[1] = 0;
-    xx[2] = x();        ww[2] = W;
-    xx[0] = x()+W;      ww[0] = w()-2*W;
-    xx[3] = x()+w()-1*W; ww[3] = W;
+    xx[2] = 0;  ww[2] = W;
+    xx[0] = W;  ww[0] = w()-2*W;
+    xx[3] = w()-1*W; ww[3] = W;
     xx[4] = 0;          ww[4] = 0;
   }
 
-  draw_box(Boxtype(boxtype[0]|TIE_LEFT|TIE_RIGHT), xx[0], y(), ww[0], h(), 
fltk3::BACKGROUND2_COLOR);
+  draw_box(Boxtype(boxtype[0]|TIE_LEFT|TIE_RIGHT), xx[0], 0, ww[0], h(), 
fltk3::BACKGROUND2_COLOR);
   fltk3::font(textfont(), textsize());
   fltk3::color(active_r() ? textcolor() : fltk3::inactive(textcolor()));
   char str[128]; format(str);
-  fltk3::draw(str, xx[0], y(), ww[0], h(), fltk3::ALIGN_CENTER);
-  if (fltk3::focus() == this) draw_focus(boxtype[0], xx[0], y(), ww[0], h());
+  fltk3::draw(str, xx[0], 0, ww[0], h(), fltk3::ALIGN_CENTER);
+  if (fltk3::focus() == this) draw_focus(boxtype[0], xx[0], 0, ww[0], h());
   if (!(damage()&fltk3::DAMAGE_ALL)) return; // only need to redraw text
 
   if (active_r())
@@ -73,22 +73,22 @@
     selcolor = fltk3::inactive(labelcolor());
 
   if (type() == fltk3::NORMAL_COUNTER) {
-    draw_box(Boxtype(boxtype[1]|TIE_RIGHT), xx[1], y(), ww[1], h(), color());
-    fltk3::draw_symbol("@-4<<", xx[1], y(), ww[1], h(), selcolor);
-    draw_box(Boxtype(boxtype[2]|TIE_LEFT|TIE_RIGHT), xx[2], y(), ww[2], h(), 
color());
-    fltk3::draw_symbol("@-4<",  xx[2], y(), ww[2], h(), selcolor);
+    draw_box(Boxtype(boxtype[1]|TIE_RIGHT), xx[1], 0, ww[1], h(), color());
+    fltk3::draw_symbol("@-4<<", xx[1], 0, ww[1], h(), selcolor);
+    draw_box(Boxtype(boxtype[2]|TIE_LEFT|TIE_RIGHT), xx[2], 0, ww[2], h(), 
color());
+    fltk3::draw_symbol("@-4<",  xx[2], 0, ww[2], h(), selcolor);
   } else {
-    draw_box(Boxtype(boxtype[2]|TIE_RIGHT), xx[2], y(), ww[2], h(), color());
-    fltk3::draw_symbol("@-4<",  xx[2], y(), ww[2], h(), selcolor);
+    draw_box(Boxtype(boxtype[2]|TIE_RIGHT), xx[2], 0, ww[2], h(), color());
+    fltk3::draw_symbol("@-4<",  xx[2], 0, ww[2], h(), selcolor);
   }
   if (type() == fltk3::NORMAL_COUNTER) {
-    draw_box(Boxtype(boxtype[3]|TIE_LEFT|TIE_RIGHT), xx[3], y(), ww[3], h(), 
color());
-    fltk3::draw_symbol("@-4>",  xx[3], y(), ww[3], h(), selcolor);
-    draw_box(Boxtype(boxtype[4]|TIE_LEFT), xx[4], y(), ww[4], h(), color());
-    fltk3::draw_symbol("@-4>>", xx[4], y(), ww[4], h(), selcolor);
+    draw_box(Boxtype(boxtype[3]|TIE_LEFT|TIE_RIGHT), xx[3], 0, ww[3], h(), 
color());
+    fltk3::draw_symbol("@-4>",  xx[3], 0, ww[3], h(), selcolor);
+    draw_box(Boxtype(boxtype[4]|TIE_LEFT), xx[4], 0, ww[4], h(), color());
+    fltk3::draw_symbol("@-4>>", xx[4], 0, ww[4], h(), selcolor);
   } else {
-    draw_box(Boxtype(boxtype[3]|TIE_LEFT), xx[3], y(), ww[3], h(), color());
-    fltk3::draw_symbol("@-4>",  xx[3], y(), ww[3], h(), selcolor);
+    draw_box(Boxtype(boxtype[3]|TIE_LEFT), xx[3], 0, ww[3], h(), color());
+    fltk3::draw_symbol("@-4>",  xx[3], 0, ww[3], h(), selcolor);
   }
 }
 
@@ -118,14 +118,14 @@
 int fltk3::Counter::calc_mouseobj() {
   if (type() == fltk3::NORMAL_COUNTER) {
     int W = w()*15/100;
-    if (fltk3::event_inside(x(), y(), W, h())) return 1;
-    if (fltk3::event_inside(x()+W, y(), W, h())) return 2;
-    if (fltk3::event_inside(x()+w()-2*W, y(), W, h())) return 3;
-    if (fltk3::event_inside(x()+w()-W, y(), W, h())) return 4;
+    if (fltk3::event_inside(0, 0, W, h())) return 1;
+    if (fltk3::event_inside(W, 0, W, h())) return 2;
+    if (fltk3::event_inside(w()-2*W, 0, W, h())) return 3;
+    if (fltk3::event_inside(w()-W, 0, W, h())) return 4;
   } else {
     int W = w()*20/100;
-    if (fltk3::event_inside(x(), y(), W, h())) return 2;
-    if (fltk3::event_inside(x()+w()-W, y(), W, h())) return 3;
+    if (fltk3::event_inside(0, 0, W, h())) return 2;
+    if (fltk3::event_inside(w()-W, 0, W, h())) return 3;
   }
   return -1;
 }

Modified: branches/branch-3.0/src/fltk3/Table.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Table.cxx     2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/src/fltk3/Table.cxx     2012-05-10 22:06:06 UTC (rev 
9479)
@@ -138,17 +138,17 @@
   
   box(fltk3::THIN_DOWN_FRAME);
   
-  vscrollbar = new fltk3::Scrollbar(x()+w()-SCROLLBAR_SIZE, y(),
+  vscrollbar = new fltk3::Scrollbar(w()-SCROLLBAR_SIZE, 0,
                                 SCROLLBAR_SIZE, h()-SCROLLBAR_SIZE);
   vscrollbar->type(fltk3::VERTICAL);
   vscrollbar->callback(scroll_cb, (void*)this);
   
-  hscrollbar = new fltk3::Scrollbar(x(), y()+h()-SCROLLBAR_SIZE,
+  hscrollbar = new fltk3::Scrollbar(0, h()-SCROLLBAR_SIZE,
                                 w(), SCROLLBAR_SIZE);
   hscrollbar->type(fltk3::HORIZONTAL);
   hscrollbar->callback(scroll_cb, (void*)this);
   
-  table = new fltk3::ScrollGroup(x(), y(), w(), h());
+  table = new fltk3::ScrollGroup(0, 0, w(), h());
   table->box(fltk3::NO_BOX);
   table->type(0);              // don't show fltk3::ScrollGroup's scrollbars 
-- use our own
   table->hide();               // hide unless children are present
@@ -418,34 +418,34 @@
   int lx = fltk3::e_x;
   int ly = fltk3::e_y;
   if (_selecting == CONTEXT_COL_HEADER)
-  { ly = y() + col_header_height(); }
+  { ly = col_header_height(); }
   else if (_selecting == CONTEXT_ROW_HEADER)
-  { lx = x() + row_header_width(); }
-  if (lx > x() + w() - 20) {
-    fltk3::e_x = x() + w() - 20;
+  { lx = row_header_width(); }
+  if (lx > w() - 20) {
+    fltk3::e_x = w() - 20;
     if (hscrollbar->visible())
       
((fltk3::Slider*)hscrollbar)->value(hscrollbar->clamp(hscrollbar->value() + 
30));
     hscrollbar->do_callback();
     _dragging_x = fltk3::e_x - 30;
   }
-  else if (lx < (x() + row_header_width())) {
-    fltk3::e_x = x() + row_header_width() + 1;
+  else if (lx < (row_header_width())) {
+    fltk3::e_x = row_header_width() + 1;
     if (hscrollbar->visible()) {
       
((fltk3::Slider*)hscrollbar)->value(hscrollbar->clamp(hscrollbar->value() - 
30));
     }
     hscrollbar->do_callback();
     _dragging_x = fltk3::e_x + 30;
   }
-  if (ly > y() + h() - 20) {
-    fltk3::e_y = y() + h() - 20;
+  if (ly > h() - 20) {
+    fltk3::e_y = h() - 20;
     if (vscrollbar->visible()) {
       
((fltk3::Slider*)vscrollbar)->value(vscrollbar->clamp(vscrollbar->value() + 
30));
     }
     vscrollbar->do_callback();
     _dragging_y = fltk3::e_y - 30;
   }
-  else if (ly < (y() + col_header_height())) {
-    fltk3::e_y = y() + col_header_height() + 1;
+  else if (ly < (col_header_height())) {
+    fltk3::e_y = col_header_height() + 1;
     if (vscrollbar->visible()) {
       
((fltk3::Slider*)vscrollbar)->value(vscrollbar->clamp(vscrollbar->value() - 
30));
     }
@@ -467,8 +467,8 @@
 // Recalculate the window dimensions
 void fltk3::Table::recalc_dimensions() {
   // Recalc to* (Table Outer), ti* (Table Inner), wi* ( Widget Inner)
-  wix = ( x() + fltk3::box_dx(box())); tox = wix; tix = tox + 
fltk3::box_dx(table->box());
-  wiy = ( y() + fltk3::box_dy(box())); toy = wiy; tiy = toy + 
fltk3::box_dy(table->box());
+  wix = (       fltk3::box_dx(box())); tox = wix; tix = tox + 
fltk3::box_dx(table->box());
+  wiy = (       fltk3::box_dy(box())); toy = wiy; tiy = toy + 
fltk3::box_dy(table->box());
   wiw = ( w() - fltk3::box_dw(box())); tow = wiw; tiw = tow - 
fltk3::box_dw(table->box());
   wih = ( h() - fltk3::box_dh(box())); toh = wih; tih = toh - 
fltk3::box_dh(table->box());
   // Trim window if headers enabled
@@ -740,7 +740,7 @@
         case CONTEXT_NONE:
           // fltk3::PUSH on table corner?
           if ( fltk3::event_button() == 1 && 
-              fltk3::event_x() < x() + row_header_width()) {
+              fltk3::event_x() < row_header_width()) {
             current_col = 0;
             select_col = cols() - 1;
             current_row = 0;
@@ -885,10 +885,10 @@
       }
       // Enable autodrag if not resizing, and mouse has moved off table edge
       if ( _resizing_row < 0 && _resizing_col < 0 && _auto_drag == 0 && 
-          ( fltk3::event_x() > x() + w() - 20 ||
-           fltk3::event_x() < x() + row_header_width() || 
-           fltk3::event_y() > y() + h() - 20 ||
-           fltk3::event_y() < y() + col_header_height()
+          ( fltk3::event_x() > w() - 20 ||
+           fltk3::event_x() < row_header_width() || 
+           fltk3::event_y() > h() - 20 ||
+           fltk3::event_y() < col_header_height()
            ) ) {
             _start_auto_drag();
           }
@@ -1139,7 +1139,7 @@
   fltk3::pop_clip();
   
   // Explicitly draw border around widget, if any
-  draw_box(box(), x(), y(), w(), h(), color());
+  draw_box(box(), 0, 0, w(), h(), color());
   
   // If fltk3::ScrollGroup 'table' is hidden, draw its box
   //    Do this after fltk3::Group::draw() so we draw over scrollbars

Modified: branches/branch-3.0/src/fltk3/Tree.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/Tree.cxx      2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/src/fltk3/Tree.cxx      2012-05-10 22:06:06 UTC (rev 
9479)
@@ -277,8 +277,8 @@
   Group::draw_label();
   // Handle tree
   if ( ! _root ) return;
-  int cx = x() + fltk3::box_dx(box());
-  int cy = y() + fltk3::box_dy(box());
+  int cx =       fltk3::box_dx(box());
+  int cy =       fltk3::box_dy(box());
   int cw = w() - fltk3::box_dw(box());
   int ch = h() - fltk3::box_dh(box());
   // These values are changed during drawing
@@ -308,8 +308,8 @@
     _vscroll->visible();
     
     int scrollsize = _scrollbar_size ? _scrollbar_size : 
fltk3::scrollbar_size();
-    int sx = x()+w()-fltk3::box_dx(box())-scrollsize;
-    int sy = y()+fltk3::box_dy(box());
+    int sx = w()-fltk3::box_dx(box())-scrollsize;
+    int sy = fltk3::box_dy(box());
     int sw = scrollsize;
     int sh = h()-fltk3::box_dh(box());
     _vscroll->show();
@@ -602,8 +602,8 @@
                                                                         // 
Autoscroll
                int itemtop = _item_focus->y();
                int itembot = _item_focus->y()+_item_focus->h();
-               if ( itemtop < y() ) { show_item_top(_item_focus); }
-               if ( itembot > y()+h() ) { show_item_bottom(_item_focus); }
+               if ( itemtop < 0 ) { show_item_top(_item_focus); }
+               if ( itembot > h() ) { show_item_bottom(_item_focus); }
                // Extend selection
                if ( _prefs.selectmode() == fltk3::TREE_SELECT_MULTI && // 
multiselect on?
                     (fltk3::event_state() & fltk3::SHIFT) &&                   
// shift key?
@@ -673,12 +673,12 @@
     case fltk3::DRAG: {
       // do the scrolling first:
       int my = fltk3::event_y();
-      if ( my < y() ) {                                // above top?
-        int p = vposition()-(y()-my);
+      if ( my < 0 ) {                          // above top?
+        int p = vposition()-(-my);
        if ( p < 0 ) p = 0;
         vposition(p);
-      } else if ( my > (y()+h()) ) {           // below bottom?
-        int p = vposition()+(my-y()-h());
+      } else if ( my > (h()) ) {               // below bottom?
+        int p = vposition()+(my-h());
        if ( p > (int)_vscroll->maximum() ) p = (int)_vscroll->maximum();
         vposition(p);
       }
@@ -831,7 +831,7 @@
 void fltk3::Tree::show_item(fltk3::TreeItem *item, int yoff) {
   item = item ? item : first();
   if (!item) return;
-  int newval = item->y() - y() - yoff + (int)_vscroll->value();
+  int newval = item->y() - yoff + (int)_vscroll->value();
   if ( newval < _vscroll->minimum() ) newval = (int)_vscroll->minimum();
   if ( newval > _vscroll->maximum() ) newval = (int)_vscroll->maximum();
   _vscroll->value(newval);
@@ -850,7 +850,7 @@
 int fltk3::Tree::displayed(fltk3::TreeItem *item) {
   item = item ? item : first();
   if (!item) return(0);
-  return( (item->y() >= y()) && (item->y() <= (y()+h()-item->h())) ? 1 : 0);
+  return( (item->y() >= 0) && (item->y() <= (h()-item->h())) ? 1 : 0);
 }
 
 /// Adjust the vertical scroll bar to show \p item at the top

Modified: branches/branch-3.0/src/fltk3/ValueOutput.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/ValueOutput.cxx       2012-05-09 21:26:32 UTC 
(rev 9478)
+++ branches/branch-3.0/src/fltk3/ValueOutput.cxx       2012-05-10 22:06:06 UTC 
(rev 9479)
@@ -35,8 +35,8 @@
 
 void fltk3::ValueOutput::draw() {
   fltk3::Boxtype b = box() ? box() : fltk3::DOWN_BOX;
-  int X = x()+fltk3::box_dx(b);
-  int Y = y()+fltk3::box_dy(b);
+  int X =     fltk3::box_dx(b);
+  int Y =     fltk3::box_dy(b);
   int W = w()-fltk3::box_dw(b);
   int H = h()-fltk3::box_dh(b);
   if (damage()&~fltk3::DAMAGE_CHILD)

Modified: branches/branch-3.0/src/fltk3/cocoa_font.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/cocoa_font.cxx        2012-05-09 21:26:32 UTC 
(rev 9478)
+++ branches/branch-3.0/src/fltk3/cocoa_font.cxx        2012-05-10 22:06:06 UTC 
(rev 9479)
@@ -545,7 +545,7 @@
 void fltk3::QuartzGraphicsDriver::rtl_draw(const char* c, int n, int x, int y) 
{
   int dx, dy, w, h;
   text_extents(c, n, dx, dy, w, h);
-  draw(c, n, x+origin_x() - w - dx, y+origin_y());
+  draw(c, n, x - w - dx, y);
 }
 
 //

Modified: branches/branch-3.0/test/scroll.cxx
===================================================================
--- branches/branch-3.0/test/scroll.cxx 2012-05-09 21:26:32 UTC (rev 9478)
+++ branches/branch-3.0/test/scroll.cxx 2012-05-10 22:06:06 UTC (rev 9479)
@@ -49,7 +49,7 @@
 void Drawing::draw() {
   draw_box();
   fltk3::push_matrix();
-  fltk3::translate(x()+w()/2, y()+h()/2);
+  fltk3::translate(w()/2, h()/2);
   fltk3::scale(w()/2, h()/2);
   fltk3::color(fltk3::BLACK);
   for (int i = 0; i < 20; i++) {

Modified: branches/branch-3.0/test/sudoku.cxx
===================================================================
--- branches/branch-3.0/test/sudoku.cxx 2012-05-09 21:26:32 UTC (rev 9478)
+++ branches/branch-3.0/test/sudoku.cxx 2012-05-10 22:06:06 UTC (rev 9479)
@@ -512,14 +512,16 @@
 
 
   // Draw the cell box...
-  if (readonly()) fltk3::draw_box(fltk3::UP_BOX, x(), y(), w(), h(), color());
-  else fltk3::draw_box(fltk3::DOWN_BOX, x(), y(), w(), h(), color());
+  if (readonly()) 
+    fltk3::draw_box(fltk3::UP_BOX, 0, 0, w(), h(), color());
+  else 
+    fltk3::draw_box(fltk3::DOWN_BOX, 0, 0, w(), h(), color());
 
   // Draw the cell background...
   if (fltk3::focus() == this) {
     fltk3::Color c = fltk3::color_average(fltk3::SELECTION_COLOR, color(), 
0.5f);
     fltk3::color(c);
-    fltk3::rectf(x() + 4, y() + 4, w() - 8, h() - 8);
+    fltk3::rectf(4, 4, w() - 8, h() - 8);
     fltk3::color(fltk3::contrast(labelcolor(), c));
   } else fltk3::color(labelcolor());
 
@@ -532,7 +534,7 @@
     s[0] = value_ + '0';
 
     fltk3::font(fltk3::HELVETICA_BOLD, h() - 10);
-    fltk3::draw(s, x(), y(), w(), h(), fltk3::ALIGN_CENTER);
+    fltk3::draw(s, 0, 0, w(), h(), fltk3::ALIGN_CENTER);
   }
 
   fltk3::font(fltk3::HELVETICA_BOLD, h() / 5);
@@ -540,7 +542,7 @@
   for (int i = 0; i < 8; i ++) {
     if (test_value_[i]) {
       s[0] = test_value_[i] + '0';
-      fltk3::draw(s, x() + 5, y() + 5, w() - 10, h() - 10, align[i]);
+      fltk3::draw(s, 5, 5, w() - 10, h() - 10, align[i]);
     }
   }
 }
@@ -560,7 +562,7 @@
       return 1;
 
     case fltk3::PUSH :
-      if (!readonly() && fltk3::event_inside(this)) {
+      if (!readonly() && fltk3::event_inside(0, 0, w(), h())) {
         if (fltk3::event_clicks()) {
          // 2+ clicks increments/sets value
          if (value()) {

Modified: branches/branch-3.0/test/unittest_circles.cxx
===================================================================
--- branches/branch-3.0/test/unittest_circles.cxx       2012-05-09 21:26:32 UTC 
(rev 9478)
+++ branches/branch-3.0/test/unittest_circles.cxx       2012-05-10 22:06:06 UTC 
(rev 9479)
@@ -50,7 +50,7 @@
   }
   void draw() {
     fltk3::Box::draw();
-    int a = x()+10, b = y()+10; fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 
100, 100);
+    int a = 10, b = 10; fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 100, 
100);
     // test fltk3::arc for full circles
     fltk3::color(fltk3::GREEN); fltk3::rect(a+ 9, b+ 9, 33, 33);
     fltk3::color(fltk3::RED); fltk3::xyline(a+24, b+10, a+27); 
fltk3::xyline(a+24, b+40, a+27);

Modified: branches/branch-3.0/test/unittest_images.cxx
===================================================================
--- branches/branch-3.0/test/unittest_images.cxx        2012-05-09 21:26:32 UTC 
(rev 9478)
+++ branches/branch-3.0/test/unittest_images.cxx        2012-05-10 22:06:06 UTC 
(rev 9479)
@@ -109,7 +109,7 @@
 
     // top left: RGB
 
-    int xx = x()+10, yy = y()+10;
+    int xx = 10, yy = 10;
     fltk3::color(fltk3::BLACK); fltk3::rect(xx, yy, 130, 130);
 #if IMG
     i_rgb->draw(xx+1,yy+1);
@@ -120,7 +120,7 @@
 
     // bottom left: RGBA
 
-    xx = x()+10; yy = y()+10+134;
+    xx = 10; yy = 10+134;
     fltk3::color(fltk3::BLACK); fltk3::rect(xx, yy, 130, 130); // black frame
     fltk3::color(fltk3::WHITE); fltk3::rectf(xx+1, yy+1, 128, 128);    // 
white background
 #if CB                                                 // checker board
@@ -136,7 +136,7 @@
 
     // top right: Gray
 
-    xx = x()+10+200; yy = y()+10;
+    xx = 10+200; yy = 10;
     fltk3::color(fltk3::BLACK); fltk3::rect(xx, yy, 130, 130);
 #if IMG
     i_g->draw(xx+1,yy+1);
@@ -147,7 +147,7 @@
 
     // bottom right: Gray+Alpha
 
-    xx = x()+10+200; yy = y()+10+134;
+    xx = 10+200; yy = 10+134;
     fltk3::color(fltk3::BLACK); fltk3::rect(xx, yy, 130, 130); // black frame
     fltk3::color(fltk3::WHITE); fltk3::rectf(xx+1, yy+1, 128, 128);    // 
white background
 #if CB                                                 // checker board

Modified: branches/branch-3.0/test/unittest_lines.cxx
===================================================================
--- branches/branch-3.0/test/unittest_lines.cxx 2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/test/unittest_lines.cxx 2012-05-10 22:06:06 UTC (rev 
9479)
@@ -49,7 +49,7 @@
   }
   void draw() {
     fltk3::Box::draw();
-    int a = x()+10, b = y()+10; fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 
100, 100);
+    int a = 10, b = 10; fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 100, 
100);
     // testing fltk3::xyline(x, y, x1)
     fltk3::color(fltk3::RED); fltk3::point(a+10, b+10); fltk3::point(a+20, 
b+10);
     fltk3::color(fltk3::BLACK); fltk3::xyline(a+10, b+10, a+20);

Modified: branches/branch-3.0/test/unittest_points.cxx
===================================================================
--- branches/branch-3.0/test/unittest_points.cxx        2012-05-09 21:26:32 UTC 
(rev 9478)
+++ branches/branch-3.0/test/unittest_points.cxx        2012-05-10 22:06:06 UTC 
(rev 9479)
@@ -47,7 +47,7 @@
   }
   void draw() {
     fltk3::Box::draw();
-    int a = x()+10, b = y()+10; 
+    int a = 10, b = 10; 
     fltk3::color(fltk3::WHITE); fltk3::rectf(a, b, 90, 90);
     fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 90, 90);
     fltk3::point(a+10, b+10); fltk3::point(a+20, b+20);

Modified: branches/branch-3.0/test/unittest_rects.cxx
===================================================================
--- branches/branch-3.0/test/unittest_rects.cxx 2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/test/unittest_rects.cxx 2012-05-10 22:06:06 UTC (rev 
9479)
@@ -48,7 +48,7 @@
   }
   void draw() {
     fltk3::Box::draw();
-    int a = x()+10, b = y()+10; fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 
100, 100);
+    int a = 10, b = 10; fltk3::color(fltk3::BLACK); fltk3::rect(a, b, 100, 
100);
     // testing fltk3::rect() with positive size
     fltk3::color(fltk3::RED);   fltk3::loop(a+10, b+10, a+40, b+10, a+40, 
b+40, a+10, b+40);
     fltk3::color(fltk3::GREEN); fltk3::loop(a+ 9, b+ 9, a+41, b+ 9, a+41, 
b+41, a+ 9, b+41);

Modified: branches/branch-3.0/test/unittest_scrollbarsize.cxx
===================================================================
--- branches/branch-3.0/test/unittest_scrollbarsize.cxx 2012-05-09 21:26:32 UTC 
(rev 9478)
+++ branches/branch-3.0/test/unittest_scrollbarsize.cxx 2012-05-10 22:06:06 UTC 
(rev 9479)
@@ -121,19 +121,19 @@
         //     |        |  |        |  |        |          |      |
         //     ----------  ----------  ----------         ---  ------
         //                                     
-        int tgrpy = Y+30;
+        int tgrpy = 30;
         int tgrph = H-130;
         int browy = tgrpy+14;
         int browh = tgrph/2 - 20;
         int treey = browy + browh + 20;
         int treeh = browh;
-        brow_a = makebrowser(X+ 10,browy,100,browh,"Browser A");
-        brow_b = makebrowser(X+120,browy,100,browh,"Browser B");
-        brow_c = makebrowser(X+240,browy,100,browh,"Browser C");
-        tree_a = maketree(X+ 10,treey,100,treeh,"Tree A");
-        tree_b = maketree(X+120,treey,100,treeh,"Tree B");
-        tree_c = maketree(X+240,treey,100,treeh,"Tree C");
-        fltk3::ValueSlider *slide_glob = new 
fltk3::ValueSlider(X+100,Y,100,18,"Global Scroll Size");
+        brow_a = makebrowser( 10,browy,100,browh,"Browser A");
+        brow_b = makebrowser(120,browy,100,browh,"Browser B");
+        brow_c = makebrowser(240,browy,100,browh,"Browser C");
+        tree_a = maketree( 10,treey,100,treeh,"Tree A");
+        tree_b = maketree(120,treey,100,treeh,"Tree B");
+        tree_c = maketree(240,treey,100,treeh,"Tree C");
+        fltk3::ValueSlider *slide_glob = new 
fltk3::ValueSlider(100,0,100,18,"Global Scroll Size");
         slide_glob->value(16);
         slide_glob->type(fltk3::HORIZONTAL);
         slide_glob->align(fltk3::ALIGN_LEFT);
@@ -141,7 +141,7 @@
         slide_glob->step(1.0);
         slide_glob->callback(slide_cb, (void*)this);
         slide_glob->labelsize(12);
-        fltk3::ValueSlider *slide_browa = new 
fltk3::ValueSlider(X+350,Y,100,18,"A: Scroll Size");
+        fltk3::ValueSlider *slide_browa = new 
fltk3::ValueSlider(350,0,100,18,"A: Scroll Size");
         slide_browa->value(16);
         slide_browa->type(fltk3::HORIZONTAL);
         slide_browa->align(fltk3::ALIGN_LEFT);

Modified: branches/branch-3.0/test/unittest_text.cxx
===================================================================
--- branches/branch-3.0/test/unittest_text.cxx  2012-05-09 21:26:32 UTC (rev 
9478)
+++ branches/branch-3.0/test/unittest_text.cxx  2012-05-10 22:06:06 UTC (rev 
9479)
@@ -58,8 +58,8 @@
   }
   TextExtentsTest(int x, int y, int w, int h) : fltk3::Widget(x, y, w, h) {}
   void draw(void) {
-    int x0 = x(); // origin is current window position for fltk3::Box
-    int y0 = y();
+    int x0 = 0; // origin is current window position for fltk3::Box
+    int y0 = 0;
     int w0 = w();
     int h0 = h();
     fltk3::push_clip(x0, y0, w0, h0); // reset local clipping

Modified: branches/branch-3.0/test/utf8.cxx
===================================================================
--- branches/branch-3.0/test/utf8.cxx   2012-05-09 21:26:32 UTC (rev 9478)
+++ branches/branch-3.0/test/utf8.cxx   2012-05-10 22:06:06 UTC (rev 9479)
@@ -110,7 +110,7 @@
   draw_box();
   fltk3::font((fltk3::Font)font, size);
   fltk3::color(fltk3::BLACK);
-  fltk3::draw(label(), x() + 3, y() + 3, w() - 6, h() - 6, align());
+  fltk3::draw(label(), 3, 3, w() - 6, h() - 6, align());
 }
 
 
@@ -362,43 +362,43 @@
       }  
       fltk3::Group *fontgroup = new fltk3::Group(0, 105, 380, 315);
       {        
-        fontobj = new fltk3::HoldBrowser(10, 110, 290, 270);
+        fontobj = new fltk3::HoldBrowser(10, 5, 290, 270);
         fontobj->box(fltk3::FRAME_BOX);
         fontobj->color(53, 3);
         fontobj->callback(font_cb);
         fnt_chooser_win->resizable(fontobj);
         
-        sizeobj = new fltk3::HoldBrowser(310, 110, 60, 270);
+        sizeobj = new fltk3::HoldBrowser(310, 5, 60, 270);
         sizeobj->box(fltk3::FRAME_BOX);
         sizeobj->color(53, 3);
         sizeobj->callback(size_cb);
         
         // Create the status bar
-        fltk3::Group *stat_bar = new fltk3::Group (10, 385, 380, 30);
+        fltk3::Group *stat_bar = new fltk3::Group (10, 280, 380, 30);
         {        
-          fnt_cnt = new fltk3::ValueOutput(10, 390, 40, 20);
+          fnt_cnt = new fltk3::ValueOutput(0, 5, 40, 20);
           fnt_cnt->label("fonts");
           fnt_cnt->align(fltk3::ALIGN_RIGHT);
         
-          fix_prop = new fltk3::Output(100, 390, 40, 20);
+          fix_prop = new fltk3::Output(90, 5, 40, 20);
           fix_prop->color(fltk3::BACKGROUND_COLOR);
           fix_prop->value("prop");
           fix_prop->clear_visible_focus();
         
-          own_face = new fltk3::CheckButton(150, 390, 40, 20, "Self");
+          own_face = new fltk3::CheckButton(140, 5, 40, 20, "Self");
           own_face->value(0);
           own_face->type(fltk3::TOGGLE_BUTTON);
           own_face->clear_visible_focus();
           own_face->callback(own_face_cb);
           own_face->tooltip("Display font names in their own face");
         
-          fltk3::Box * dummy = new fltk3::Box(220, 390, 1, 1);
+          fltk3::Box * dummy = new fltk3::Box(210, 10, 1, 1);
         
-          choose_btn = new fltk3::Button(240, 385, 60, 30);
+          choose_btn = new fltk3::Button(230, 0, 60, 30);
           choose_btn->label("Select");
           choose_btn->callback(choose_cb);
         
-          refresh_btn = new fltk3::Button(310, 385, 60, 30);
+          refresh_btn = new fltk3::Button(300, 0, 60, 30);
           refresh_btn->label("Refresh");
           refresh_btn->callback(refresh_cb);
         
@@ -495,7 +495,7 @@
     if (type() == fltk3::HIDDEN_INPUT) return;
     fltk3::Boxtype b = box();
     if (damage() & fltk3::DAMAGE_ALL) draw_box(b, color());
-    drawtext(x()+fltk3::box_dx(b)+3, y()+fltk3::box_dy(b),
+    drawtext(fltk3::box_dx(b)+3, fltk3::box_dy(b),
              w()-fltk3::box_dw(b)-6, h()-fltk3::box_dh(b));
   }
   void drawtext(int X, int Y, int W, int H) {
@@ -629,10 +629,10 @@
     }
     buf[o] = '\0';
     sprintf(bu, "0x%06lX", y * 16);
-    fltk3::Input *b = new fltk3::Input(200,(y-off)*25,80,25);
+    fltk3::Input *b = new fltk3::Input(0,(y-off)*25,80,25);
     b->textfont(fltk3::COURIER);
     b->value(strdup(bu));
-    b = new fltk3::Input(280,(y-off)*25,380,25);
+    b = new fltk3::Input(80,(y-off)*25,380,25);
     b->textfont(extra_font);
     b->value(strdup(buf));
   }

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

Reply via email to