comparison mac/dw.m @ 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
comparison
equal deleted inserted replaced
798:1b0a0775ec19 799:3aa5d0777af2
1628 int thispady = thisbox->pad * 2; 1628 int thispady = thisbox->pad * 2;
1629 1629
1630 /* Handle special groupbox case */ 1630 /* Handle special groupbox case */
1631 if(thisbox->grouphwnd) 1631 if(thisbox->grouphwnd)
1632 { 1632 {
1633 if(thispadx < _DW_GROUPBOX_BORDER_X) 1633 thisbox->grouppadx = _DW_GROUPBOX_BORDER_X;
1634 { 1634 thisbox->grouppady = _DW_GROUPBOX_BORDER_Y;
1635 thispadx = _DW_GROUPBOX_BORDER_X; 1635
1636 } 1636 (*usedx) += thisbox->grouppadx;
1637 if(thispady < _DW_GROUPBOX_BORDER_Y) 1637 (*usedpadx) += thisbox->grouppadx;
1638 { 1638 (*usedy) += thisbox->grouppady;
1639 thispady = _DW_GROUPBOX_BORDER_Y; 1639 (*usedpady) += thisbox->grouppady;
1640 }
1641 } 1640 }
1642 1641
1643 (*usedx) += thispadx; 1642 (*usedx) += thispadx;
1644 (*usedy) += thispady; 1643 (*usedy) += thispady;
1645 1644
1660 int nux = *usedx, nuy = *usedy; 1659 int nux = *usedx, nuy = *usedy;
1661 int tmppadx = tmp->pad*2; 1660 int tmppadx = tmp->pad*2;
1662 int tmppady = tmp->pad*2; 1661 int tmppady = tmp->pad*2;
1663 int upx, upy; 1662 int upx, upy;
1664 1663
1665 /* Handle special groupbox case */
1666 if(tmp->grouphwnd)
1667 {
1668 if(tmppadx < _DW_GROUPBOX_BORDER_X)
1669 {
1670 tmppadx = _DW_GROUPBOX_BORDER_X;
1671 }
1672 if(tmppady < _DW_GROUPBOX_BORDER_Y)
1673 {
1674 tmppady = _DW_GROUPBOX_BORDER_Y;
1675 }
1676 }
1677
1678 upx = *usedpadx + tmppadx; 1664 upx = *usedpadx + tmppadx;
1679 upy = *usedpady + tmppady; 1665 upy = *usedpady + tmppady;
1680 1666
1681 /* On the second pass we know how big the box needs to be and how 1667 /* On the second pass we know how big the box needs to be and how
1682 * much space we have, so we can calculate a ratio for the new box. 1668 * much space we have, so we can calculate a ratio for the new box.
1861 (*usedx) += uxmax; 1847 (*usedx) += uxmax;
1862 (*usedy) += uymax; 1848 (*usedy) += uymax;
1863 (*usedpadx) += upxmax; 1849 (*usedpadx) += upxmax;
1864 (*usedpady) += upymax; 1850 (*usedpady) += upymax;
1865 1851
1866 if(thisbox->grouphwnd) 1852 currentx += thisbox->pad;
1867 { 1853 currenty += thisbox->pad;
1868 if(thisbox->pad > _DW_GROUPBOX_BORDER)
1869 {
1870 currentx += thisbox->pad - _DW_GROUPBOX_BORDER;
1871 }
1872 if(thisbox->pad > _DW_GROUPBOX_BORDER_X)
1873 {
1874 currenty += thisbox->pad - _DW_GROUPBOX_BORDER_X;
1875 }
1876 }
1877 else
1878 {
1879 currentx += thisbox->pad;
1880 currenty += thisbox->pad;
1881 }
1882 1854
1883 /* The second pass is for expansion and actual placement. */ 1855 /* The second pass is for expansion and actual placement. */
1884 if(pass > 1) 1856 if(pass > 1)
1885 { 1857 {
1886 /* Any SIZEEXPAND items should be set to uxmax/uymax */ 1858 /* Any SIZEEXPAND items should be set to uxmax/uymax */