Access superclass ivars directly.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4786 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-09-01 08:35:16 +00:00
parent 0d1b3b95af
commit 178e4956bd
15 changed files with 87 additions and 73 deletions

View file

@ -1,3 +1,22 @@
Wed Sep 1 9:55:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Added patches from n.pero@mi.flashnet.it to access ivars of
superclasses directly. Generated changes for NSClipView.m myself.
* NSBox.m: (frame)
* NSClipView.m: (superview, window, bounds)
* NSMatrix.m: (bounds)
* NSMenuView.m: (frame, window, bounds)
* NSPopUpButton.m: (frame, window)
* NSProgressIndicator (window, bounds)
* NSSavePanel.m: (frame)
* NSScroller.m: (frame)
* NSScrollView.m: (bounds)
* NSSlider.m: (bounds)
* NSSplitView.m: (frame, window, bounds)
* NSTabView.m: (frame)
* NSTableView.m: (superview)
* NSView.m: (superview, autoresizeSubviews)
Wed Sep 1 9:28:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Wed Sep 1 9:28:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Tools/GNUmakefile.preamble: patch by doko@cs.tu-berlin.de so that * Tools/GNUmakefile.preamble: patch by doko@cs.tu-berlin.de so that

View file

@ -213,7 +213,7 @@
{ {
// First calc the sizes to see how much we are off by // First calc the sizes to see how much we are off by
NSRect r = [self calcSizesAllowingNegative: YES]; NSRect r = [self calcSizesAllowingNegative: YES];
NSRect f = [self frame]; NSRect f = frame;
NSAssert(contentFrame.size.width >= 0 && contentFrame.size.height >= 0, NSAssert(contentFrame.size.width >= 0 && contentFrame.size.height >= 0,
@"illegal content frame supplied"); @"illegal content frame supplied");

View file

@ -89,12 +89,12 @@
_rFlags.flipped_view = [self isFlipped]; _rFlags.flipped_view = [self isFlipped];
/* TODO: invoke superview's reflectScrolledClipView: ? */ /* TODO: invoke superview's reflectScrolledClipView: ? */
[[self superview] reflectScrolledClipView: self]; [super_view reflectScrolledClipView: self];
} }
- (void) resetCursorRects - (void) resetCursorRects
{ {
[self addCursorRect: [self bounds] cursor: _cursor]; [self addCursorRect: bounds cursor: _cursor];
} }
- (void) scrollToPoint: (NSPoint)point - (void) scrollToPoint: (NSPoint)point
@ -104,7 +104,7 @@
- (void) setBoundsOrigin: (NSPoint)point - (void) setBoundsOrigin: (NSPoint)point
{ {
NSRect originalBounds = [self bounds]; NSRect originalBounds = bounds;
NSRect newBounds = originalBounds; NSRect newBounds = originalBounds;
NSRect intersection; NSRect intersection;
@ -116,7 +116,7 @@
if (_documentView == nil) if (_documentView == nil)
return; return;
if (_copiesOnScroll && [self window]) if (_copiesOnScroll && window)
{ {
// copy the portion of the view that is common before and after scrolling. // copy the portion of the view that is common before and after scrolling.
// then tell docview to draw the exposed parts. // then tell docview to draw the exposed parts.
@ -127,7 +127,7 @@
// no intersection -- docview should draw everything // no intersection -- docview should draw everything
[super setBoundsOrigin: newBounds.origin]; [super setBoundsOrigin: newBounds.origin];
[_documentView setNeedsDisplayInRect: [_documentView setNeedsDisplayInRect:
[self convertRect: newBounds toView: _documentView]]; [self convertRect: newBounds toView: _documentView]];
} }
else else
{ {
@ -165,7 +165,7 @@
+ intersection.size.width; + intersection.size.width;
} }
[_documentView setNeedsDisplayInRect: [_documentView setNeedsDisplayInRect:
[self convertRect: redrawRect toView: _documentView]]; [self convertRect: redrawRect toView: _documentView]];
} }
if (dy != 0) if (dy != 0)
@ -190,7 +190,7 @@
+ intersection.size.height; + intersection.size.height;
} }
[_documentView setNeedsDisplayInRect: [_documentView setNeedsDisplayInRect:
[self convertRect: redrawRect toView: _documentView]]; [self convertRect: redrawRect toView: _documentView]];
} }
} }
} }
@ -199,7 +199,7 @@
// dont copy anything -- docview draws it all // dont copy anything -- docview draws it all
[super setBoundsOrigin: newBounds.origin]; [super setBoundsOrigin: newBounds.origin];
[_documentView setNeedsDisplayInRect: [_documentView setNeedsDisplayInRect:
[self convertRect: newBounds toView: _documentView]]; [self convertRect: newBounds toView: _documentView]];
} }
[super_view reflectScrolledClipView: self]; [super_view reflectScrolledClipView: self];
} }
@ -275,7 +275,7 @@
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
[[self backgroundColor] set]; [_backgroundColor set];
NSRectFill(rect); NSRectFill(rect);
} }

