changeset 799:3aa5d0777af2

So after looking at the Windows code... I realized it worked differently than I was thinking... So I reimplemented the groupbox calculation fix to be the same as it is done on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 23 Mar 2011 19:18:37 +0000
parents 1b0a0775ec19
children e5a0a1a3ee03
files mac/dw.m
diffstat 1 files changed, 9 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Wed Mar 23 17:49:25 2011 +0000
+++ b/mac/dw.m	Wed Mar 23 19:18:37 2011 +0000
@@ -1630,14 +1630,13 @@
     /* Handle special groupbox case */
     if(thisbox->grouphwnd)
     {
-        if(thispadx < _DW_GROUPBOX_BORDER_X)
-        {
-            thispadx = _DW_GROUPBOX_BORDER_X;
-        }
-        if(thispady < _DW_GROUPBOX_BORDER_Y)
-        {
-            thispady = _DW_GROUPBOX_BORDER_Y;
-        }
+        thisbox->grouppadx = _DW_GROUPBOX_BORDER_X;
+        thisbox->grouppady = _DW_GROUPBOX_BORDER_Y;
+        
+        (*usedx) += thisbox->grouppadx;
+        (*usedpadx) += thisbox->grouppadx;
+        (*usedy) += thisbox->grouppady;
+        (*usedpady) += thisbox->grouppady;
     }
     
    (*usedx) += thispadx;
@@ -1662,19 +1661,6 @@
             int tmppady = tmp->pad*2;
             int upx, upy;
             
-            /* Handle special groupbox case */
-            if(tmp->grouphwnd)
-            {
-                if(tmppadx < _DW_GROUPBOX_BORDER_X)
-                {
-                    tmppadx = _DW_GROUPBOX_BORDER_X;
-                }
-                if(tmppady < _DW_GROUPBOX_BORDER_Y)
-                {
-                    tmppady = _DW_GROUPBOX_BORDER_Y;
-                }
-            }
-             
             upx = *usedpadx + tmppadx;
             upy = *usedpady + tmppady;
 
@@ -1863,22 +1849,8 @@
    (*usedpadx) += upxmax;
    (*usedpady) += upymax;
 
-   if(thisbox->grouphwnd)
-   {
-       if(thisbox->pad > _DW_GROUPBOX_BORDER)
-       {
-           currentx += thisbox->pad - _DW_GROUPBOX_BORDER;
-       }
-       if(thisbox->pad > _DW_GROUPBOX_BORDER_X)
-       {
-           currenty += thisbox->pad - _DW_GROUPBOX_BORDER_X;
-       }
-   }
-   else
-   {
-       currentx += thisbox->pad;
-       currenty += thisbox->pad;
-   }
+    currentx += thisbox->pad;
+    currenty += thisbox->pad;
 
    /* The second pass is for expansion and actual placement. */
    if(pass > 1)