2004-09-16 Matt Rice <ratmice@yahoo.com>

* Source/NSTextFieldCell.m (+initialize): Bump class version.
        (-initWithCoder:): When decoding the previous version of NSTextFieldCell        replace the old default _action_mask with the new default value.
        (Fixes #9609 for .gorm files)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20069 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2004-09-16 07:34:41 +00:00
parent 10ee79adae
commit 878d6abeac
2 changed files with 23 additions and 1 deletions

View file

@ -68,7 +68,7 @@ static NSColor *txtCol;
{
if (self == [NSTextFieldCell class])
{
[self setVersion: 1];
[self setVersion: 2];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(_systemColorsChanged:)
@ -201,6 +201,22 @@ static NSColor *txtCol;
- (id) initWithCoder: (NSCoder*)aDecoder
{
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])
{