View file

@ -683,11 +683,10 @@ static int mouseDownFlags = 0;
float approxRowsHeight = approxRow * (cellSize.height + intercell.height); float approxRowsHeight = approxRow * (cellSize.height + intercell.height);
int approxCol = point.x / (cellSize.width + intercell.width); int approxCol = point.x / (cellSize.width + intercell.width);
float approxColsWidth = approxCol * (cellSize.width + intercell.width); float approxColsWidth = approxCol * (cellSize.width + intercell.width);
NSRect theBounds = [self bounds];
/* First check the limit cases */ /* First check the limit cases */
beyondCols = (point.x > theBounds.size.width || point.x < 0); beyondCols = (point.x > bounds.size.width || point.x < 0);
beyondRows = (point.y > theBounds.size.height || point.y < 0); beyondRows = (point.y > bounds.size.height || point.y < 0);
/* Determine if the point is inside the cell */ /* Determine if the point is inside the cell */
betweenRows = !(point.y > approxRowsHeight betweenRows = !(point.y > approxRowsHeight

View file

@ -373,7 +373,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
- (NSRect)innerRect - (NSRect)innerRect
{ {
return [self bounds]; return bounds;
// this could change if we drew menuitemcells as // this could change if we drew menuitemcells as
// plain rects with no bezel like in macOSX. Talk to Michael Hanni if // plain rects with no bezel like in macOSX. Talk to Michael Hanni if
@ -388,9 +388,9 @@ static float GSMenuBarHeight = 25.0; // a guess.
[self sizeToFit]; [self sizeToFit];
if (index == 0) if (index == 0)
theRect.origin.y = [self frame].size.height - cellSize.height; theRect.origin.y = frame.size.height - cellSize.height;
else else
theRect.origin.y = [self frame].size.height - (cellSize.height * (index + 1)); theRect.origin.y = frame.size.height - (cellSize.height * (index + 1));
theRect.origin.x = 0; theRect.origin.x = 0;
theRect.size = cellSize; theRect.size = cellSize;
@ -406,7 +406,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
NSRect aRect = [self rectOfItemAtIndex: 0]; NSRect aRect = [self rectOfItemAtIndex: 0];
// this will need some finnessing but should be close. // this will need some finnessing but should be close.
return ([self frame].size.height - point.y) / aRect.size.height; return (frame.size.height - point.y) / aRect.size.height;
} }
- (void)setNeedsDisplayForItemAtIndex: (int)index - (void)setNeedsDisplayForItemAtIndex: (int)index
@ -445,7 +445,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
- (void)drawRect: (NSRect)rect - (void)drawRect: (NSRect)rect
{ {
int i; int i;
NSRect aRect = [self frame]; NSRect aRect = frame;
int howMany = [menuv_items_link count]; int howMany = [menuv_items_link count];
// This code currently doesn't take intercell spacing into account. I'll // This code currently doesn't take intercell spacing into account. I'll
@ -473,7 +473,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
- (BOOL)trackWithEvent: (NSEvent *)event - (BOOL)trackWithEvent: (NSEvent *)event
{ {
NSPoint lastLocation = [event locationInWindow]; NSPoint lastLocation = [event locationInWindow];
float height = [self frame].size.height; float height = frame.size.height;
int index; int index;
int lastIndex = 0; int lastIndex = 0;
unsigned eventMask = NSLeftMouseUpMask | NSLeftMouseDownMask unsigned eventMask = NSLeftMouseUpMask | NSLeftMouseDownMask
@ -494,7 +494,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
// Get our mouse location, regardless of where it may be it the event // Get our mouse location, regardless of where it may be it the event
// stream. // stream.
lastLocation = [[self window] mouseLocationOutsideOfEventStream]; lastLocation = [window mouseLocationOutsideOfEventStream];
index = (height - lastLocation.y) / cellSize.height; index = (height - lastLocation.y) / cellSize.height;
@ -521,21 +521,21 @@ static float GSMenuBarHeight = 25.0; // a guess.
break; break;
case NSRightMouseDragged: case NSRightMouseDragged:
case NSLeftMouseDragged: case NSLeftMouseDragged:
lastLocation = [[self window] mouseLocationOutsideOfEventStream]; lastLocation = [window mouseLocationOutsideOfEventStream];
lastLocation = [self convertPoint: lastLocation fromView: nil]; lastLocation = [self convertPoint: lastLocation fromView: nil];
#if 0 #if 0
NSLog (@"location = (%f, %f, %f)", lastLocation.x, [[self window] NSLog (@"location = (%f, %f, %f)", lastLocation.x, [window
frame].origin.x, [[self window] frame].size.width); frame].origin.x, [window frame].size.width);
NSLog (@"location = %f (%f, %f)", lastLocation.y, [[self window] NSLog (@"location = %f (%f, %f)", lastLocation.y, [window
frame].origin.y, [[self window] frame].size.height); frame].origin.y, [window frame].size.height);
#endif #endif
/* If the location of the mouse is inside the window on the /* If the location of the mouse is inside the window on the
x-axis. */ x-axis. */
if (lastLocation.x > 0 if (lastLocation.x > 0
&& lastLocation.x < [[self window] frame].size.width) && lastLocation.x < [window frame].size.width)
{ {
/* Get the index from some simple math. */ /* Get the index from some simple math. */
@ -570,7 +570,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
the current view. This should check to see if the the current view. This should check to see if the
current item, if any, has an open submenu. */ current item, if any, has an open submenu. */
if (lastLocation.y > [[self window] frame].size.height if (lastLocation.y > [window frame].size.height
|| lastLocation.y < 0) || lastLocation.y < 0)
{ {
weWereOut = YES; weWereOut = YES;
@ -583,7 +583,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
the current window we need to see if we should display a the current window we need to see if we should display a
submenu. */ submenu. */
else if (lastLocation.x > [[self window] frame].size.width) else if (lastLocation.x > [window frame].size.width)
{ {
NSRect aRect = [self rectOfItemAtIndex: lastIndex]; NSRect aRect = [self rectOfItemAtIndex: lastIndex];
if (lastLocation.y > aRect.origin.y if (lastLocation.y > aRect.origin.y
@ -768,7 +768,7 @@ cell do the following */
else if (weRightMenu) else if (weRightMenu)
{ {
NSPoint cP = [[self window] convertBaseToScreen: lastLocation]; NSPoint cP = [window convertBaseToScreen: lastLocation];
[self setHighlightedItemIndex: -1]; [self setHighlightedItemIndex: -1];
@ -779,7 +779,7 @@ cell do the following */
location: cP location: cP
modifierFlags: [event modifierFlags] modifierFlags: [event modifierFlags]
timestamp: [event timestamp] timestamp: [event timestamp]
windowNumber: [[self window] windowNumber] windowNumber: [window windowNumber]
context: [event context] context: [event context]
eventNumber: [event eventNumber] eventNumber: [event eventNumber]
clickCount: [event clickCount] clickCount: [event clickCount]
@ -802,7 +802,7 @@ cell do the following */
else if (weLeftMenu) else if (weLeftMenu)
{ /* The weLeftMenu case */ { /* The weLeftMenu case */
NSPoint cP = [[self window] convertBaseToScreen: lastLocation]; NSPoint cP = [window convertBaseToScreen: lastLocation];
selectedCell = [menuv_items_link objectAtIndex: lastIndex]; selectedCell = [menuv_items_link objectAtIndex: lastIndex];
if ([selectedCell hasSubmenu]) if ([selectedCell hasSubmenu])
@ -812,7 +812,7 @@ cell do the following */
location: cP location: cP
modifierFlags: [event modifierFlags] modifierFlags: [event modifierFlags]
timestamp: [event timestamp] timestamp: [event timestamp]
windowNumber: [[self window] windowNumber] windowNumber: [window windowNumber]
context: [event context] context: [event context]
eventNumber: [event eventNumber] eventNumber: [event eventNumber]
clickCount: [event clickCount] clickCount: [event clickCount]

View file

@ -451,7 +451,7 @@
{ {
NSPoint cP; NSPoint cP;
cP = [[self window] convertBaseToScreen: [theEvent locationInWindow]]; cP = [window convertBaseToScreen: [theEvent locationInWindow]];
cP = [popb_win convertScreenToBase: cP]; cP = [popb_win convertScreenToBase: cP];
//NSLog(@"location x = %d, y = %d\n", (int)cP.x, (int)cP.y); //NSLog(@"location x = %d, y = %d\n", (int)cP.x, (int)cP.y);
@ -475,7 +475,7 @@
{ {
// First check ourselves // First check ourselves
// if ([self mouse:aPoint inRect:bounds]) return self; // if ([self mouse:aPoint inRect:bounds]) return self;
if ([self mouse:aPoint inRect:[self frame]]) return self; if ([self mouse:aPoint inRect:frame]) return self;
return nil; return nil;
} }

View file

@ -149,24 +149,22 @@
- (void)drawRect:(NSRect)rect - (void)drawRect:(NSRect)rect
{ {
NSRect bnds,r; NSRect r;
bnds = [self bounds];
// Draw the Bezel // Draw the Bezel
if (isBezeled) if (isBezeled)
NSDrawGrayBezel(bnds,rect); NSDrawGrayBezel(bounds,rect);
// Calc the inside rect to be drawn // Calc the inside rect to be drawn
if (isBezeled) if (isBezeled)
{ {
r = NSMakeRect(NSMinX(bnds) + 2.0, r = NSMakeRect(NSMinX(bounds) + 2.0,
NSMinY(bnds) + 2.0, NSMinY(bounds) + 2.0,
NSWidth(bnds) - 4.0, NSWidth(bounds) - 4.0,
NSHeight(bnds) - 4.0); NSHeight(bounds) - 4.0);
} }
else else
r = bnds; r = bounds;
if (isIndeterminate) // Draw indeterminate if (isIndeterminate) // Draw indeterminate
{ {
@ -263,10 +261,10 @@
- (void)_update - (void)_update
{ {
if ([self window] != nil) if (window != nil)
if ([[self window] isVisible]) if ([window isVisible])
{ {
[[self window] display]; [window display];
#warning It does not seem that GNUstep has a NSDPSContext #warning It does not seem that GNUstep has a NSDPSContext
// [[NSDPSContext currentContext] flush]; // [[NSDPSContext currentContext] flush];
} }

View file

@ -386,7 +386,7 @@ static NSSavePanel *gnustep_gui_save_panel = nil;
- (int) runModalForDirectory:(NSString *) path file:(NSString *) filename - (int) runModalForDirectory:(NSString *) path file:(NSString *) filename
{ {
NSRect panelFrame = [self frame]; NSRect panelFrame = frame;
NSRect screenFrame = [[NSScreen mainScreen] frame]; NSRect screenFrame = [[NSScreen mainScreen] frame];
NSDebugLLog(@"NSSavePanel", @"NSSavePanel -runModalForDirectory: filename:"); NSDebugLLog(@"NSSavePanel", @"NSSavePanel -runModalForDirectory: filename:");

View file

@ -467,8 +467,7 @@ static Class rulerViewClass = nil;
- (void) tile - (void) tile
{ {
NSRect boundsRect = [self bounds]; NSSize contentSize = [isa contentSizeForFrameSize: bounds.size
NSSize contentSize = [isa contentSizeForFrameSize: boundsRect.size
hasHorizontalScroller: _hasHorizScroller hasHorizontalScroller: _hasHorizScroller
hasVerticalScroller: _hasVertScroller hasVerticalScroller: _hasVertScroller
borderType: _borderType]; borderType: _borderType];
@ -498,10 +497,10 @@ static Class rulerViewClass = nil;
if (_hasVertScroller) if (_hasVertScroller)
{ {
vertScrollerRect.origin.x = boundsRect.origin.x + borderThickness; vertScrollerRect.origin.x = bounds.origin.x + borderThickness;
vertScrollerRect.origin.y = boundsRect.origin.y + borderThickness; vertScrollerRect.origin.y = bounds.origin.y + borderThickness;
vertScrollerRect.size.width = scrollerWidth; vertScrollerRect.size.width = scrollerWidth;
vertScrollerRect.size.height =bounds.size.height - 2 * borderThickness; vertScrollerRect.size.height = bounds.size.height - 2 * borderThickness;
contentRect.origin.x += scrollerWidth + 1; contentRect.origin.x += scrollerWidth + 1;
} }
@ -509,7 +508,7 @@ static Class rulerViewClass = nil;
if (_hasHorizScroller) if (_hasHorizScroller)
{ {
horizScrollerRect.origin.x = contentRect.origin.x; horizScrollerRect.origin.x = contentRect.origin.x;
horizScrollerRect.origin.y = boundsRect.origin.y + borderThickness; horizScrollerRect.origin.y = bounds.origin.y + borderThickness;
horizScrollerRect.size.width = contentRect.size.width; horizScrollerRect.size.width = contentRect.size.width;
horizScrollerRect.size.height = scrollerWidth; horizScrollerRect.size.height = scrollerWidth;

View file

@ -262,7 +262,7 @@ static BOOL preCalcValues = NO;
- (void) checkSpaceForParts - (void) checkSpaceForParts
{ {
NSSize frameSize = [self frame].size; NSSize frameSize = frame.size;
float size = (_isHorizontal ? frameSize.width : frameSize.height); float size = (_isHorizontal ? frameSize.width : frameSize.height);
float scrollerWidth = [isa scrollerWidth]; float scrollerWidth = [isa scrollerWidth];

View file

@ -259,7 +259,7 @@ static Class cellClass;
if (floatValue != oldFloatValue) if (floatValue != oldFloatValue)
{ {
[theCell setFloatValue: floatValue]; [theCell setFloatValue: floatValue];
[theCell drawWithFrame: [self bounds] inView: self]; [theCell drawWithFrame: bounds inView: self];
[window flushWindow]; [window flushWindow];
if (isContinuous) if (isContinuous)
[target performSelector: action withObject: self]; [target performSelector: action withObject: self];
@ -294,7 +294,7 @@ static Class cellClass;
if ([self isContinuous]) if ([self isContinuous])
[[theCell target] performSelector: [theCell action] [[theCell target] performSelector: [theCell action]
withObject: self]; withObject: self];
[theCell drawWithFrame: [self bounds] inView: self]; [theCell drawWithFrame: bounds inView: self];
[window flushWindow]; [window flushWindow];
} }

View file

@ -72,7 +72,7 @@
if (count < 2) if (count < 2)
return; return;
[[self window] setAcceptsMouseMovedEvents: YES]; [window setAcceptsMouseMovedEvents: YES];
vis = [self visibleRect]; vis = [self visibleRect];
/* find out which divider it is */ /* find out which divider it is */
@ -140,7 +140,7 @@
if ([self isVertical] == NO) if ([self isVertical] == NO)
{ {
divVertical = div; divVertical = div;
divHorizontal = NSWidth([self frame]); divHorizontal = NSWidth(frame);
/* set the default limits on the dragging */ /* set the default limits on the dragging */
minCoord = NSMinY(bigRect) + divVertical; minCoord = NSMinY(bigRect) + divVertical;
maxCoord = NSHeight(bigRect) + NSMinY(bigRect) - divVertical; maxCoord = NSHeight(bigRect) + NSMinY(bigRect) - divVertical;
@ -148,7 +148,7 @@
else else
{ {
divHorizontal = div; divHorizontal = div;
divVertical = NSHeight([self frame]); divVertical = NSHeight(frame);
/* set the default limits on the dragging */ /* set the default limits on the dragging */
minCoord = NSMinX(bigRect) + divHorizontal; minCoord = NSMinX(bigRect) + divHorizontal;
maxCoord = NSWidth(bigRect) + NSMinX(bigRect) - divHorizontal; maxCoord = NSWidth(bigRect) + NSMinX(bigRect) - divHorizontal;
@ -284,10 +284,10 @@
(int)NSMinX(r1),(int)NSMinY(r1),(int)NSWidth(r1), (int)NSMinX(r1),(int)NSMinY(r1),(int)NSWidth(r1),
(int)NSHeight(r1)); (int)NSHeight(r1));
[[self window] invalidateCursorRectsForView: self]; [window invalidateCursorRectsForView: self];
RETURN_LABEL: RETURN_LABEL:
[[self window] setAcceptsMouseMovedEvents: NO]; [window setAcceptsMouseMovedEvents: NO];
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
[self display]; [self display];
@ -312,7 +312,6 @@ RETURN_LABEL:
unsigned count = [subs count]; unsigned count = [subs count];
NSView *views[count]; NSView *views[count];
NSRect frames[count]; NSRect frames[count];
NSRect bd = [self bounds];
float thickness = [self dividerThickness]; float thickness = [self dividerThickness];
NSSize newSize; NSSize newSize;
NSPoint newPoint; NSPoint newPoint;
@ -326,7 +325,7 @@ RETURN_LABEL:
[subs getObjects: views]; [subs getObjects: views];
if ([self isVertical] == NO) if ([self isVertical] == NO)
{ {
newTotal = NSHeight(bd) - thickness*(count - 1); newTotal = NSHeight(bounds) - thickness*(count - 1);
oldTotal = 0.0; oldTotal = 0.0;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
@ -345,7 +344,7 @@ RETURN_LABEL:
newHeight = floor(newHeight); newHeight = floor(newHeight);
else else
newHeight = ceil(newHeight); newHeight = ceil(newHeight);
newSize = NSMakeSize(NSWidth(bd), newHeight); newSize = NSMakeSize(NSWidth(bounds), newHeight);
running -= newHeight; running -= newHeight;
newPoint = NSMakePoint(0.0, running); newPoint = NSMakePoint(0.0, running);
running -= thickness; running -= thickness;
@ -355,7 +354,7 @@ RETURN_LABEL:
} }
else else
{ {
newTotal = NSWidth(bd) - thickness*(count - 1); newTotal = NSWidth(bounds) - thickness*(count - 1);
oldTotal = 0.0; oldTotal = 0.0;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
{ {
@ -373,7 +372,7 @@ RETURN_LABEL:
newWidth = floor(newWidth); newWidth = floor(newWidth);
else else
newWidth = ceil(newWidth); newWidth = ceil(newWidth);
newSize = NSMakeSize(newWidth, NSHeight(bd)); newSize = NSMakeSize(newWidth, NSHeight(bounds));
newPoint = NSMakePoint(running, 0.0); newPoint = NSMakePoint(running, 0.0);
running += newWidth + thickness; running += newWidth + thickness;
[views[i] setFrameSize: newSize]; [views[i] setFrameSize: newSize];
@ -541,7 +540,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
{ {
[super resizeWithOldSuperviewSize: oldSize]; [super resizeWithOldSuperviewSize: oldSize];
[self adjustSubviews]; [self adjustSubviews];
[[self window] invalidateCursorRectsForView: self]; [window invalidateCursorRectsForView: self];
} }
- (id) delegate - (id) delegate

View file

@ -235,7 +235,7 @@
- (NSRect)contentRect - (NSRect)contentRect
{ {
NSRect cRect = [self frame]; NSRect cRect = frame;
cRect.origin.x = 0; cRect.origin.x = 0;
cRect.origin.y = 0; cRect.origin.y = 0;

View file

@ -613,12 +613,12 @@ object with the NSTableView as the text delegate. */
- (void)scrollRowToVisible:(int)rowIndex - (void)scrollRowToVisible:(int)rowIndex
{ {
[(NSClipView *)[self superview] scrollToPoint:NSZeroPoint]; [(NSClipView *)super_view scrollToPoint:NSZeroPoint];
} }
- (void)scrollColumnToVisible:(int)columnIndex - (void)scrollColumnToVisible:(int)columnIndex
{ {
[(NSClipView *)[self superview] scrollToPoint:NSZeroPoint]; [(NSClipView *)super_view scrollToPoint:NSZeroPoint];
} }
- (BOOL)textShouldBeginEditing:(NSText *)textObject - (BOOL)textShouldBeginEditing:(NSText *)textObject

View file

@ -313,14 +313,14 @@ GSSetDragTypes(NSView* obj, NSArray *types)
* If neither are descendants of each other and either does not have a * If neither are descendants of each other and either does not have a
* superview then they cannot have a common ancestor * superview then they cannot have a common ancestor
*/ */
if (![self superview]) if (!super_view)
return nil; return nil;
if (![aView superview]) if (![aView superview])
return nil; return nil;
/* Find the common ancestor of superviews */ /* Find the common ancestor of superviews */
return [[self superview] ancestorSharedWithView: [aView superview]]; return [super_view ancestorSharedWithView: [aView superview]];
} }
- (BOOL) isDescendantOf: (NSView*)aView - (BOOL) isDescendantOf: (NSView*)aView
@ -999,7 +999,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
{ {
id e, o; id e, o;
if ([self autoresizesSubviews] == NO || is_rotated_from_base == YES) if (autoresize_subviews == NO || is_rotated_from_base == YES)
return; return;
e = [sub_views objectEnumerator]; e = [sub_views objectEnumerator];