Mercurial > dwindows
comparison mac/dw.m @ 1791:ed8851658015
Set status text fields in the test program to auto height... because they were too small on Mac.... this caused me to notice a bug in the calculation of (status) text widgets when the text is empty; this also contains a fix for that bug.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 05 Aug 2012 13:02:39 +0000 |
parents | 9d499b162fe1 |
children | b0bdec1b820c |
comparison
equal
deleted
inserted
replaced
1790:209c57a14b09 | 1791:ed8851658015 |
---|---|
3692 break; | 3692 break; |
3693 } | 3693 } |
3694 } | 3694 } |
3695 } | 3695 } |
3696 /* If the control is an entryfield set width to 150 */ | 3696 /* If the control is an entryfield set width to 150 */ |
3697 else if([object isKindOfClass:[ NSTextField class ]] && [object isEditable]) | 3697 else if([object isKindOfClass:[ NSTextField class ]]) |
3698 { | 3698 { |
3699 NSFont *font = [object font]; | 3699 NSFont *font = [object font]; |
3700 /* Spinbuttons don't need to be as wide */ | 3700 |
3701 if([object isMemberOfClass:[ DWSpinButton class]]) | 3701 if([object isEditable]) |
3702 thiswidth = 50; | 3702 { |
3703 /* Spinbuttons don't need to be as wide */ | |
3704 if([object isMemberOfClass:[ DWSpinButton class]]) | |
3705 thiswidth = 50; | |
3706 else | |
3707 thiswidth = 150; | |
3708 /* Spinbuttons don't need to be as wide */ | |
3709 if([object isMemberOfClass:[ DWComboBox class]]) | |
3710 extraheight = 4; | |
3711 } | |
3703 else | 3712 else |
3704 thiswidth = 150; | 3713 nsstr = [object stringValue]; |
3714 | |
3705 if(font) | 3715 if(font) |
3706 thisheight = (int)[font boundingRectForFont].size.height; | 3716 thisheight = (int)[font boundingRectForFont].size.height; |
3707 /* Spinbuttons don't need to be as wide */ | |
3708 if([object isMemberOfClass:[ DWComboBox class]]) | |
3709 extraheight = 4; | |
3710 } | 3717 } |
3711 /* Handle the ranged widgets */ | 3718 /* Handle the ranged widgets */ |
3712 else if([ object isMemberOfClass:[DWPercent class] ] || | 3719 else if([ object isMemberOfClass:[DWPercent class] ] || |
3713 [ object isMemberOfClass:[DWSlider class] ]) | 3720 [ object isMemberOfClass:[DWSlider class] ]) |
3714 { | 3721 { |