changeset 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 3c5287b8eebb
children a50e8b486a1a
files os2/dw.c win/dw.c
diffstat 2 files changed, 42 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Wed Dec 07 18:51:48 2011 +0000
+++ b/os2/dw.c	Wed Dec 07 19:03:05 2011 +0000
@@ -1141,6 +1141,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;
@@ -1261,19 +1263,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)
       {
@@ -1294,19 +1288,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;
       }
    }
 
@@ -1403,6 +1389,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;
+            }
+           
             WinQueryClassName(handle, 99, (PCH)tmpbuf);
 
             if(strncmp(tmpbuf, "#2", 3)==0)
--- 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)