Mercurial > dwindows
comparison mac/dw.m @ 1411:22ba64e357de
Initial versions of code to figure out control sizes for Windows and OS/2...
and some fixes for the Mac version.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 02 Dec 2011 08:22:11 +0000 |
parents | c607fd86e5c2 |
children | 461240f946d0 |
comparison
equal
deleted
inserted
replaced
1410:c607fd86e5c2 | 1411:22ba64e357de |
---|---|
3532 switch([object buttonType]) | 3532 switch([object buttonType]) |
3533 { | 3533 { |
3534 case NSSwitchButton: | 3534 case NSSwitchButton: |
3535 case NSRadioButton: | 3535 case NSRadioButton: |
3536 extrawidth = 24; | 3536 extrawidth = 24; |
3537 extraheight = 4; | 3537 extraheight = 4; |
3538 break; | 3538 break; |
3539 default: | 3539 default: |
3540 if([object isBordered]) | 3540 if([object isBordered]) |
3541 { | 3541 { |
3542 extrawidth = 30; | 3542 extrawidth = 30; |
3575 * calculate the size with the current font. | 3575 * calculate the size with the current font. |
3576 */ | 3576 */ |
3577 if(nsstr && [nsstr length]) | 3577 if(nsstr && [nsstr length]) |
3578 dw_font_text_extents_get(object, NULL, (char *)[nsstr UTF8String], &thiswidth, &thisheight); | 3578 dw_font_text_extents_get(object, NULL, (char *)[nsstr UTF8String], &thiswidth, &thisheight); |
3579 | 3579 |
3580 NSLog(@"Class %@ Width %d Height %d Extra Width %d Extra Height %d\n", [object className], thiswidth, thisheight, extrawidth, extraheight); | |
3581 /* Set the requested sizes */ | 3580 /* Set the requested sizes */ |
3582 if(width) | 3581 if(width) |
3583 *width = thiswidth + extrawidth; | 3582 *width = thiswidth + extrawidth; |
3584 if(height) | 3583 if(height) |
3585 *height = thisheight + extraheight; | 3584 *height = thisheight + extraheight; |