changeset 1778:e71ab68198ce

Minor cleanups for the Mac status text changes for 10.8. Hopefully this will make DW ready for MacOS 10.8.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 17 Jul 2012 23:00:26 +0000
parents 0cdfb0c3f4ca
children f77b76c86d19
files mac/dw.m
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Mon Jul 16 23:11:01 2012 +0000
+++ b/mac/dw.m	Tue Jul 17 23:00:26 2012 +0000
@@ -3816,15 +3816,14 @@
     {
         id border = handle;
         
+        extrawidth = 10;
+        
         /* Handle status bar field */
         if([border isMemberOfClass:[ NSBox class ] ])
         {
-            extrawidth = 12;
-            extraheight = 4;
-        }
-        else
-            extrawidth = 10;
-        //dw_debug("this width %d height %d extra width %d height %d \"%s\"\n", thiswidth, thisheight, extrawidth, extraheight, (char *)[nsstr UTF8String]);
+            extrawidth += 2;
+            extraheight = 8;
+        }
     }
     
     /* Set the requested sizes */
@@ -5376,7 +5375,7 @@
     //[border setBorderType:NSLineBorder];
     [border setTitlePosition:NSNoTitle];
     [border setContentView:textfield];
-    [border setContentViewMargins:NSMakeSize(1,1)];
+    [border setContentViewMargins:NSMakeSize(1.5,1.5)];
     [textfield autorelease];
     [textfield setBackgroundColor:[NSColor clearColor]];
     [[textfield cell] setVCenter:YES];
@@ -8377,7 +8376,7 @@
  */
 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask)
 {
-    id object = handle;
+    id object = _text_handle(handle);
 
     if([object isMemberOfClass:[DWWindow class]])
     {
@@ -8400,11 +8399,12 @@
     else if([object isKindOfClass:[NSTextField class]])
     {
         NSTextField *tf = object;
-
-        [[tf cell] setAlignment:(style & 0xF)];
-        if(mask & DW_DT_VCENTER)
-        {
-            [[tf cell] setVCenter:(style & DW_DT_VCENTER ? YES : NO)];
+        DWTextFieldCell *cell = [tf cell];
+
+        [cell setAlignment:(style & 0xF)];
+        if(mask & DW_DT_VCENTER && [cell isMemberOfClass:[DWTextFieldCell class]])
+        {
+            [cell setVCenter:(style & DW_DT_VCENTER ? YES : NO)];
         }
     }
     else if([object isMemberOfClass:[NSTextView class]])