mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
Merge branch 'master' of github.com:gnustep/libs-gui
This commit is contained in:
commit
99c15ee911
2 changed files with 24 additions and 12 deletions
|
@ -60,17 +60,15 @@ enum {
|
|||
};
|
||||
typedef NSUInteger NSDatePickerElementFlags;
|
||||
|
||||
@class NSColor, NSDate, NSCalendar, NSLocale, NSTimeZone;
|
||||
|
||||
@interface NSDatePickerCell : NSActionCell
|
||||
{
|
||||
NSColor *_backgroundColor;
|
||||
NSCalendar *_calendar;
|
||||
NSDate *_dateValue;
|
||||
id _delegate;
|
||||
NSLocale *_locale;
|
||||
NSColor *_textColor;
|
||||
NSDate *_maxDate;
|
||||
NSDate *_minDate;
|
||||
NSColor *_textColor;
|
||||
NSTimeZone *_timeZone;
|
||||
id _delegate;
|
||||
NSTimeInterval _timeInterval;
|
||||
// FIXME: pack into a bitfield?
|
||||
NSDatePickerElementFlags _datePickerElements;
|
||||
|
|
|
@ -30,11 +30,25 @@
|
|||
*/
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSDateFormatter.h>
|
||||
#import <AppKit/NSDatePickerCell.h>
|
||||
#import <AppKit/NSColor.h>
|
||||
|
||||
@implementation NSDatePickerCell
|
||||
|
||||
- (id) initTextCell: (NSString*)aString
|
||||
{
|
||||
if ((self = [super initTextCell: aString]))
|
||||
{
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
|
||||
[self setFormatter: formatter];
|
||||
RELEASE(formatter);
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSColor *) backgroundColor
|
||||
{
|
||||
return _backgroundColor;
|
||||
|
@ -47,12 +61,12 @@
|
|||
|
||||
- (NSCalendar *) calendar
|
||||
{
|
||||
return _calendar;
|
||||
return [[self formatter] calendar];
|
||||
}
|
||||
|
||||
- (void) setCalendar: (NSCalendar *)calendar
|
||||
{
|
||||
ASSIGN(_calendar, calendar);
|
||||
[[self formatter] setCalendar: calendar];
|
||||
}
|
||||
|
||||
- (NSDatePickerElementFlags) datePickerElements
|
||||
|
@ -117,12 +131,12 @@
|
|||
|
||||
- (NSLocale *) locale
|
||||
{
|
||||
return _locale;
|
||||
return [[self formatter] locale];
|
||||
}
|
||||
|
||||
- (void) setLocale: (NSLocale *)locale
|
||||
{
|
||||
ASSIGN(_locale, locale);
|
||||
[[self formatter] setLocale: locale];
|
||||
}
|
||||
|
||||
- (NSDate *) maxDate
|
||||
|
@ -167,12 +181,12 @@
|
|||
|
||||
- (NSTimeZone *) timeZone
|
||||
{
|
||||
return _timeZone;
|
||||
return [[self formatter] timeZone];
|
||||
}
|
||||
|
||||
- (void) setTimeZone: (NSTimeZone *)zone
|
||||
{
|
||||
ASSIGN(_timeZone, zone);
|
||||
[[self formatter] setTimeZone: zone];
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)aCoder
|
||||
|
|
Loading…
Reference in a new issue