diff win/dw.c @ 1436:18c1b999dd65

Similar fix for OS/2 and Windows as just committed on Mac... Also removed some old code that was never used and is now obsolete on OS/2, Mac and Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 07 Dec 2011 19:03:05 +0000
parents 2cca36ec3da6
children bde7ebced556
line wrap: on
line diff
--- a/win/dw.c	Wed Dec 07 18:51:48 2011 +0000
+++ b/win/dw.c	Wed Dec 07 19:03:05 2011 +0000
@@ -1208,6 +1208,8 @@
                tmp->parentyratio = thisbox->yratio;
 
                tmp->parentpad = tmp->pad;
+               tmp->hsize = thisbox->items[z].hsize;
+               tmp->vsize = thisbox->items[z].vsize;
 
                /* Just in case */
                tmp->xratio = thisbox->xratio;
@@ -1328,19 +1330,11 @@
       }
       else
       {
-         if(thisbox->items[z].width == -1)
-         {
-            /* figure out how much space this item requires */
-            /* thisbox->items[z].width = */
-         }
+         (*usedx) += thisbox->items[z].width + (thisbox->items[z].pad*2);
+         if(thisbox->items[z].hsize != SIZEEXPAND)
+            (*usedpadx) += (thisbox->items[z].pad*2) + thisbox->items[z].width;
          else
-         {
-            (*usedx) += thisbox->items[z].width + (thisbox->items[z].pad*2);
-            if(thisbox->items[z].hsize != SIZEEXPAND)
-               (*usedpadx) += (thisbox->items[z].pad*2) + thisbox->items[z].width;
-            else
-               (*usedpadx) += thisbox->items[z].pad*2;
-         }
+            (*usedpadx) += thisbox->items[z].pad*2;
       }
       if(thisbox->type == DW_HORZ)
       {
@@ -1361,19 +1355,11 @@
       }
       else
       {
-         if(thisbox->items[z].height == -1)
-         {
-            /* figure out how much space this item requires */
-            /* thisbox->items[z].height = */
-         }
+         (*usedy) += thisbox->items[z].height + (thisbox->items[z].pad*2);
+         if(thisbox->items[z].vsize != SIZEEXPAND)
+            (*usedpady) += (thisbox->items[z].pad*2) + thisbox->items[z].height;
          else
-         {
-            (*usedy) += thisbox->items[z].height + (thisbox->items[z].pad*2);
-            if(thisbox->items[z].vsize != SIZEEXPAND)
-               (*usedpady) += (thisbox->items[z].pad*2) + thisbox->items[z].height;
-            else
-               (*usedpady) += thisbox->items[z].pad*2;
-         }
+            (*usedpady) += thisbox->items[z].pad*2;
       }
    }
 
@@ -1470,6 +1456,17 @@
             if(thisbox->items[z].hsize != SIZEEXPAND)
                vectorx = 0;
 
+            if(thisbox->type == DW_VERT && thisbox->hsize == SIZESTATIC && thisbox->items[z].hsize == SIZEEXPAND && thisbox->width)
+            {
+               width = thisbox->width;
+               vectorx = 0;
+            }
+            if(thisbox->type == DW_HORZ && thisbox->vsize == SIZESTATIC && thisbox->items[z].vsize == SIZEEXPAND && thisbox->height)
+            {
+               height = thisbox->height;
+               vectory = 0;
+            }
+               
             GetClassName(handle, tmpbuf, 99);
 
             if(strnicmp(tmpbuf, COMBOBOXCLASSNAME, strlen(COMBOBOXCLASSNAME)+1)==0)