Mercurial > dwindows
comparison mac/dw.m @ 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 | c02f23d24507 |
children | f77b76c86d19 |
comparison
equal
deleted
inserted
replaced
1777:0cdfb0c3f4ca | 1778:e71ab68198ce |
---|---|
3814 /* Handle static text fields */ | 3814 /* Handle static text fields */ |
3815 if([object isKindOfClass:[ NSTextField class ]] && ![object isEditable]) | 3815 if([object isKindOfClass:[ NSTextField class ]] && ![object isEditable]) |
3816 { | 3816 { |
3817 id border = handle; | 3817 id border = handle; |
3818 | 3818 |
3819 extrawidth = 10; | |
3820 | |
3819 /* Handle status bar field */ | 3821 /* Handle status bar field */ |
3820 if([border isMemberOfClass:[ NSBox class ] ]) | 3822 if([border isMemberOfClass:[ NSBox class ] ]) |
3821 { | 3823 { |
3822 extrawidth = 12; | 3824 extrawidth += 2; |
3823 extraheight = 4; | 3825 extraheight = 8; |
3824 } | 3826 } |
3825 else | |
3826 extrawidth = 10; | |
3827 //dw_debug("this width %d height %d extra width %d height %d \"%s\"\n", thiswidth, thisheight, extrawidth, extraheight, (char *)[nsstr UTF8String]); | |
3828 } | 3827 } |
3829 | 3828 |
3830 /* Set the requested sizes */ | 3829 /* Set the requested sizes */ |
3831 if(width) | 3830 if(width) |
3832 *width = thiswidth + extrawidth; | 3831 *width = thiswidth + extrawidth; |
5374 | 5373 |
5375 [border setBorderType:NSGrooveBorder]; | 5374 [border setBorderType:NSGrooveBorder]; |
5376 //[border setBorderType:NSLineBorder]; | 5375 //[border setBorderType:NSLineBorder]; |
5377 [border setTitlePosition:NSNoTitle]; | 5376 [border setTitlePosition:NSNoTitle]; |
5378 [border setContentView:textfield]; | 5377 [border setContentView:textfield]; |
5379 [border setContentViewMargins:NSMakeSize(1,1)]; | 5378 [border setContentViewMargins:NSMakeSize(1.5,1.5)]; |
5380 [textfield autorelease]; | 5379 [textfield autorelease]; |
5381 [textfield setBackgroundColor:[NSColor clearColor]]; | 5380 [textfield setBackgroundColor:[NSColor clearColor]]; |
5382 [[textfield cell] setVCenter:YES]; | 5381 [[textfield cell] setVCenter:YES]; |
5383 return border; | 5382 return border; |
5384 } | 5383 } |
8375 * width: New width in pixels. | 8374 * width: New width in pixels. |
8376 * height: New height in pixels. | 8375 * height: New height in pixels. |
8377 */ | 8376 */ |
8378 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask) | 8377 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask) |
8379 { | 8378 { |
8380 id object = handle; | 8379 id object = _text_handle(handle); |
8381 | 8380 |
8382 if([object isMemberOfClass:[DWWindow class]]) | 8381 if([object isMemberOfClass:[DWWindow class]]) |
8383 { | 8382 { |
8384 DWWindow *window = object; | 8383 DWWindow *window = object; |
8385 SEL sssm = NSSelectorFromString(@"setStyleMask"); | 8384 SEL sssm = NSSelectorFromString(@"setStyleMask"); |
8398 } | 8397 } |
8399 } | 8398 } |
8400 else if([object isKindOfClass:[NSTextField class]]) | 8399 else if([object isKindOfClass:[NSTextField class]]) |
8401 { | 8400 { |
8402 NSTextField *tf = object; | 8401 NSTextField *tf = object; |
8403 | 8402 DWTextFieldCell *cell = [tf cell]; |
8404 [[tf cell] setAlignment:(style & 0xF)]; | 8403 |
8405 if(mask & DW_DT_VCENTER) | 8404 [cell setAlignment:(style & 0xF)]; |
8406 { | 8405 if(mask & DW_DT_VCENTER && [cell isMemberOfClass:[DWTextFieldCell class]]) |
8407 [[tf cell] setVCenter:(style & DW_DT_VCENTER ? YES : NO)]; | 8406 { |
8407 [cell setVCenter:(style & DW_DT_VCENTER ? YES : NO)]; | |
8408 } | 8408 } |
8409 } | 8409 } |
8410 else if([object isMemberOfClass:[NSTextView class]]) | 8410 else if([object isMemberOfClass:[NSTextView class]]) |
8411 { | 8411 { |
8412 NSTextView *tv = handle; | 8412 NSTextView *tv = handle; |