comparison mac/dw.m @ 2187:6740154cec68

Mac: Push the NSView changes back to Lion 10.7 and fix building on Lion.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 15 Oct 2020 00:23:56 +0000
parents 25fc0f438c6d
children a02ff8927927
comparison
equal deleted inserted replaced
2186:25fc0f438c6d 2187:6740154cec68
25 #endif 25 #endif
26 26
27 /* Create a define to let us know to include Lion specific features */ 27 /* Create a define to let us know to include Lion specific features */
28 #if defined(MAC_OS_X_VERSION_10_7) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) 28 #if defined(MAC_OS_X_VERSION_10_7) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
29 #define BUILDING_FOR_LION 29 #define BUILDING_FOR_LION
30 #define DW_USE_NSVIEW
30 #endif 31 #endif
31 32
32 /* Create a define to let us know to include Mountain Lion specific features */ 33 /* Create a define to let us know to include Mountain Lion specific features */
33 #if defined(MAC_OS_X_VERSION_10_8) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) 34 #if defined(MAC_OS_X_VERSION_10_8) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED))
34 #define BUILDING_FOR_MOUNTAIN_LION 35 #define BUILDING_FOR_MOUNTAIN_LION
50 #define DWCalendarUnitDay NSCalendarUnitDay 51 #define DWCalendarUnitDay NSCalendarUnitDay
51 #define DWCalendarUnitMonth NSCalendarUnitMonth 52 #define DWCalendarUnitMonth NSCalendarUnitMonth
52 #define DWCalendarUnitYear NSCalendarUnitYear 53 #define DWCalendarUnitYear NSCalendarUnitYear
53 #define DWCalendarIdentifierGregorian NSCalendarIdentifierGregorian 54 #define DWCalendarIdentifierGregorian NSCalendarIdentifierGregorian
54 #define BUILDING_FOR_YOSEMITE 55 #define BUILDING_FOR_YOSEMITE
55 #define DW_USE_NSVIEW
56 #else 56 #else
57 #define DWModalResponseOK NSOKButton 57 #define DWModalResponseOK NSOKButton
58 #define DWModalResponseCancel NSCancelButton 58 #define DWModalResponseCancel NSCancelButton
59 #define DWPaperOrientationPortrait NSPortraitOrientation 59 #define DWPaperOrientationPortrait NSPortraitOrientation
60 #define DWCalendarUnitDay NSDayCalendarUnit 60 #define DWCalendarUnitDay NSDayCalendarUnit
7524 7524
7525 for(z=0;z<count;z++) 7525 for(z=0;z<count;z++)
7526 { 7526 {
7527 NSString *title = [NSString stringWithUTF8String:titles[z]]; 7527 NSString *title = [NSString stringWithUTF8String:titles[z]];
7528 NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:title]; 7528 NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:title];
7529 #ifdef DW_USE_NSVIEW 7529 #ifdef BUILDING_FOR_YOSEMITE
7530 [column setTitle:title]; 7530 [column setTitle:title];
7531 #else 7531 #else
7532 [[column headerCell] setStringValue:title]; 7532 [[column headerCell] setStringValue:title];
7533 #endif
7534 #ifndef DW_USE_NSVIEW
7533 if(flags[z] & DW_CFA_BITMAPORICON) 7535 if(flags[z] & DW_CFA_BITMAPORICON)
7534 { 7536 {
7535 NSImageCell *imagecell = [[NSImageCell alloc] init]; 7537 NSImageCell *imagecell = [[NSImageCell alloc] init];
7536 [column setDataCell:imagecell]; 7538 [column setDataCell:imagecell];
7537 [imagecell release]; 7539 [imagecell release];