changeset 2740:9be24001d288

Style update. Add DW_SIZE_AUTO (-1) for passing automatic sizing to packing. Also convert SIZEEXPAND/STATIC and TYPEBOX/ITEM to the new format based on our new style guidelines. as _DW_SIZE_EXPAND/STATIC and _DW_TYPE_BOX/ITEM.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 19 Dec 2021 15:39:43 +0000
parents 02c53dd5e21d
children 0b1030337dd3
files dw.h ios/dw.m mac/dw.m os2/dw.c template/dw.c win/dw.c
diffstat 6 files changed, 174 insertions(+), 171 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Sat Dec 18 19:31:57 2021 +0000
+++ b/dw.h	Sun Dec 19 15:39:43 2021 +0000
@@ -133,13 +133,16 @@
 #endif
 
 /* Used internally */
-#define TYPEBOX  0
-#define TYPEITEM 1
+#define _DW_TYPE_BOX  0
+#define _DW_TYPE_ITEM 1
+
+#define _DW_SPLITBAR_WIDTH 4
 
-#define SIZESTATIC 0
-#define SIZEEXPAND 1
+#define _DW_SIZE_STATIC 0
+#define _DW_SIZE_EXPAND 1
 
-#define SPLITBAR_WIDTH 4
+/* Control size constants */
+#define DW_SIZE_AUTO    -1
 
 typedef struct _user_data
 {
--- a/ios/dw.m	Sat Dec 18 19:31:57 2021 +0000
+++ b/ios/dw.m	Sun Dec 19 15:39:43 2021 +0000
@@ -771,7 +771,7 @@
     {
         box = calloc(1, sizeof(Box));
         box->type = DW_VERT;
-        box->vsize = box->hsize = SIZEEXPAND;
+        box->vsize = box->hsize = _DW_SIZE_EXPAND;
         box->width = box->height = 1;
     }
     return self;
@@ -1640,7 +1640,7 @@
 
         for(z=0;z<thisbox->count;z++)
         {
-            if(thisbox->items[z].type != TYPEBOX)
+            if(thisbox->items[z].type != _DW_TYPE_BOX)
             {
                 id object = thisbox->items[z].hwnd;
 
@@ -2996,7 +2996,7 @@
     {
         id handle = thisbox->items[z].hwnd;
 
-        if(thisbox->items[z].type == TYPEBOX)
+        if(thisbox->items[z].type == _DW_TYPE_BOX)
         {
             Box *tmp = (Box *)[handle box];
 
@@ -3079,7 +3079,7 @@
     {
         int itempad, itemwidth, itemheight;
 
-        if(thisbox->items[z].type == TYPEBOX)
+        if(thisbox->items[z].type == _DW_TYPE_BOX)
         {
             id box = thisbox->items[z].hwnd;
             Box *tmp = (Box *)[box box];
@@ -3122,7 +3122,7 @@
             if(itemwidth > uxmax)
                 uxmax = itemwidth;
 
-            if(thisbox->items[z].hsize != SIZEEXPAND)
+            if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
             {
                 if(itemwidth > upxmax)
                     upxmax = itemwidth;
@@ -3133,7 +3133,7 @@
                     upxmax = itempad;
             }
             thisbox->minheight += itemheight;
-            if(thisbox->items[z].vsize != SIZEEXPAND)
+            if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
                 thisbox->usedpady += itemheight;
             else
                 thisbox->usedpady += itempad;
@@ -3142,7 +3142,7 @@
         {
             if(itemheight > uymax)
                 uymax = itemheight;
-            if(thisbox->items[z].vsize != SIZEEXPAND)
+            if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
             {
                 if(itemheight > upymax)
                     upymax = itemheight;
@@ -3153,7 +3153,7 @@
                     upymax = itempad;
             }
             thisbox->minwidth += itemwidth;
-            if(thisbox->items[z].hsize != SIZEEXPAND)
+            if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
                 thisbox->usedpadx += itemwidth;
             else
                 thisbox->usedpadx += itempad;
@@ -3177,7 +3177,7 @@
             int thispad = thisbox->pad * 2;
 
             /* Calculate the new sizes */
-            if(thisbox->items[z].hsize == SIZEEXPAND)
+            if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
             {
                 if(thisbox->type == DW_HORZ)
                 {
@@ -3189,7 +3189,7 @@
                 else
                     width = x - (itempad + thispad + thisbox->grouppadx);
             }
-            if(thisbox->items[z].vsize == SIZEEXPAND)
+            if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
             {
                 if(thisbox->type == DW_VERT)
                 {
@@ -3216,7 +3216,7 @@
                 [handle setFrame:rect];
 
                 /* After placing a box... place its components */
-                if(thisbox->items[z].type == TYPEBOX)
+                if(thisbox->items[z].type == _DW_TYPE_BOX)
                 {
                     id box = thisbox->items[z].hwnd;
                     Box *tmp = (Box *)[box box];
@@ -4108,7 +4108,7 @@
 
     /* Fill in the item data appropriately */
     if([object isKindOfClass:[DWBox class]])
-       tmpitem[index].type = TYPEBOX;
+       tmpitem[index].type = _DW_TYPE_BOX;
     else
     {
         if(width == 0 && hsize == FALSE)
@@ -4116,19 +4116,19 @@
         if(height == 0 && vsize == FALSE)
             dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
 
-        tmpitem[index].type = TYPEITEM;
+        tmpitem[index].type = _DW_TYPE_ITEM;
     }
 
     tmpitem[index].hwnd = item;
     tmpitem[index].origwidth = tmpitem[index].width = width;
     tmpitem[index].origheight = tmpitem[index].height = height;
     tmpitem[index].pad = pad;
-    tmpitem[index].hsize = hsize ? SIZEEXPAND : SIZESTATIC;
-    tmpitem[index].vsize = vsize ? SIZEEXPAND : SIZESTATIC;
-
-    /* If either of the parameters are -1 ... calculate the size */
-    if(width == -1 || height == -1)
-        _dw_control_size(object, width == -1 ? &tmpitem[index].width : NULL, height == -1 ? &tmpitem[index].height : NULL);
+    tmpitem[index].hsize = hsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+    tmpitem[index].vsize = vsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+
+    /* If either of the parameters are -1 (DW_SIZE_AUTO) ... calculate the size */
+    if(width == DW_SIZE_AUTO || height == DW_SIZE_AUTO)
+        _dw_control_size(object, width == DW_SIZE_AUTO ? &tmpitem[index].width : NULL, height == DW_SIZE_AUTO ? &tmpitem[index].height : NULL);
 
     thisbox->items = tmpitem;
 
@@ -8680,9 +8680,9 @@
         Item *item = _dw_box_item(handle);
 
         /* Check to see if any of the sizes need to be recalculated */
-        if(item && (item->origwidth == -1 || item->origheight == -1))
-        {
-            _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+        if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+        {
+            _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
             /* Queue a redraw on the top-level window */
             _dw_redraw([object window], TRUE);
         }
@@ -8905,19 +8905,19 @@
     /* If we changed the text...
      * Check to see if any of the sizes need to be recalculated
      */
-    if(item && (item->origwidth == -1 || item->origheight == -1))
+    if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
     {
       int newwidth, newheight;
 
       _dw_control_size(handle, &newwidth, &newheight);
 
       /* Only update the item and redraw the window if it changed */
-      if((item->origwidth == -1 && item->width != newwidth) ||
-         (item->origheight == -1 && item->height != newheight))
+      if((item->origwidth == DW_SIZE_AUTO && item->width != newwidth) ||
+         (item->origheight == DW_SIZE_AUTO && item->height != newheight))
       {
-         if(item->origwidth == -1)
+         if(item->origwidth == DW_SIZE_AUTO)
             item->width = newwidth;
-         if(item->origheight == -1)
+         if(item->origheight == DW_SIZE_AUTO)
             item->height = newheight;
          /* Queue a redraw on the top-level window */
          _dw_redraw([object window], TRUE);
@@ -9040,9 +9040,9 @@
             Item *item = _dw_box_item(handle);
 
             /* Check to see if any of the sizes need to be recalculated */
-            if(item && (item->origwidth == -1 || item->origheight == -1))
+            if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
             {
-                _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+                _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
                 /* Queue a redraw on the top-level window */
                 _dw_redraw([object window], TRUE);
             }
@@ -9107,9 +9107,9 @@
             Item *item = _dw_box_item(handle);
 
             /* Check to see if any of the sizes need to be recalculated */
-            if(item && (item->origwidth == -1 || item->origheight == -1))
+            if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
             {
-                _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+                _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
                 /* Queue a redraw on the top-level window */
                 _dw_redraw([object window], TRUE);
             }
--- a/mac/dw.m	Sat Dec 18 19:31:57 2021 +0000
+++ b/mac/dw.m	Sun Dec 19 15:39:43 2021 +0000
@@ -991,7 +991,7 @@
     {
         box = calloc(1, sizeof(Box));
         box->type = DW_VERT;
-        box->vsize = box->hsize = SIZEEXPAND;
+        box->vsize = box->hsize = _DW_SIZE_EXPAND;
         box->width = box->height = 1;
     }
     return self;
@@ -1675,7 +1675,7 @@
 
         for(z=0;z<thisbox->count;z++)
         {
-            if(thisbox->items[z].type != TYPEBOX)
+            if(thisbox->items[z].type != _DW_TYPE_BOX)
             {
                 id object = thisbox->items[z].hwnd;
 
@@ -3683,7 +3683,7 @@
     {
         id handle = thisbox->items[z].hwnd;
 
-        if(thisbox->items[z].type == TYPEBOX)
+        if(thisbox->items[z].type == _DW_TYPE_BOX)
         {
             Box *tmp = (Box *)[handle box];
 
@@ -3802,7 +3802,7 @@
     {
         int itempad, itemwidth, itemheight;
 
-        if(thisbox->items[z].type == TYPEBOX)
+        if(thisbox->items[z].type == _DW_TYPE_BOX)
         {
             id box = thisbox->items[z].hwnd;
             Box *tmp = (Box *)[box box];
@@ -3845,7 +3845,7 @@
             if(itemwidth > uxmax)
                 uxmax = itemwidth;
 
-            if(thisbox->items[z].hsize != SIZEEXPAND)
+            if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
             {
                 if(itemwidth > upxmax)
                     upxmax = itemwidth;
@@ -3856,7 +3856,7 @@
                     upxmax = itempad;
             }
             thisbox->minheight += itemheight;
-            if(thisbox->items[z].vsize != SIZEEXPAND)
+            if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
                 thisbox->usedpady += itemheight;
             else
                 thisbox->usedpady += itempad;
@@ -3865,7 +3865,7 @@
         {
             if(itemheight > uymax)
                 uymax = itemheight;
-            if(thisbox->items[z].vsize != SIZEEXPAND)
+            if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
             {
                 if(itemheight > upymax)
                     upymax = itemheight;
@@ -3876,7 +3876,7 @@
                     upymax = itempad;
             }
             thisbox->minwidth += itemwidth;
-            if(thisbox->items[z].hsize != SIZEEXPAND)
+            if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
                 thisbox->usedpadx += itemwidth;
             else
                 thisbox->usedpadx += itempad;
@@ -3900,7 +3900,7 @@
             int thispad = thisbox->pad * 2;
 
             /* Calculate the new sizes */
-            if(thisbox->items[z].hsize == SIZEEXPAND)
+            if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
             {
                 if(thisbox->type == DW_HORZ)
                 {
@@ -3912,7 +3912,7 @@
                 else
                     width = x - (itempad + thispad + thisbox->grouppadx);
             }
-            if(thisbox->items[z].vsize == SIZEEXPAND)
+            if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
             {
                 if(thisbox->type == DW_VERT)
                 {
@@ -3941,7 +3941,7 @@
                 [handle setFrameSize:size];
 
                 /* After placing a box... place its components */
-                if(thisbox->items[z].type == TYPEBOX)
+                if(thisbox->items[z].type == _DW_TYPE_BOX)
                 {
                     id box = thisbox->items[z].hwnd;
                     Box *tmp = (Box *)[box box];
@@ -5132,27 +5132,27 @@
 
     /* Fill in the item data appropriately */
     if([object isKindOfClass:[DWBox class]] || [object isMemberOfClass:[DWGroupBox class]])
-       tmpitem[index].type = TYPEBOX;
+       tmpitem[index].type = _DW_TYPE_BOX;
     else
     {
-        if ( width == 0 && hsize == FALSE )
+        if(width == 0 && hsize == FALSE)
             dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
-        if ( height == 0 && vsize == FALSE )
+        if(height == 0 && vsize == FALSE)
             dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
 
-        tmpitem[index].type = TYPEITEM;
+        tmpitem[index].type = _DW_TYPE_ITEM;
     }
 
     tmpitem[index].hwnd = item;
     tmpitem[index].origwidth = tmpitem[index].width = width;
     tmpitem[index].origheight = tmpitem[index].height = height;
     tmpitem[index].pad = pad;
-    tmpitem[index].hsize = hsize ? SIZEEXPAND : SIZESTATIC;
-    tmpitem[index].vsize = vsize ? SIZEEXPAND : SIZESTATIC;
+    tmpitem[index].hsize = hsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+    tmpitem[index].vsize = vsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
 
     /* If either of the parameters are -1 ... calculate the size */
-    if(width == -1 || height == -1)
-        _dw_control_size(object, width == -1 ? &tmpitem[index].width : NULL, height == -1 ? &tmpitem[index].height : NULL);
+    if(width == DW_SIZE_AUTO || height ==  DW_SIZE_AUTO)
+        _dw_control_size(object, width == DW_SIZE_AUTO ? &tmpitem[index].width : NULL, height == DW_SIZE_AUTO ? &tmpitem[index].height : NULL);
 
     thisbox->items = tmpitem;
 
@@ -10445,9 +10445,9 @@
         Item *item = _dw_box_item(handle);
 
         /* Check to see if any of the sizes need to be recalculated */
-        if(item && (item->origwidth == -1 || item->origheight == -1))
-        {
-            _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+        if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+        {
+            _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
             /* Queue a redraw on the top-level window */
             _dw_redraw([object window], TRUE);
         }
@@ -10643,19 +10643,19 @@
     Item *item = _dw_box_item(handle);
 
     /* Check to see if any of the sizes need to be recalculated */
-    if(item && (item->origwidth == -1 || item->origheight == -1))
+    if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
     {
       int newwidth, newheight;
 
       _dw_control_size(handle, &newwidth, &newheight);
 
       /* Only update the item and redraw the window if it changed */
-      if((item->origwidth == -1 && item->width != newwidth) ||
-         (item->origheight == -1 && item->height != newheight))
+      if((item->origwidth == DW_SIZE_AUTO && item->width != newwidth) ||
+         (item->origheight == DW_SIZE_AUTO && item->height != newheight))
       {
-         if(item->origwidth == -1)
+         if(item->origwidth == DW_SIZE_AUTO)
             item->width = newwidth;
-         if(item->origheight == -1)
+         if(item->origheight == DW_SIZE_AUTO)
             item->height = newheight;
          /* Queue a redraw on the top-level window */
          _dw_redraw([object window], TRUE);
@@ -10776,9 +10776,9 @@
             Item *item = _dw_box_item(handle);
 
             /* Check to see if any of the sizes need to be recalculated */
-            if(item && (item->origwidth == -1 || item->origheight == -1))
-            {
-                _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+            if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+            {
+                _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
                 /* Queue a redraw on the top-level window */
                 _dw_redraw([object window], TRUE);
             }
@@ -10834,9 +10834,9 @@
             Item *item = _dw_box_item(handle);
 
             /* Check to see if any of the sizes need to be recalculated */
-            if(item && (item->origwidth == -1 || item->origheight == -1))
-            {
-                _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+            if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+            {
+                _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
                 /* Queue a redraw on the top-level window */
                 _dw_redraw([object window], TRUE);
             }
--- a/os2/dw.c	Sat Dec 18 19:31:57 2021 +0000
+++ b/os2/dw.c	Sun Dec 19 15:39:43 2021 +0000
@@ -682,7 +682,7 @@
 
    for(z=beg;_dw_focus_comp(direction, z, end);z+=direction)
    {
-      if(box->items[z].type == TYPEBOX)
+      if(box->items[z].type == _DW_TYPE_BOX)
       {
          Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER);
 
@@ -840,7 +840,7 @@
        */
       for(z=0;z<tmp->count;z++)
       {
-         if(tmp->items[z].type == TYPEBOX)
+         if(tmp->items[z].type == _DW_TYPE_BOX)
          {
             int s, os;
 
@@ -864,7 +864,7 @@
 
       for(z=0;z<tmp->count;z++)
       {
-         if(tmp->items[z].type == TYPEBOX)
+         if(tmp->items[z].type == _DW_TYPE_BOX)
             _dw_count_size(tmp->items[z].hwnd, type, &tmpsize, &tmporigsize);
          else
          {
@@ -1104,7 +1104,7 @@
    {
       int itempad, itemwidth, itemheight;
 
-      if(thisbox->items[z].type == TYPEBOX)
+      if(thisbox->items[z].type == _DW_TYPE_BOX)
       {
          Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
 
@@ -1146,7 +1146,7 @@
          if(itemwidth > uxmax)
             uxmax = itemwidth;
 
-         if(thisbox->items[z].hsize != SIZEEXPAND)
+         if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
          {
             if(itemwidth > upxmax)
                upxmax = itemwidth;
@@ -1157,7 +1157,7 @@
                upxmax = itempad;
          }
          thisbox->minheight += itemheight;
-         if(thisbox->items[z].vsize != SIZEEXPAND)
+         if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
             thisbox->usedpady += itemheight;
          else
             thisbox->usedpady += itempad;
@@ -1166,7 +1166,7 @@
       {
          if(itemheight > uymax)
             uymax = itemheight;
-         if(thisbox->items[z].vsize != SIZEEXPAND)
+         if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
          {
             if(itemheight > upymax)
                upymax = itemheight;
@@ -1177,7 +1177,7 @@
                upymax = itempad;
          }
          thisbox->minwidth += itemwidth;
-         if(thisbox->items[z].hsize != SIZEEXPAND)
+         if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
             thisbox->usedpadx += itemwidth;
          else
             thisbox->usedpadx += itempad;
@@ -1208,7 +1208,7 @@
          int thispad = thisbox->pad * 2;
 
          /* Calculate the new sizes */
-         if(thisbox->items[z].hsize == SIZEEXPAND)
+         if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
          {
             if(thisbox->type == DW_HORZ)
             {
@@ -1220,7 +1220,7 @@
             else
                width = x - (itempad + thispad + thisbox->grouppadx);
          }
-         if(thisbox->items[z].vsize == SIZEEXPAND)
+         if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
          {
             if(thisbox->type == DW_VERT)
             {
@@ -1342,7 +1342,7 @@
                            width, height, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
 
                /* After placing a box... place its components */
-               if(thisbox->items[z].type == TYPEBOX)
+               if(thisbox->items[z].type == _DW_TYPE_BOX)
                {
                   Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER);
 
@@ -3650,7 +3650,7 @@
 
             _dw_do_resize(mybox, swp->cx, swp->cy);
 
-            if(mybox->count == 1 && mybox->items[0].type == TYPEBOX)
+            if(mybox->count == 1 && mybox->items[0].type == _DW_TYPE_BOX)
             {
                mybox = (Box *)WinQueryWindowPtr(mybox->items[0].hwnd, QWP_USER);
 
@@ -3776,7 +3776,7 @@
 
    for(z=0;z<thisbox->count;z++)
    {
-      if(thisbox->items[z].type == TYPEBOX)
+      if(thisbox->items[z].type == _DW_TYPE_BOX)
       {
          Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
          _dw_change_box(tmp, percent, type);
@@ -3785,12 +3785,12 @@
       {
          if(type == DW_HORZ)
          {
-            if(thisbox->items[z].hsize == SIZEEXPAND)
+            if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
                thisbox->items[z].width = (int)(((float)thisbox->items[z].origwidth) * (((float)percent)/((float)100.0)));
          }
          else
          {
-            if(thisbox->items[z].vsize == SIZEEXPAND)
+            if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
                thisbox->items[z].height = (int)(((float)thisbox->items[z].origheight) * (((float)percent)/((float)100.0)));
          }
       }
@@ -3809,7 +3809,7 @@
 
    if(type == DW_HORZ)
    {
-      int newx = (int)((float)x * ratio) - (SPLITBAR_WIDTH/2);
+      int newx = (int)((float)x * ratio) - (_DW_SPLITBAR_WIDTH/2);
 
       WinSetWindowPos(handle1, NULLHANDLE, 0, 0, newx, y, SWP_MOVE | SWP_SIZE);
       _dw_do_resize(tmp, newx - 1, y - 1);
@@ -3818,21 +3818,21 @@
 
       tmp = WinQueryWindowPtr(handle2, QWP_USER);
 
-      newx = x - newx - SPLITBAR_WIDTH;
+      newx = x - newx - _DW_SPLITBAR_WIDTH;
 
       WinSetWindowPos(handle2, NULLHANDLE, x - newx, 0, newx, y, SWP_MOVE | SWP_SIZE);
       _dw_do_resize(tmp, newx - 1, y - 1);
    }
    else
    {
-      int newy = (int)((float)y * ratio) - (SPLITBAR_WIDTH/2);
+      int newy = (int)((float)y * ratio) - (_DW_SPLITBAR_WIDTH/2);
 
       WinSetWindowPos(handle1, NULLHANDLE, 0, y - newy, x, newy, SWP_MOVE | SWP_SIZE);
       _dw_do_resize(tmp, x - 1, newy - 1);
 
       tmp = WinQueryWindowPtr(handle2, QWP_USER);
 
-      newy = y - newy - SPLITBAR_WIDTH;
+      newy = y - newy - _DW_SPLITBAR_WIDTH;
 
       WinSetWindowPos(handle2, NULLHANDLE, 0, 0, x, newy, SWP_MOVE | SWP_SIZE);
       _dw_do_resize(tmp, x - 1, newy - 1);
@@ -3924,12 +3924,12 @@
          if(type == DW_HORZ)
          {
             rclFrame.xLeft = start;
-            rclFrame.xRight = start + SPLITBAR_WIDTH;
+            rclFrame.xRight = start + _DW_SPLITBAR_WIDTH;
          }
          else
          {
             rclFrame.yBottom = start;
-            rclFrame.yTop = start + SPLITBAR_WIDTH;
+            rclFrame.yTop = start + _DW_SPLITBAR_WIDTH;
          }
 
          if(percent)
@@ -3944,14 +3944,14 @@
                if(type == DW_HORZ)
                {
                   start = rclFrame.xLeft - rclBounds.xLeft;
-                  if(width - SPLITBAR_WIDTH > 1 && start < width - SPLITBAR_WIDTH)
-                     *percent = ((float)start / (float)(width - SPLITBAR_WIDTH)) * 100.0;
+                  if(width - _DW_SPLITBAR_WIDTH > 1 && start < width - _DW_SPLITBAR_WIDTH)
+                     *percent = ((float)start / (float)(width - _DW_SPLITBAR_WIDTH)) * 100.0;
                }
                else
                {
                   start = rclFrame.yBottom - rclBounds.yBottom;
-                  if(height - SPLITBAR_WIDTH > 1 && start < height - SPLITBAR_WIDTH)
-                     *percent = 100.0 - (((float)start / (float)(height - SPLITBAR_WIDTH)) * 100.0);
+                  if(height - _DW_SPLITBAR_WIDTH > 1 && start < height - _DW_SPLITBAR_WIDTH)
+                     *percent = 100.0 - (((float)start / (float)(height - _DW_SPLITBAR_WIDTH)) * 100.0);
                }
                _dw_handle_splitbar_resize(hwnd, *percent, type, width, height);
                _dw_handle_splitbar_resize(hwnd, *percent, type, width, height);
@@ -5510,9 +5510,9 @@
       Item *item = _dw_box_item(handle);
 
       /* Check to see if any of the sizes need to be recalculated */
-      if(item && (item->origwidth == -1 || item->origheight == -1))
-      {
-         _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+      if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+      {
+         _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
           /* Queue a redraw on the top-level window */
          _dw_redraw(_dw_toplevel_window(handle), TRUE);
       }
@@ -5726,7 +5726,7 @@
    ULONG winStyle = 0L;
 
    newbox->type = DW_VERT;
-   newbox->vsize = newbox->hsize = SIZEEXPAND;
+   newbox->vsize = newbox->hsize = _DW_SIZE_EXPAND;
 
    flStyle |= FCF_NOBYTEALIGN;
 
@@ -7492,9 +7492,9 @@
       Item *item = _dw_box_item(handle);
 
       /* Check to see if any of the sizes need to be recalculated */
-      if(item && (item->origwidth == -1 || item->origheight == -1))
-      {
-         _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+      if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+      {
+         _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
          /* Queue a redraw on the top-level window */
          _dw_redraw(_dw_toplevel_window(handle), TRUE);
       }
@@ -7672,19 +7672,19 @@
       Item *item = _dw_box_item(handle);
 
       /* Check to see if any of the sizes need to be recalculated */
-      if(item && (item->origwidth == -1 || item->origheight == -1))
+      if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
       {
          int newwidth, newheight;
 
          _dw_control_size(handle, &newwidth, &newheight);
 
          /* Only update the item and redraw the window if it changed */
-         if((item->origwidth == -1 && item->width != newwidth) ||
-            (item->origheight == -1 && item->height != newheight))
-         {
-            if(item->origwidth == -1)
+         if((item->origwidth == DW_SIZE_AUTO && item->width != newwidth) ||
+            (item->origheight == DW_SIZE_AUTO && item->height != newheight))
+         {
+            if(item->origwidth == DW_SIZE_AUTO)
                item->width = newwidth;
-            if(item->origheight == -1)
+            if(item->origheight == DW_SIZE_AUTO)
                item->height = newheight;
             /* Queue a redraw on the top-level window */
             _dw_redraw(_dw_toplevel_window(handle), TRUE);
@@ -7927,7 +7927,7 @@
          width = 1;
 
       if(strncmp(tmpbuf, "#1", 3)==0 && !dw_window_get_data(item, "_dw_render"))
-         tmpitem[index].type = TYPEBOX;
+         tmpitem[index].type = _DW_TYPE_BOX;
       else
       {
          if ( width == 0 && hsize == FALSE )
@@ -7935,19 +7935,19 @@
          if ( height == 0 && vsize == FALSE )
             dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
 
-         tmpitem[index].type = TYPEITEM;
+         tmpitem[index].type = _DW_TYPE_ITEM;
       }
 
       tmpitem[index].hwnd = item;
       tmpitem[index].origwidth = tmpitem[index].width = width;
       tmpitem[index].origheight = tmpitem[index].height = height;
       tmpitem[index].pad = pad;
-      tmpitem[index].hsize = hsize ? SIZEEXPAND : SIZESTATIC;
-      tmpitem[index].vsize = vsize ? SIZEEXPAND : SIZESTATIC;
-
-      /* If either of the parameters are -1 ... calculate the size */
-      if(width == -1 || height == -1)
-         _dw_control_size(item, width == -1 ? &tmpitem[index].width : NULL, height == -1 ? &tmpitem[index].height : NULL);
+      tmpitem[index].hsize = hsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+      tmpitem[index].vsize = vsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+
+      /* If either of the parameters are -1 (DW_SIZE_AUTO) ... calculate the size */
+      if(width == DW_SIZE_AUTO || height == DW_SIZE_AUTO)
+         _dw_control_size(item, width == DW_SIZE_AUTO ? &tmpitem[index].width : NULL, height == DW_SIZE_AUTO ? &tmpitem[index].height : NULL);
 
       thisbox->items = tmpitem;
 
--- a/template/dw.c	Sat Dec 18 19:31:57 2021 +0000
+++ b/template/dw.c	Sun Dec 19 15:39:43 2021 +0000
@@ -75,7 +75,7 @@
    {
       int itempad, itemwidth, itemheight;
         
-      if(thisbox->items[z].type == TYPEBOX)
+      if(thisbox->items[z].type == _DW_TYPE_BOX)
       {
          Box *tmp = (Box *)_dw_window_pointer_get(thisbox->items[z].hwnd);
 
@@ -111,7 +111,7 @@
          if(itemwidth > uxmax)
             uxmax = itemwidth;
             
-         if(thisbox->items[z].hsize != SIZEEXPAND)
+         if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
          {
             if(itemwidth > upxmax)
                upxmax = itemwidth;
@@ -122,7 +122,7 @@
                upxmax = itempad;
          }
          thisbox->minheight += itemheight;
-         if(thisbox->items[z].vsize != SIZEEXPAND)
+         if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
             thisbox->usedpady += itemheight;
          else
             thisbox->usedpady += itempad;
@@ -131,7 +131,7 @@
       {
          if(itemheight > uymax)
             uymax = itemheight;
-         if(thisbox->items[z].vsize != SIZEEXPAND)
+         if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
          {
             if(itemheight > upymax)
                upymax = itemheight;
@@ -142,7 +142,7 @@
                upymax = itempad;
          }
          thisbox->minwidth += itemwidth;
-         if(thisbox->items[z].hsize != SIZEEXPAND)
+         if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
             thisbox->usedpadx += itemwidth;
          else
             thisbox->usedpadx += itempad;
@@ -173,7 +173,7 @@
          int thispad = thisbox->pad * 2;
 
          /* Calculate the new sizes */
-         if(thisbox->items[z].hsize == SIZEEXPAND)
+         if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
          {
             if(thisbox->type == DW_HORZ)
             {
@@ -185,7 +185,7 @@
             else
                width = x - (itempad + thispad + thisbox->grouppadx);
          }
-         if(thisbox->items[z].vsize == SIZEEXPAND)
+         if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
          {
             if(thisbox->type == DW_VERT)
             {
@@ -602,23 +602,23 @@
 
     /* Fill in the item data appropriately */
     if(0 /* Test to see if "item" is a box */)
-       tmpitem[index].type = TYPEBOX;
+       tmpitem[index].type = _DW_TYPE_BOX;
     else
-       tmpitem[index].type = TYPEITEM;
+       tmpitem[index].type = _DW_TYPE_ITEM;
 
     tmpitem[index].hwnd = item;
     tmpitem[index].origwidth = tmpitem[index].width = width;
     tmpitem[index].origheight = tmpitem[index].height = height;
     tmpitem[index].pad = pad;
     if(hsize)
-       tmpitem[index].hsize = SIZEEXPAND;
+       tmpitem[index].hsize = _DW_SIZE_EXPAND;
     else
-       tmpitem[index].hsize = SIZESTATIC;
+       tmpitem[index].hsize = _DW_SIZE_STATIC;
 
     if(vsize)
-       tmpitem[index].vsize = SIZEEXPAND;
+       tmpitem[index].vsize = _DW_SIZE_EXPAND;
     else
-       tmpitem[index].vsize = SIZESTATIC;
+       tmpitem[index].vsize = _DW_SIZE_STATIC;
 
     thisbox->items = tmpitem;
 
--- a/win/dw.c	Sat Dec 18 19:31:57 2021 +0000
+++ b/win/dw.c	Sun Dec 19 15:39:43 2021 +0000
@@ -1463,7 +1463,7 @@
 
    for(z=beg;_dw_focus_comp(direction, z, end);z+=direction)
    {
-      if(box->items[z].type == TYPEBOX)
+      if(box->items[z].type == _DW_TYPE_BOX)
       {
          Box *thisbox = (Box *)GetWindowLongPtr(box->items[z].hwnd, GWLP_USERDATA);
 
@@ -1694,7 +1694,7 @@
    {
       int itempad, itemwidth, itemheight;
 
-      if(thisbox->items[z].type == TYPEBOX)
+      if(thisbox->items[z].type == _DW_TYPE_BOX)
       {
          Box *tmp = (Box *)GetWindowLongPtr(thisbox->items[z].hwnd, GWLP_USERDATA);
 
@@ -1736,7 +1736,7 @@
          if(itemwidth > uxmax)
             uxmax = itemwidth;
 
-         if(thisbox->items[z].hsize != SIZEEXPAND)
+         if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
          {
             if(itemwidth > upxmax)
                upxmax = itemwidth;
@@ -1747,7 +1747,7 @@
                upxmax = itempad;
          }
          thisbox->minheight += itemheight;
-         if(thisbox->items[z].vsize != SIZEEXPAND)
+         if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
             thisbox->usedpady += itemheight;
          else
             thisbox->usedpady += itempad;
@@ -1756,7 +1756,7 @@
       {
          if(itemheight > uymax)
             uymax = itemheight;
-         if(thisbox->items[z].vsize != SIZEEXPAND)
+         if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
          {
             if(itemheight > upymax)
                upymax = itemheight;
@@ -1767,7 +1767,7 @@
                upymax = itempad;
          }
          thisbox->minwidth += itemwidth;
-         if(thisbox->items[z].hsize != SIZEEXPAND)
+         if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
             thisbox->usedpadx += itemwidth;
          else
             thisbox->usedpadx += itempad;
@@ -1798,7 +1798,7 @@
          int thispad = thisbox->pad * 2;
 
          /* Calculate the new sizes */
-         if(thisbox->items[z].hsize == SIZEEXPAND)
+         if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
          {
             if(thisbox->type == DW_HORZ)
             {
@@ -1810,7 +1810,7 @@
             else
                width = x - (itempad + thispad + thisbox->grouppadx);
          }
-         if(thisbox->items[z].vsize == SIZEEXPAND)
+         if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
          {
             if(thisbox->type == DW_VERT)
             {
@@ -1973,7 +1973,7 @@
                   SetWindowPos(handle, HWND_TOP, currentx + pad + xborder, currenty + pad + yborder, width, height, 0);
 
                /* After placing a box... place its components */
-               if(thisbox->items[z].type == TYPEBOX)
+               if(thisbox->items[z].type == _DW_TYPE_BOX)
                {
                   Box *boxinfo = (Box *)GetWindowLongPtr(handle, GWLP_USERDATA);
 
@@ -3894,7 +3894,7 @@
 
    for(z=0;z<thisbox->count;z++)
    {
-      if(thisbox->items[z].type == TYPEBOX)
+      if(thisbox->items[z].type == _DW_TYPE_BOX)
       {
          Box *tmp = (Box*)GetWindowLongPtr(thisbox->items[z].hwnd, GWLP_USERDATA);
          _dw_change_box(tmp, percent, type);
@@ -3903,12 +3903,12 @@
       {
          if(type == DW_HORZ)
          {
-            if(thisbox->items[z].hsize == SIZEEXPAND)
+            if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
                thisbox->items[z].width = (int)(((float)thisbox->items[z].origwidth) * (((float)percent)/((float)100.0)));
          }
          else
          {
-            if(thisbox->items[z].vsize == SIZEEXPAND)
+            if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
                thisbox->items[z].height = (int)(((float)thisbox->items[z].origheight) * (((float)percent)/((float)100.0)));
          }
       }
@@ -3929,14 +3929,14 @@
       float ratio = (float)percent/(float)100.0;
       Box *tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA);
 
-      newx = (int)((float)newx * ratio) - (SPLITBAR_WIDTH/2);
+      newx = (int)((float)newx * ratio) - (_DW_SPLITBAR_WIDTH/2);
 
       MoveWindow(handle1, 0, 0, newx, y, FALSE);
       _dw_do_resize(tmp, newx - 1, y - 1, 0, 0);
 
       tmp = (Box *)GetWindowLongPtr(handle2, GWLP_USERDATA);
 
-      newx = x - newx - SPLITBAR_WIDTH;
+      newx = x - newx - _DW_SPLITBAR_WIDTH;
 
       MoveWindow(handle2, x - newx, 0, newx, y, FALSE);
       _dw_do_resize(tmp, newx - 1, y - 1, 0, 0);
@@ -3949,14 +3949,14 @@
       float ratio = (float)(100.0-percent)/(float)100.0;
       Box *tmp = (Box *)GetWindowLongPtr(handle2, GWLP_USERDATA);
 
-      newy = (int)((float)newy * ratio) - (SPLITBAR_WIDTH/2);
+      newy = (int)((float)newy * ratio) - (_DW_SPLITBAR_WIDTH/2);
 
       MoveWindow(handle2, 0, y - newy, x, newy, FALSE);
       _dw_do_resize(tmp, x - 1, newy - 1, 0, 0);
 
       tmp = (Box *)GetWindowLongPtr(handle1, GWLP_USERDATA);
 
-      newy = y - newy - SPLITBAR_WIDTH;
+      newy = y - newy - _DW_SPLITBAR_WIDTH;
 
       MoveWindow(handle1, 0, 0, x, newy, FALSE);
       _dw_do_resize(tmp, x - 1, newy - 1, 0, 0);
@@ -4068,9 +4068,9 @@
             dw_window_get_pos_size(hwnd, NULL, NULL, &cx, &cy);
 
             if(type == DW_HORZ)
-               Rectangle(hdcPaint, cx - start - SPLITBAR_WIDTH, 0, cx - start, cy);
+               Rectangle(hdcPaint, cx - start - _DW_SPLITBAR_WIDTH, 0, cx - start, cy);
             else
-               Rectangle(hdcPaint, 0, start, cx, start + SPLITBAR_WIDTH);
+               Rectangle(hdcPaint, 0, start, cx, start + _DW_SPLITBAR_WIDTH);
 
             SelectObject(hdcPaint, oldBrush);
             DeleteObject(SelectObject(hdcPaint, oldPen));
@@ -4120,14 +4120,14 @@
                   if(type == DW_HORZ)
                   {
                      start = point.x - rect.left;
-                     if(width - SPLITBAR_WIDTH > 1 && start < width - SPLITBAR_WIDTH)
-                        *percent = ((float)start / (float)(width - SPLITBAR_WIDTH)) * (float)100.0;
+                     if(width - _DW_SPLITBAR_WIDTH > 1 && start < width - _DW_SPLITBAR_WIDTH)
+                        *percent = ((float)start / (float)(width - _DW_SPLITBAR_WIDTH)) * (float)100.0;
                   }
                   else
                   {
                      start = point.y - rect.top;
-                     if(height - SPLITBAR_WIDTH > 1 && start < height - SPLITBAR_WIDTH)
-                        *percent = ((float)start / (float)(height - SPLITBAR_WIDTH)) * (float)100.0;
+                     if(height - _DW_SPLITBAR_WIDTH > 1 && start < height - _DW_SPLITBAR_WIDTH)
+                        *percent = ((float)start / (float)(height - _DW_SPLITBAR_WIDTH)) * (float)100.0;
                   }
                   _dw_handle_splitbar_resize(hwnd, *percent, type, width, height);
                }
@@ -5753,9 +5753,9 @@
           DeleteObject(oldfont);
 
        /* Check to see if any of the sizes need to be recalculated */
-       if(item && (item->origwidth == -1 || item->origheight == -1))
+       if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
        {
-          _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+          _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
           /* Queue a redraw on the top-level window */
          _dw_redraw(_dw_toplevel_window(handle), TRUE);
        }
@@ -5990,7 +5990,7 @@
 #endif
 
    newbox->type = DW_VERT;
-   newbox->vsize = newbox->hsize = SIZEEXPAND;
+   newbox->vsize = newbox->hsize = _DW_SIZE_EXPAND;
    newbox->cinfo.fore = newbox->cinfo.back = -1;
    newbox->cinfo.style = flStyle;
 
@@ -7763,9 +7763,9 @@
       Item *item = _dw_box_item(handle);
 
       /* Check to see if any of the sizes need to be recalculated */
-      if(item && (item->origwidth == -1 || item->origheight == -1))
-      {
-         _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL);
+      if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
+      {
+         _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
          /* Queue a redraw on the top-level window */
          _dw_redraw(_dw_toplevel_window(handle), TRUE);
       }
@@ -7899,19 +7899,19 @@
       Item *item = _dw_box_item(handle);
 
       /* Check to see if any of the sizes need to be recalculated */
-      if(item && (item->origwidth == -1 || item->origheight == -1))
+      if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
       {
          int newwidth, newheight;
 
          _dw_control_size(handle, &newwidth, &newheight);
 
          /* Only update the item and redraw the window if it changed */
-         if((item->origwidth == -1 && item->width != newwidth) ||
-            (item->origheight == -1 && item->height != newheight))
-         {
-            if(item->origwidth == -1)
+         if((item->origwidth == DW_SIZE_AUTO && item->width != newwidth) ||
+            (item->origheight == DW_SIZE_AUTO && item->height != newheight))
+         {
+            if(item->origwidth == DW_SIZE_AUTO)
                item->width = newwidth;
-            if(item->origheight == -1)
+            if(item->origheight == DW_SIZE_AUTO)
                item->height = newheight;
             /* Queue a redraw on the top-level window */
             _dw_redraw(_dw_toplevel_window(handle), TRUE);
@@ -8107,7 +8107,7 @@
          width = 1;
 
       if(_tcsnicmp(tmpbuf, FRAMECLASSNAME, _tcslen(FRAMECLASSNAME)+1)==0)
-         tmpitem[index].type = TYPEBOX;
+         tmpitem[index].type = _DW_TYPE_BOX;
       else
       {
          if(_tcsnicmp(tmpbuf, TEXT("SysMonthCal32"), 13)==0)
@@ -8116,7 +8116,7 @@
             MonthCal_GetMinReqRect(item, &rc);
             width = 1 + rc.right - rc.left;
             height = 1 + rc.bottom - rc.top;
-            tmpitem[index].type = TYPEITEM;
+            tmpitem[index].type = _DW_TYPE_ITEM;
          }
          else
          {
@@ -8125,7 +8125,7 @@
             if ( height == 0 && vsize == FALSE )
                dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
 
-            tmpitem[index].type = TYPEITEM;
+            tmpitem[index].type = _DW_TYPE_ITEM;
          }
       }
 
@@ -8133,12 +8133,12 @@
       tmpitem[index].origwidth = tmpitem[index].width = width;
       tmpitem[index].origheight = tmpitem[index].height = height;
       tmpitem[index].pad = pad;
-      tmpitem[index].hsize = hsize ? SIZEEXPAND : SIZESTATIC;
-      tmpitem[index].vsize = vsize ? SIZEEXPAND : SIZESTATIC;
-
-      /* If either of the parameters are -1 ... calculate the size */
-      if(width == -1 || height == -1)
-         _dw_control_size(item, width == -1 ? &tmpitem[index].width : NULL, height == -1 ? &tmpitem[index].height : NULL);
+      tmpitem[index].hsize = hsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+      tmpitem[index].vsize = vsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
+
+      /* If either of the parameters are -1 (DW_SIZE_AUTO) ... calculate the size */
+      if(width == DW_SIZE_AUTO || height == DW_SIZE_AUTO)
+         _dw_control_size(item, width == DW_SIZE_AUTO ? &tmpitem[index].width : NULL, height == DW_SIZE_AUTO ? &tmpitem[index].height : NULL);
 
       thisbox->items = tmpitem;