# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1326476422 0 # Node ID ca6be9c48fff8800ac69ed4b1ab3c3d6c37ae3d5 # Parent ef7959aae8daf00a63f1b7904d0a0e3a1f02df15 Implemented auto-sizing containers on Mac. diff -r ef7959aae8da -r ca6be9c48fff mac/dw.m --- a/mac/dw.m Fri Jan 13 17:07:52 2012 +0000 +++ b/mac/dw.m Fri Jan 13 17:40:22 2012 +0000 @@ -3532,9 +3532,25 @@ thisheight = size.height; } } - /* MLE, Container and Tree */ + /* Container */ + else if([ object isMemberOfClass:[DWContainer class] ]) + { + NSRect rect = [object frame]; + + thiswidth = rect.size.width; + thisheight = rect.size.height; + + if(thiswidth < _DW_SCROLLED_MIN_WIDTH) + thiswidth = _DW_SCROLLED_MIN_WIDTH; + if(thiswidth > _DW_SCROLLED_MAX_WIDTH) + thiswidth = _DW_SCROLLED_MAX_WIDTH; + if(thisheight < _DW_SCROLLED_MIN_HEIGHT) + thisheight = _DW_SCROLLED_MIN_HEIGHT; + if(thisheight > _DW_SCROLLED_MAX_HEIGHT) + thisheight = _DW_SCROLLED_MAX_HEIGHT; + } + /* MLE and Tree */ else if([ object isMemberOfClass:[DWMLE class] ] || - [ object isMemberOfClass:[DWContainer class] ] || [ object isMemberOfClass:[DWTree class] ]) { thiswidth = _DW_SCROLLED_MAX_WIDTH; @@ -8166,7 +8182,8 @@ /* Some controls are embedded in scrollviews... * so get the parent of the scrollview in that case. */ - if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSClipView class]]) + if(([object isKindOfClass:[NSTableView class]] || [object isMemberOfClass:[DWMLE class]]) + && [parent isMemberOfClass:[NSClipView class]]) { object = [parent superview]; parent = (DWBox *)[object superview];