Prefixed ivars with underscores; fixed bug in minor drawing method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5528 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nico 1999-12-16 03:00:45 +00:00
parent b6bd684867
commit 052e2c6d1c

View file

@ -78,14 +78,14 @@ static Class cellClass;
{ {
[super initWithFrame: frameRect]; [super initWithFrame: frameRect];
[self setCell: AUTORELEASE([[[self class] cellClass] new])]; [self setCell: AUTORELEASE([[[self class] cellClass] new])];
tag = 0; _tag = 0;
return self; return self;
} }
- (void) dealloc - (void) dealloc
{ {
RELEASE(cell); RELEASE(_cell);
[super dealloc]; [super dealloc];
} }
@ -95,7 +95,7 @@ static Class cellClass;
- (id) copyWithZone: (NSZone*)zone - (id) copyWithZone: (NSZone*)zone
{ {
id c = NSCopyObject(self, 0, zone); id c = NSCopyObject(self, 0, zone);
NSCell *o = [cell copy]; NSCell *o = [_cell copy];
[c setCell: o]; [c setCell: o];
RELEASE(o); RELEASE(o);
@ -107,7 +107,7 @@ static Class cellClass;
*/ */
- (id) cell - (id) cell
{ {
return cell; return _cell;
} }
- (void) setCell: (NSCell *)aCell - (void) setCell: (NSCell *)aCell
@ -116,7 +116,7 @@ static Class cellClass;
[NSException raise: NSInvalidArgumentException [NSException raise: NSInvalidArgumentException
format: @"attempt to set non-cell object for control cell"]; format: @"attempt to set non-cell object for control cell"];
ASSIGN(cell, aCell); ASSIGN(_cell, aCell);
} }
/* /*
@ -137,7 +137,7 @@ static Class cellClass;
*/ */
- (id) selectedCell - (id) selectedCell
{ {
return cell; return _cell;
} }
- (int) selectedTag - (int) selectedTag
@ -237,33 +237,33 @@ static Class cellClass;
*/ */
- (NSTextAlignment) alignment - (NSTextAlignment) alignment
{ {
if (cell) if (_cell)
return [cell alignment]; return [_cell alignment];
else else
return NSLeftTextAlignment; return NSLeftTextAlignment;
} }
- (NSFont *) font - (NSFont *) font
{ {
if (cell) if (_cell)
return [cell font]; return [_cell font];
else else
return nil; return nil;
} }
- (void) setAlignment: (NSTextAlignment)mode - (void) setAlignment: (NSTextAlignment)mode
{ {
if (cell) if (_cell)
{ {
[cell setAlignment: mode]; [_cell setAlignment: mode];
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
} }
} }
- (void) setFont: (NSFont *)fontObject - (void) setFont: (NSFont *)fontObject
{ {
if (cell) if (_cell)
[cell setFont: fontObject]; [_cell setFont: fontObject];
} }
- (void) setFloatingPointFormat: (BOOL)autoRange - (void) setFloatingPointFormat: (BOOL)autoRange
@ -298,7 +298,7 @@ static Class cellClass;
- (void) sizeToFit - (void) sizeToFit
{ {
[self setFrameSize: [cell cellSize]]; [self setFrameSize: [_cell cellSize]];
} }
/* /*
@ -306,35 +306,35 @@ static Class cellClass;
*/ */
- (BOOL) isOpaque - (BOOL) isOpaque
{ {
return [cell isOpaque]; return [_cell isOpaque];
} }
- (void) drawRect: (NSRect)aRect - (void) drawRect: (NSRect)aRect
{ {
[self drawCell: cell]; [self drawCell: _cell];
} }
- (void) drawCell: (NSCell *)aCell - (void) drawCell: (NSCell *)aCell
{ {
if (cell == aCell) if (_cell == aCell)
{ {
[cell drawWithFrame: bounds inView: self]; [_cell drawWithFrame: bounds inView: self];
} }
} }
- (void) drawCellInside: (NSCell *)aCell - (void) drawCellInside: (NSCell *)aCell
{ {
if (cell == aCell) if (_cell == aCell)
{ {
[cell drawInteriorWithFrame: [cell drawingRectForBounds: bounds] [_cell drawInteriorWithFrame: bounds
inView: self]; inView: self];
} }
} }
- (void) selectCell: (NSCell *)aCell - (void) selectCell: (NSCell *)aCell
{ {
if (cell == aCell) if (_cell == aCell)
[cell setState: 1]; [_cell setState: 1];
} }
- (void) updateCell: (NSCell *)aCell - (void) updateCell: (NSCell *)aCell
@ -348,7 +348,7 @@ static Class cellClass;
} }
- (void) performClick: (id)sender - (void) performClick: (id)sender
{ {
[cell performClick: sender]; [_cell performClick: sender];
} }
/* /*
@ -356,12 +356,12 @@ static Class cellClass;
*/ */
- (SEL) action - (SEL) action
{ {
return [cell action]; return [_cell action];
} }
- (BOOL) isContinuous - (BOOL) isContinuous
{ {
return [cell isContinuous]; return [_cell isContinuous];
} }
- (BOOL) sendAction: (SEL)theAction to: (id)theTarget - (BOOL) sendAction: (SEL)theAction to: (id)theTarget
@ -376,27 +376,27 @@ static Class cellClass;
- (int) sendActionOn: (int)mask - (int) sendActionOn: (int)mask
{ {
return [cell sendActionOn: mask]; return [_cell sendActionOn: mask];
} }
- (void) setAction: (SEL)aSelector - (void) setAction: (SEL)aSelector
{ {
[cell setAction: aSelector]; [_cell setAction: aSelector];
} }
- (void) setContinuous: (BOOL)flag - (void) setContinuous: (BOOL)flag
{ {
[cell setContinuous: flag]; [_cell setContinuous: flag];
} }
- (void) setTarget: (id)anObject - (void) setTarget: (id)anObject
{ {
[cell setTarget: anObject]; [_cell setTarget: anObject];
} }
- (id) target - (id) target
{ {
return [cell target]; return [_cell target];
} }
/* /*
@ -404,12 +404,12 @@ static Class cellClass;
*/ */
- (void) setTag: (int)anInt - (void) setTag: (int)anInt
{ {
tag = anInt; _tag = anInt;
} }
- (int) tag - (int) tag
{ {
return tag; return _tag;
} }
/* /*
@ -430,10 +430,10 @@ static Class cellClass;
if (![self isEnabled]) if (![self isEnabled])
return; return;
if ([cell isContinuous]) if ([_cell isContinuous])
oldActionMask = [cell sendActionOn: 0]; oldActionMask = [_cell sendActionOn: 0];
else else
oldActionMask = [cell sendActionOn: NSPeriodicMask]; oldActionMask = [_cell sendActionOn: NSPeriodicMask];
[window _captureMouse: self]; [window _captureMouse: self];
@ -447,16 +447,16 @@ static Class cellClass;
if ((location.x >= 0) && (location.x < bounds.size.width) && if ((location.x >= 0) && (location.x < bounds.size.width) &&
(location.y >= 0 && location.y < bounds.size.height)) (location.y >= 0 && location.y < bounds.size.height))
{ {
[cell highlight: YES withFrame: bounds inView: self]; [_cell highlight: YES withFrame: bounds inView: self];
[window flushWindow]; [window flushWindow];
if ([cell trackMouse: e if ([_cell trackMouse: e
inRect: bounds inRect: bounds
ofView: self ofView: self
untilMouseUp: YES]) untilMouseUp: YES])
done = mouseUp = YES; done = mouseUp = YES;
else else
{ {
[cell highlight: NO withFrame: bounds inView: self]; [_cell highlight: NO withFrame: bounds inView: self];
[window flushWindow]; [window flushWindow];
} }
} }
@ -478,11 +478,11 @@ static Class cellClass;
if (mouseUp) if (mouseUp)
{ {
// [cell setState: ![cell state]]; // [cell setState: ![cell state]];
[cell highlight: NO withFrame: bounds inView: self]; [_cell highlight: NO withFrame: bounds inView: self];
[window flushWindow]; [window flushWindow];
} }
[cell sendActionOn: oldActionMask]; [_cell sendActionOn: oldActionMask];
if (mouseUp) if (mouseUp)
[self sendAction: [self action] to: [self target]]; [self sendAction: [self action] to: [self target]];
@ -490,7 +490,7 @@ static Class cellClass;
- (void) resetCursorRects - (void) resetCursorRects
{ {
[cell resetCursorRect: bounds inView: self]; [_cell resetCursorRect: bounds inView: self];
} }
- (BOOL) ignoresMultiClick - (BOOL) ignoresMultiClick
@ -509,16 +509,16 @@ static Class cellClass;
{ {
[super encodeWithCoder: aCoder]; [super encodeWithCoder: aCoder];
[aCoder encodeValueOfObjCType: @encode(int) at: &tag]; [aCoder encodeValueOfObjCType: @encode(int) at: &_tag];
[aCoder encodeObject: cell]; [aCoder encodeObject: _cell];
} }
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
[super initWithCoder: aDecoder]; [super initWithCoder: aDecoder];
[aDecoder decodeValueOfObjCType: @encode(int) at: &tag]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_tag];
[aDecoder decodeValueOfObjCType: @encode(id) at: &cell]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_cell];
return self; return self;
} }