Mercurial > dwindows
comparison mac/dw.m @ 1420:fabf23bdc7fb
New Mac image button handling code was catching checkboxes/radiobuttons as well.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Fri, 02 Dec 2011 23:56:40 +0000 |
parents | 8827e9b14b40 |
children | 63d253a2cdd9 |
comparison
equal
deleted
inserted
replaced
1419:8827e9b14b40 | 1420:fabf23bdc7fb |
---|---|
3550 if([object isMemberOfClass:[ DWSpinButton class]]) | 3550 if([object isMemberOfClass:[ DWSpinButton class]]) |
3551 object = [object textfield]; | 3551 object = [object textfield]; |
3552 /* Handle all the different button types */ | 3552 /* Handle all the different button types */ |
3553 if([ object isKindOfClass:[ NSButton class ] ]) | 3553 if([ object isKindOfClass:[ NSButton class ] ]) |
3554 { | 3554 { |
3555 NSImage *image = [object image]; | 3555 switch([object buttonType]) |
3556 | 3556 { |
3557 if(image) | 3557 case NSSwitchButton: |
3558 { | 3558 case NSRadioButton: |
3559 /* Image button */ | 3559 extrawidth = 24; |
3560 NSSize size = [image size]; | 3560 extraheight = 4; |
3561 thiswidth = (int)size.width; | 3561 nsstr = [object title]; |
3562 thisheight = (int)size.height; | 3562 break; |
3563 } | 3563 default: |
3564 else | |
3565 { | |
3566 /* Text button */ | |
3567 nsstr = [object title]; | |
3568 | |
3569 switch([object buttonType]) | |
3570 { | 3564 { |
3571 case NSSwitchButton: | 3565 NSImage *image = [object image]; |
3572 case NSRadioButton: | 3566 |
3573 extrawidth = 24; | 3567 if(image) |
3574 extraheight = 4; | 3568 { |
3575 break; | 3569 /* Image button */ |
3576 default: | 3570 NSSize size = [image size]; |
3571 thiswidth = (int)size.width; | |
3572 thisheight = (int)size.height; | |
3573 } | |
3574 else | |
3575 { | |
3576 /* Text button */ | |
3577 nsstr = [object title]; | |
3578 | |
3577 if([object isBordered]) | 3579 if([object isBordered]) |
3578 { | 3580 { |
3579 extrawidth = 30; | 3581 extrawidth = 30; |
3580 extraheight = 8; | 3582 extraheight = 8; |
3581 } | 3583 } |
3582 else | 3584 else |
3583 { | 3585 { |
3584 extrawidth = 8; | 3586 extrawidth = 8; |
3585 extraheight = 4; | 3587 extraheight = 4; |
3586 } | 3588 } |
3587 break; | 3589 } |
3590 break; | |
3588 } | 3591 } |
3589 } | 3592 } |
3590 } | 3593 } |
3591 /* If the control is an entryfield set width to 150 */ | 3594 /* If the control is an entryfield set width to 150 */ |
3592 else if([object isKindOfClass:[ NSTextField class ]] && [object isEditable]) | 3595 else if([object isKindOfClass:[ NSTextField class ]] && [object isEditable]) |