diff 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
line wrap: on
line diff
--- a/mac/dw.m	Sat Aug 04 07:35:13 2012 +0000
+++ b/mac/dw.m	Sun Aug 05 13:02:39 2012 +0000
@@ -3694,19 +3694,26 @@
         }
     }
     /* If the control is an entryfield set width to 150 */
-    else if([object isKindOfClass:[ NSTextField class ]] && [object isEditable])
+    else if([object isKindOfClass:[ NSTextField class ]])
     {
         NSFont *font = [object font];
-        /* Spinbuttons don't need to be as wide */
-        if([object isMemberOfClass:[ DWSpinButton class]])
-            thiswidth = 50;
+        
+        if([object isEditable])
+        {
+            /* Spinbuttons don't need to be as wide */
+            if([object isMemberOfClass:[ DWSpinButton class]])
+                thiswidth = 50;
+            else
+                thiswidth = 150;
+            /* Spinbuttons don't need to be as wide */
+            if([object isMemberOfClass:[ DWComboBox class]])
+                extraheight = 4;
+        }
         else
-            thiswidth = 150;
+            nsstr = [object stringValue];
+        
         if(font)
             thisheight = (int)[font boundingRectForFont].size.height;
-        /* Spinbuttons don't need to be as wide */
-        if([object isMemberOfClass:[ DWComboBox class]])
-            extraheight = 4;
     }
     /* Handle the ranged widgets */
     else if([ object isMemberOfClass:[DWPercent class] ] ||