diff --git a/ChangeLog b/ChangeLog index 09bbd07a2..6d32bda9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-17 Fred Kiefer + + * Source/NSTextFieldCell.m (-initWithCoder:): Moved special + handling of action mask into non-keyed decoder branch. + 2004-09-16 Fred Kiefer * Source/NSCell.m (-setStringValue:, -setFont:, -setImage:): Use diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index 769bd97d0..c9497646e 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -202,22 +202,6 @@ static NSColor *txtCol; { self = [super initWithCoder: aDecoder]; - if ([aDecoder versionForClassName:@"NSTextFieldCell"] < 2) - { - /* Replace the old default _action_mask with the new default one - if it's set. There isn't really a way to modify this value - on an NSTextFieldCell encoded in a .gorm file. The old default value - causes problems with newer NSTableViews which uses this to discern - whether it should trackMouse:inRect:ofView:untilMouseUp: or not. - This also disables the action from being sent on an uneditable and - unselectable text fields. - */ - if (_action_mask == NSLeftMouseUpMask) - { - _action_mask = NSKeyUpMask | NSKeyDownMask; - } - } - if ([aDecoder allowsKeyedCoding]) { [self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBackgroundColor"]]; @@ -232,6 +216,22 @@ static NSColor *txtCol; { BOOL tmp; + if ([aDecoder versionForClassName:@"NSTextFieldCell"] < 2) + { + /* Replace the old default _action_mask with the new default one + if it's set. There isn't really a way to modify this value + on an NSTextFieldCell encoded in a .gorm file. The old default value + causes problems with newer NSTableViews which uses this to discern + whether it should trackMouse:inRect:ofView:untilMouseUp: or not. + This also disables the action from being sent on an uneditable and + unselectable text fields. + */ + if (_action_mask == NSLeftMouseUpMask) + { + _action_mask = NSKeyUpMask | NSKeyDownMask; + } + } + [aDecoder decodeValueOfObjCType: @encode(id) at: &_background_color]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_text_color]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp];