# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1323284585 0 # Node ID 18c1b999dd65fd24172ce6780bb7d9762acd9df0 # Parent 3c5287b8eebbd51a64107c080508a20738de3046 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. diff -r 3c5287b8eebb -r 18c1b999dd65 os2/dw.c --- 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) diff -r 3c5287b8eebb -r 18c1b999dd65 win/dw.c --- 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)