Mercurial > dwindows
comparison mac/dw.m @ 2004:ebbdb2120659
Mac: Fix building on 10.9 and earlier due to changed constant names.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 05 Nov 2019 21:06:23 +0000 |
parents | a2931caa3422 |
children | 75c6eb796e91 |
comparison
equal
deleted
inserted
replaced
2003:dee122916f3c | 2004:ebbdb2120659 |
---|---|
43 */ | 43 */ |
44 #if defined(MAC_OS_X_VERSION_10_10) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) | 44 #if defined(MAC_OS_X_VERSION_10_10) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) |
45 #define DWModalResponseOK NSModalResponseOK | 45 #define DWModalResponseOK NSModalResponseOK |
46 #define DWModalResponseCancel NSModalResponseCancel | 46 #define DWModalResponseCancel NSModalResponseCancel |
47 #define DWPaperOrientationPortrait NSPaperOrientationPortrait | 47 #define DWPaperOrientationPortrait NSPaperOrientationPortrait |
48 #define DWCalendarUnitDay NSCalendarUnitDay | |
49 #define DWCalendarUnitMonth NSCalendarUnitMonth | |
50 #define DWCalendarUnitYear NSCalendarUnitYear | |
51 #define DWCalendarIdentifierGregorian NSCalendarIdentifierGregorian | |
48 #define BUILDING_FOR_YOSEMITE | 52 #define BUILDING_FOR_YOSEMITE |
49 #else | 53 #else |
50 #define DWModalResponseOK NSOKButton | 54 #define DWModalResponseOK NSOKButton |
51 #define DWModalResponseCancel NSCancelButton | 55 #define DWModalResponseCancel NSCancelButton |
52 #define DWPaperOrientationPortrait NSPortraitOrientation | 56 #define DWPaperOrientationPortrait NSPortraitOrientation |
57 #define DWCalendarUnitDay NSDayCalendarUnit | |
58 #define DWCalendarUnitMonth NSMonthCalendarUnit | |
59 #define DWCalendarUnitYear NSYearCalendarUnit | |
60 #define DWCalendarIdentifierGregorian (NSString *)kCFGregorianCalendar | |
53 #endif | 61 #endif |
54 | 62 |
55 /* Handle deprecation of several constants in 10.12... | 63 /* Handle deprecation of several constants in 10.12... |
56 * the replacements are not available in earlier versions. | 64 * the replacements are not available in earlier versions. |
57 */ | 65 */ |
8630 */ | 8638 */ |
8631 void dw_calendar_get_date(HWND handle, unsigned int *year, unsigned int *month, unsigned int *day) | 8639 void dw_calendar_get_date(HWND handle, unsigned int *year, unsigned int *month, unsigned int *day) |
8632 { | 8640 { |
8633 DWCalendar *calendar = handle; | 8641 DWCalendar *calendar = handle; |
8634 DW_LOCAL_POOL_IN; | 8642 DW_LOCAL_POOL_IN; |
8635 NSCalendar *mycalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; | 8643 NSCalendar *mycalendar = [[NSCalendar alloc] initWithCalendarIdentifier:DWCalendarIdentifierGregorian]; |
8636 NSDate *date = [calendar dateValue]; | 8644 NSDate *date = [calendar dateValue]; |
8637 NSDateComponents* components = [mycalendar components:NSCalendarUnitDay|NSCalendarUnitMonth|NSCalendarUnitYear fromDate:date]; | 8645 NSDateComponents* components = [mycalendar components:DWCalendarUnitDay|DWCalendarUnitMonth|DWCalendarUnitYear fromDate:date]; |
8638 *day = [components day]; | 8646 *day = [components day]; |
8639 *month = [components month]; | 8647 *month = [components month]; |
8640 *year = [components year]; | 8648 *year = [components year]; |
8641 [mycalendar release]; | 8649 [mycalendar release]; |
8642 DW_LOCAL_POOL_OUT; | 8650 DW_LOCAL_POOL_OUT; |