mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
Readded NSCell setType: patch with originally missing bit for NSButtonCell.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20072 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
878d6abeac
commit
a15214f38d
4 changed files with 45 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
|||
2004-09-16 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* 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 <qmathe@club-internet.fr>.
|
||||
* Source/NSView.m (-initWithCoder:): Added the first bit of
|
||||
keyed flags decoding.
|
||||
|
||||
2004-09-16 Matt Rice <ratmice@yahoo.com>
|
||||
* Source/NSTextFieldCell.m (+initialize): Bump class version.
|
||||
(-initWithCoder:): When decoding the previous version of NSTextFieldCell
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue