diff --git a/ChangeLog b/ChangeLog index ae4481f4f..09bbd07a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-09-16 Fred Kiefer + + * Source/NSCell.m (-setStringValue:, -setFont:, -setImage:): Use + method call to change cell type. (Readded this change) + * Source/NSButtonCell.m (-setType:): Overwrite super method with + empty implementation. Patch by Quentin Mathe . + * Source/NSView.m (-initWithCoder:): Added the first bit of + keyed flags decoding. + 2004-09-16 Matt Rice * Source/NSTextFieldCell.m (+initialize): Bump class version. (-initWithCoder:): When decoding the previous version of NSTextFieldCell diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 8b47dde7b..b2aadef83 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -129,6 +129,23 @@ [super dealloc]; } + +- (void) setType: (NSCellType)aType +{ + /* We do nothing here (we match the Mac OS X behavior) because with + * NSButtonCell GNUstep implementation the cell type is binded to the image + * position. Such behavior has been choosen because it permits to have + * -setFont: -setTitle -setImage: methods which are symetrical by not altering + * the cell type, morevover a cell type is more characterized by the potential + * visibility of the image (which is under the control of the method + * -setImagePosition:) than by the value of the image ivar itself (related to + * -setImage: method). + * On Mac OS X, the NSButtonCell cell type is NSTextCellType by default or + * NSImageCellType if the initialization has been done with -initImageCell:, + * it should be noted that the cell type never changes later. + */ +} + /* * Setting the Titles */ diff --git a/Source/NSCell.m b/Source/NSCell.m index b3e4de8c1..31fb98f82 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -344,7 +344,10 @@ static NSColor *shadowCol; @"Attempt to use nil as string value"); } - _cell.type = NSTextCellType; + if (_cell.type != NSTextCellType) + { + [self setType: NSTextCellType]; + } _cell.contents_is_attributed_string = NO; if (_formatter == nil) @@ -739,13 +742,13 @@ static NSColor *shadowCol; - (void) setFont: (NSFont*)fontObject { - // This does not have any influence on attributed strings - ASSIGN (_font, fontObject); - if (_cell.type != NSTextCellType) { - _cell.type = NSTextCellType; + [self setType: NSTextCellType]; } + + // This does not have any influence on attributed strings + ASSIGN (_font, fontObject); } - (void) setSelectable: (BOOL)flag @@ -970,7 +973,10 @@ static NSColor *shadowCol; NSInvalidArgumentException); } - _cell.type = NSImageCellType; + if (_cell.type != NSImageCellType) + { + [self setType: NSImageCellType]; + } ASSIGN (_cell_image, anImage); } @@ -2213,6 +2219,7 @@ static NSColor *shadowCol; [anImage compositeToPoint: position operation: NSCompositeSourceOver]; } + - (BOOL) _sendsActionOn:(int)eventTypeMask { return (_action_mask & eventTypeMask); diff --git a/Source/NSView.m b/Source/NSView.m index 378283203..2e5f48dac 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -3785,8 +3785,12 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) } if ([aDecoder containsValueForKey: @"NSvFlags"]) { - //int vFlags = [aDecoder decodeIntForKey: @"NSvFlags"]; - // FIXME set the flags + int vFlags = [aDecoder decodeIntForKey: @"NSvFlags"]; + + // We are lucky here, Apple use the same constants + // in the lower bits of the flags + [self setAutoresizingMask: vFlags & 0x3F]; + [self setHidden: vFlags & (1 << 32)]; } } else