Mercurial > dwindows
comparison mac/dw.m @ 1549:ca6be9c48fff
Implemented auto-sizing containers on Mac.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 13 Jan 2012 17:40:22 +0000 |
parents | b86a04751ea0 |
children | cf897886ceeb |
comparison
equal
deleted
inserted
replaced
1548:ef7959aae8da | 1549:ca6be9c48fff |
---|---|
3530 | 3530 |
3531 thiswidth = size.width; | 3531 thiswidth = size.width; |
3532 thisheight = size.height; | 3532 thisheight = size.height; |
3533 } | 3533 } |
3534 } | 3534 } |
3535 /* MLE, Container and Tree */ | 3535 /* Container */ |
3536 else if([ object isMemberOfClass:[DWContainer class] ]) | |
3537 { | |
3538 NSRect rect = [object frame]; | |
3539 | |
3540 thiswidth = rect.size.width; | |
3541 thisheight = rect.size.height; | |
3542 | |
3543 if(thiswidth < _DW_SCROLLED_MIN_WIDTH) | |
3544 thiswidth = _DW_SCROLLED_MIN_WIDTH; | |
3545 if(thiswidth > _DW_SCROLLED_MAX_WIDTH) | |
3546 thiswidth = _DW_SCROLLED_MAX_WIDTH; | |
3547 if(thisheight < _DW_SCROLLED_MIN_HEIGHT) | |
3548 thisheight = _DW_SCROLLED_MIN_HEIGHT; | |
3549 if(thisheight > _DW_SCROLLED_MAX_HEIGHT) | |
3550 thisheight = _DW_SCROLLED_MAX_HEIGHT; | |
3551 } | |
3552 /* MLE and Tree */ | |
3536 else if([ object isMemberOfClass:[DWMLE class] ] || | 3553 else if([ object isMemberOfClass:[DWMLE class] ] || |
3537 [ object isMemberOfClass:[DWContainer class] ] || | |
3538 [ object isMemberOfClass:[DWTree class] ]) | 3554 [ object isMemberOfClass:[DWTree class] ]) |
3539 { | 3555 { |
3540 thiswidth = _DW_SCROLLED_MAX_WIDTH; | 3556 thiswidth = _DW_SCROLLED_MAX_WIDTH; |
3541 thisheight = _DW_SCROLLED_MAX_HEIGHT; | 3557 thisheight = _DW_SCROLLED_MAX_HEIGHT; |
3542 } | 3558 } |
8164 DWBox *parent = (DWBox *)[object superview]; | 8180 DWBox *parent = (DWBox *)[object superview]; |
8165 | 8181 |
8166 /* Some controls are embedded in scrollviews... | 8182 /* Some controls are embedded in scrollviews... |
8167 * so get the parent of the scrollview in that case. | 8183 * so get the parent of the scrollview in that case. |
8168 */ | 8184 */ |
8169 if([object isKindOfClass:[NSTableView class]] && [parent isMemberOfClass:[NSClipView class]]) | 8185 if(([object isKindOfClass:[NSTableView class]] || [object isMemberOfClass:[DWMLE class]]) |
8186 && [parent isMemberOfClass:[NSClipView class]]) | |
8170 { | 8187 { |
8171 object = [parent superview]; | 8188 object = [parent superview]; |
8172 parent = (DWBox *)[object superview]; | 8189 parent = (DWBox *)[object superview]; |
8173 } | 8190 } |
8174 | 8191 |