changeset 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
files mac/dw.m
diffstat 1 files changed, 25 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Fri Dec 02 23:50:01 2011 +0000
+++ b/mac/dw.m	Fri Dec 02 23:56:40 2011 +0000
@@ -3552,28 +3552,30 @@
     /* Handle all the different button types */
     if([ object isKindOfClass:[ NSButton class ] ])
     {
-        NSImage *image = [object image];
-        
-        if(image)
-        {
-            /* Image button */
-            NSSize size = [image size];
-            thiswidth = (int)size.width;
-            thisheight = (int)size.height;
-        }
-        else
-        {
-            /* Text button */
-            nsstr = [object title];
-            
-            switch([object buttonType])
+        switch([object buttonType])
+        {
+            case NSSwitchButton:
+            case NSRadioButton:
+                extrawidth = 24;
+                extraheight = 4;
+                nsstr = [object title];
+                break;
+            default:
             {
-                case NSSwitchButton:
-                case NSRadioButton:
-                    extrawidth = 24;
-                    extraheight = 4;
-                    break;
-                default:
+                NSImage *image = [object image];
+                
+                if(image)
+                {
+                    /* Image button */
+                    NSSize size = [image size];
+                    thiswidth = (int)size.width;
+                    thisheight = (int)size.height;
+                }
+                else
+                {
+                    /* Text button */
+                    nsstr = [object title];
+                    
                     if([object isBordered])
                     {
                         extrawidth = 30;
@@ -3584,7 +3586,8 @@
                         extrawidth = 8;
                         extraheight = 4;
                     }
-                    break;
+                }
+                break;
             }
         }
     }