Mercurial > dwindows
comparison mac/dw.m @ 1531:783a464afab2
Added window and box support to dw_window_get_preferred_size() on OS/2 and Windows.
Fixed a number of potentially dangerous code segments on OS/2 and Windows.
Updated inaccurate comments due to cut and paste and code changes and the readme.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 07 Jan 2012 13:59:58 +0000 |
parents | eecfceaf581f |
children | 7bc189ef0cd0 |
comparison
equal
deleted
inserted
replaced
1530:eecfceaf581f | 1531:783a464afab2 |
---|---|
8522 int depth = 0; | 8522 int depth = 0; |
8523 | 8523 |
8524 /* Calculate space requirements */ | 8524 /* Calculate space requirements */ |
8525 _resize_box(thisbox, &depth, (int)width, (int)height, 1); | 8525 _resize_box(thisbox, &depth, (int)width, (int)height, 1); |
8526 | 8526 |
8527 /* Might need to take into account the window border here */ | 8527 /* Update components that need auto-sizing */ |
8528 if(width < 1) content.size.width = thisbox->minwidth; | 8528 if(width < 1) content.size.width = thisbox->minwidth; |
8529 if(height < 1) content.size.height = thisbox->minheight; | 8529 if(height < 1) content.size.height = thisbox->minheight; |
8530 } | 8530 } |
8531 | 8531 |
8532 /* Finally set the size */ | 8532 /* Finally set the size */ |
8556 NSRect frame; | 8556 NSRect frame; |
8557 | 8557 |
8558 /* Calculate space requirements */ | 8558 /* Calculate space requirements */ |
8559 _resize_box(thisbox, &depth, 0, 0, 1); | 8559 _resize_box(thisbox, &depth, 0, 0, 1); |
8560 | 8560 |
8561 /* Figure out the border size */ | |
8561 frame = [NSWindow frameRectForContentRect:NSMakeRect(0, 0, thisbox->minwidth, thisbox->minheight) styleMask:[object styleMask]]; | 8562 frame = [NSWindow frameRectForContentRect:NSMakeRect(0, 0, thisbox->minwidth, thisbox->minheight) styleMask:[object styleMask]]; |
8562 | 8563 |
8563 /* Might need to take into account the window border here */ | 8564 /* Return what was requested */ |
8564 if(width) *width = frame.size.width; | 8565 if(width) *width = frame.size.width; |
8565 if(height) *height = frame.size.height; | 8566 if(height) *height = frame.size.height; |
8566 } | 8567 } |
8567 } | 8568 } |
8568 else if([object isMemberOfClass:[DWBox class]]) | 8569 else if([object isMemberOfClass:[DWBox class]]) |
8574 int depth = 0; | 8575 int depth = 0; |
8575 | 8576 |
8576 /* Calculate space requirements */ | 8577 /* Calculate space requirements */ |
8577 _resize_box(thisbox, &depth, 0, 0, 1); | 8578 _resize_box(thisbox, &depth, 0, 0, 1); |
8578 | 8579 |
8579 /* Might need to take into account the window border here */ | 8580 /* Return what was requested */ |
8580 if(width) *width = thisbox->minwidth; | 8581 if(width) *width = thisbox->minwidth; |
8581 if(height) *height = thisbox->minheight; | 8582 if(height) *height = thisbox->minheight; |
8582 } | 8583 } |
8583 } | 8584 } |
8584 else | 8585 else |