Updated for change in NSView ivars

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5719 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2000-01-10 02:04:25 +00:00
parent ba4e5a1834
commit 6358d4df44
16 changed files with 169 additions and 164 deletions

View file

@ -66,10 +66,10 @@
[_cell setBordered: NO];
[_cell setEditable: NO];
[_cell setDrawsBackground: YES];
[_cell setBackgroundColor: [window backgroundColor]];
[_cell setBackgroundColor: [_window backgroundColor]];
_offsets.width = 5;
_offsets.height = 5;
_border_rect = bounds;
_border_rect = _bounds;
_border_type = NSGrooveBorder;
_title_position = NSAtTop;
_title_rect = NSZeroRect;
@ -216,13 +216,13 @@
{
// First calc the sizes to see how much we are off by
NSRect r = [self calcSizesAllowingNegative: YES];
NSRect f = frame;
NSRect f = _frame;
NSAssert(contentFrame.size.width >= 0 && contentFrame.size.height >= 0,
@"illegal content frame supplied");
if (super_view)
r = [super_view convertRect: r fromView: self];
if (_super_view)
r = [_super_view convertRect: r fromView: self];
// Add the difference to the frame
f.size.width = f.size.width + (contentFrame.size.width - r.size.width);
@ -283,9 +283,9 @@
f.size.width = titleSize.width;
}
if (super_view != nil)
[self setFrameFromContentFrame: [self convertRect: f toView: super_view]];
else // super_view == nil
if (_super_view != nil)
[self setFrameFromContentFrame: [self convertRect: f toView: _super_view]];
else // _super_view == nil
[self setFrameFromContentFrame: f];
}
@ -320,9 +320,9 @@
//
- (void) drawRect: (NSRect)rect
{
rect = NSIntersectionRect(bounds, rect);
rect = NSIntersectionRect(_bounds, rect);
// Fill inside
[[window backgroundColor] set];
[[_window backgroundColor] set];
NSRectFill(rect);
// Draw border
@ -345,7 +345,7 @@
// Draw title
if (_title_position != NSNoTitle)
{
[_cell setBackgroundColor: [window backgroundColor]];
[_cell setBackgroundColor: [_window backgroundColor]];
[_cell drawWithFrame: _title_rect inView: self];
}
}
@ -382,7 +382,7 @@
at: &_title_position];
// The content view is our only sub_view
if ([sub_views count] == 0)
if ([_sub_views count] == 0)
{
NSDebugLLog(@"NSBox", @"NSBox: decoding without content view\n");
@ -392,11 +392,11 @@
}
else
{
if ([sub_views count] != 1)
if ([_sub_views count] != 1)
{
NSLog (@"Warning: Encoded NSBox with more than one content view!");
}
_content_view = [sub_views objectAtIndex: 0];
_content_view = [_sub_views objectAtIndex: 0];
// The following also computes _title_rect and _border_rect.
[_content_view setFrame: [self calcSizesAllowingNegative: NO]];
}
@ -416,7 +416,7 @@
case NSNoTitle:
{
NSSize borderSize = _sizeForBorderType (_border_type);
_border_rect = bounds;
_border_rect = _bounds;
_title_rect = NSZeroRect;
// Add the offsets to the border rect
@ -440,7 +440,7 @@
titleSize.height += 1;
// Adjust border rect by title cell
_border_rect = bounds;
_border_rect = _bounds;
_border_rect.size.height -= titleSize.height + borderSize.height;
// Add the offsets to the border rect
@ -452,10 +452,10 @@
- (2 * borderSize.height);
// center the title cell
c = (bounds.size.width - titleSize.width) / 2;
c = (_bounds.size.width - titleSize.width) / 2;
if (c < 0) c = 0;
_title_rect.origin.x = bounds.origin.x + c;
_title_rect.origin.y = bounds.origin.y + _border_rect.size.height
_title_rect.origin.x = _bounds.origin.x + c;
_title_rect.origin.y = _bounds.origin.y + _border_rect.size.height
+ borderSize.height;
_title_rect.size = titleSize;
@ -472,7 +472,7 @@
titleSize.height += 1;
// Adjust border rect by title cell
_border_rect = bounds;
_border_rect = _bounds;
// Add the offsets to the border rect
r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width;
@ -505,7 +505,7 @@
titleSize.width += 1;
titleSize.height += 1;
_border_rect = bounds;
_border_rect = _bounds;
// Adjust by the title size
_border_rect.size.height -= titleSize.height / 2;
@ -541,7 +541,7 @@
titleSize.width += 1;
titleSize.height += 1;
_border_rect = bounds;
_border_rect = _bounds;
// Adjust by the title size
_border_rect.origin.y += titleSize.height / 2;
@ -579,7 +579,7 @@
titleSize.height += 1;
// Adjust by the title
_border_rect = bounds;
_border_rect = _bounds;
_border_rect.origin.y += titleSize.height + borderSize.height;
_border_rect.size.height -= titleSize.height + borderSize.height;
@ -610,7 +610,7 @@
titleSize.width += 1;
titleSize.height += 1;
_border_rect = bounds;
_border_rect = _bounds;
// Add the offsets to the border rect
r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width;

View file

@ -254,7 +254,7 @@ id _nsbuttonCellClass = nil;
- (void) highlight: (BOOL)flag
{
[_cell highlight: flag withFrame: bounds inView: self];
[_cell highlight: flag withFrame: _bounds inView: self];
}
//

View file

@ -89,12 +89,12 @@
_rFlags.flipped_view = [self isFlipped];
/* TODO: invoke superview's reflectScrolledClipView: ? */
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) resetCursorRects
{
[self addCursorRect: bounds cursor: _cursor];
[self addCursorRect: _bounds cursor: _cursor];
}
- (void) scrollToPoint: (NSPoint)point
@ -104,7 +104,7 @@
- (void) setBoundsOrigin: (NSPoint)point
{
NSRect originalBounds = bounds;
NSRect originalBounds = _bounds;
NSRect newBounds = originalBounds;
NSRect intersection;
@ -116,7 +116,7 @@
if (_documentView == nil)
return;
if (_copiesOnScroll && window)
if (_copiesOnScroll && _window)
{
// copy the portion of the view that is common before and after scrolling.
// then tell docview to draw the exposed parts.
@ -200,7 +200,7 @@
[_documentView setNeedsDisplayInRect:
[self convertRect: newBounds toView: _documentView]];
}
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (NSPoint) constrainScrollPoint: (NSPoint)proposedNewOrigin
@ -209,24 +209,24 @@
NSPoint new = proposedNewOrigin;
if (_documentView == nil)
return bounds.origin;
return _bounds.origin;
documentFrame = [_documentView frame];
if (documentFrame.size.width <= bounds.size.width)
if (documentFrame.size.width <= _bounds.size.width)
new.x = documentFrame.origin.x;
else if (proposedNewOrigin.x <= documentFrame.origin.x)
new.x = documentFrame.origin.x;
else if (proposedNewOrigin.x
>= documentFrame.size.width - bounds.size.width)
new.x = documentFrame.size.width - bounds.size.width;
>= documentFrame.size.width - _bounds.size.width)
new.x = documentFrame.size.width - _bounds.size.width;
if (documentFrame.size.height <= bounds.size.height)
if (documentFrame.size.height <= _bounds.size.height)
new.y = documentFrame.origin.y;
else if (proposedNewOrigin.y <= documentFrame.origin.y)
new.y = documentFrame.origin.y;
else if (proposedNewOrigin.y
>= documentFrame.size.height - bounds.size.height)
new.y = documentFrame.size.height - bounds.size.height;
>= documentFrame.size.height - _bounds.size.height)
new.y = documentFrame.size.height - _bounds.size.height;
// make it an integer coordinate in device space
// to avoid some nice effects when scrolling
@ -245,10 +245,10 @@
NSRect rect;
if (_documentView == nil)
return bounds;
return _bounds;
documentFrame = [_documentView frame];
clipViewBounds = bounds;
clipViewBounds = _bounds;
rect.origin = documentFrame.origin;
rect.size.width = MAX(documentFrame.size.width, clipViewBounds.size.width);
rect.size.height = MAX(documentFrame.size.height, clipViewBounds.size.height);
@ -266,7 +266,7 @@
return NSZeroRect;
documentBounds = [_documentView bounds];
clipViewBounds = [self convertRect: bounds toView: _documentView];
clipViewBounds = [self convertRect: _bounds toView: _documentView];
rect = NSIntersectionRect(documentBounds, clipViewBounds);
return rect;
@ -285,49 +285,49 @@
- (void) viewBoundsChanged: (NSNotification*)aNotification
{
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) viewFrameChanged: (NSNotification*)aNotification
{
[self setBoundsOrigin: [self constrainScrollPoint: bounds.origin]];
[super_view reflectScrolledClipView: self];
[self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]];
[_super_view reflectScrolledClipView: self];
}
- (void) scaleUnitSquareToSize: (NSSize)newUnitSize
{
[super scaleUnitSquareToSize: newUnitSize];
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) setBoundsSize: (NSSize)aSize
{
[super setBoundsSize: aSize];
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) setFrameSize: (NSSize)aSize
{
[super setFrameSize: aSize];
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) setFrameOrigin: (NSPoint)aPoint
{
[super setFrameOrigin: aPoint];
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) setFrame: (NSRect)rect
{
[super setFrame: rect];
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (void) translateOriginToPoint: (NSPoint)aPoint
{
[super translateOriginToPoint: aPoint];
[super_view reflectScrolledClipView: self];
[_super_view reflectScrolledClipView: self];
}
- (BOOL) isOpaque

View file

@ -80,7 +80,7 @@
*/
- (void) drawRect: (NSRect)rect
{
NSRect aRect = bounds;
NSRect aRect = _bounds;
if (NSIntersectsRect(aRect, rect) == NO)
return;

View file

@ -318,7 +318,7 @@ static Class cellClass;
{
if (_cell == aCell)
{
[_cell drawWithFrame: bounds inView: self];
[_cell drawWithFrame: _bounds inView: self];
}
}
@ -326,7 +326,7 @@ static Class cellClass;
{
if (_cell == aCell)
{
[_cell drawInteriorWithFrame: bounds
[_cell drawInteriorWithFrame: _bounds
inView: self];
}
}
@ -438,7 +438,7 @@ static Class cellClass;
else
oldActionMask = [_cell sendActionOn: NSPeriodicMask];
[window _captureMouse: self];
[_window _captureMouse: self];
e = theEvent;
while (!done) // loop until mouse goes up
@ -447,20 +447,20 @@ static Class cellClass;
location = [self convertPoint: location fromView: nil];
// ask the cell to track the mouse only
// if the mouse is within the cell
if ((location.x >= 0) && (location.x < bounds.size.width) &&
(location.y >= 0 && location.y < bounds.size.height))
if ((location.x >= 0) && (location.x < _bounds.size.width) &&
(location.y >= 0 && location.y < _bounds.size.height))
{
[_cell highlight: YES withFrame: bounds inView: self];
[window flushWindow];
[_cell highlight: YES withFrame: _bounds inView: self];
[_window flushWindow];
if ([_cell trackMouse: e
inRect: bounds
inRect: _bounds
ofView: self
untilMouseUp: [[_cell class] prefersTrackingUntilMouseUp]])
done = mouseUp = YES;
else
{
[_cell highlight: NO withFrame: bounds inView: self];
[window flushWindow];
[_cell highlight: NO withFrame: _bounds inView: self];
[_window flushWindow];
}
}
@ -476,13 +476,13 @@ static Class cellClass;
done = YES;
}
[window _releaseMouse: self];
[_window _releaseMouse: self];
if (mouseUp)
{
// [cell setState: ![cell state]];
[_cell highlight: NO withFrame: bounds inView: self];
[window flushWindow];
[_cell highlight: NO withFrame: _bounds inView: self];
[_window flushWindow];
}
[_cell sendActionOn: oldActionMask];
@ -493,7 +493,7 @@ static Class cellClass;
- (void) resetCursorRects
{
[_cell resetCursorRect: bounds inView: self];
[_cell resetCursorRect: _bounds inView: self];
}
- (BOOL) ignoresMultiClick

View file

@ -676,8 +676,8 @@ static SEL getSel = @selector(objectAtIndex:);
float approxColsWidth = approxCol * (cellSize.width + intercell.width);
/* First check the limit cases */
beyondCols = (point.x > bounds.size.width || point.x < 0);
beyondRows = (point.y > bounds.size.height || point.y < 0);
beyondCols = (point.x > _bounds.size.width || point.x < 0);
beyondRows = (point.y > _bounds.size.height || point.y < 0);
/* Determine if the point is inside the cell */
betweenRows = !(point.y > approxRowsHeight
@ -1130,17 +1130,17 @@ static SEL getSel = @selector(objectAtIndex:);
// This is a compromise -- and fully OpenStep compliant.
NSSelectionDirection s = NSDirectSelection;
if (window)
s = [window keyViewSelectionDirection];
if (_window)
s = [_window keyViewSelectionDirection];
switch (s)
{
// window selecting backwards
// _window selecting backwards
case NSSelectingPrevious:
[self _selectPreviousSelectableCellBeforeRow: numRows
column: numCols];
break;
// Window selecting forward
// _Window selecting forward
case NSSelectingNext:
[self _selectNextSelectableCellAfterRow: -1
column: -1];
@ -1184,7 +1184,7 @@ static SEL getSel = @selector(objectAtIndex:);
// Now _textObject == nil
{
NSText *t = [window fieldEditor: YES
NSText *t = [_window fieldEditor: YES
forObject: self];
if ([t superview] != nil)
@ -1278,7 +1278,7 @@ static SEL getSel = @selector(objectAtIndex:);
column: _selectedColumn])
break;
}
[window selectKeyViewFollowingView: self];
[_window selectKeyViewFollowingView: self];
break;
case NSBacktabTextMovement:
if (_tabKeyTraversesCells)
@ -1287,7 +1287,7 @@ static SEL getSel = @selector(objectAtIndex:);
column: _selectedColumn])
break;
}
[window selectKeyViewPrecedingView: self];
[_window selectKeyViewPrecedingView: self];
break;
}
}
@ -1598,7 +1598,7 @@ static SEL getSel = @selector(objectAtIndex:);
{
[_selectedCell setState: NSOffState];
[self drawCellAtRow: _selectedRow column: _selectedColumn];
[window flushWindow];
[_window flushWindow];
selectedCells[_selectedRow][_selectedColumn] = NO;
_selectedCell = nil;
_selectedRow = _selectedColumn = -1;
@ -1635,7 +1635,7 @@ static SEL getSel = @selector(objectAtIndex:);
[self highlightCell: YES
atRow: highlightedRow
column: highlightedColumn];
[window flushWindow];
[_window flushWindow];
}
mouseUpInCell = [mouseCell trackMouse: theEvent
@ -1649,7 +1649,7 @@ static SEL getSel = @selector(objectAtIndex:);
atRow: highlightedRow
column: highlightedColumn];
highlightedCell = nil;
[window flushWindow];
[_window flushWindow];
}
}
else
@ -1661,7 +1661,7 @@ static SEL getSel = @selector(objectAtIndex:);
atRow: highlightedRow
column: highlightedColumn];
highlightedCell = nil;
[window flushWindow];
[_window flushWindow];
}
}
@ -1683,7 +1683,7 @@ static SEL getSel = @selector(objectAtIndex:);
if ((mode == NSRadioModeMatrix) && !allowsEmptySelection)
{
[_selectedCell setState: NSOnState];
[window flushWindow];
[_window flushWindow];
}
else
{
@ -1702,7 +1702,7 @@ static SEL getSel = @selector(objectAtIndex:);
[self highlightCell: NO
atRow: highlightedRow
column: highlightedColumn];
[window flushWindow];
[_window flushWindow];
}
}
@ -1748,13 +1748,13 @@ static SEL getSel = @selector(objectAtIndex:);
{
if ([cells[row][column] isSelectable])
{
NSText* t = [window fieldEditor: YES forObject: self];
NSText* t = [_window fieldEditor: YES forObject: self];
if ([t superview] != nil)
{
if ([t resignFirstResponder] == NO)
{
if ([window makeFirstResponder: window] == NO)
if ([_window makeFirstResponder: _window] == NO)
return;
}
}
@ -1841,7 +1841,7 @@ static SEL getSel = @selector(objectAtIndex:);
_selectedRow = row;
_selectedColumn = column;
[aCell highlight: YES withFrame: rect inView: self];
[window flushWindow];
[_window flushWindow];
if ([aCell trackMouse: lastEvent
inRect: rect
@ -1851,7 +1851,7 @@ static SEL getSel = @selector(objectAtIndex:);
[aCell setState: 0];
[aCell highlight: NO withFrame: rect inView: self];
[window flushWindow];
[_window flushWindow];
break;
case NSRadioModeMatrix:
@ -1878,7 +1878,7 @@ static SEL getSel = @selector(objectAtIndex:);
[aCell setState: 1];
[aCell highlight: YES withFrame: rect inView: self];
selectedCells[row][column] = YES;
[window flushWindow];
[_window flushWindow];
break;
case NSListModeMatrix:
@ -1913,7 +1913,7 @@ static SEL getSel = @selector(objectAtIndex:);
withFrame: rect
inView: self];
selectedCells[row][column]=YES;
[window flushWindow];
[_window flushWindow];
break;
}
}
@ -1923,7 +1923,7 @@ static SEL getSel = @selector(objectAtIndex:);
anchor: INDEX_FROM_POINT(anchor)
highlight: YES];
[window flushWindow];
[_window flushWindow];
_selectedCell = aCell;
_selectedRow = row;
_selectedColumn = column;
@ -1980,7 +1980,7 @@ static SEL getSel = @selector(objectAtIndex:);
[_selectedCell highlight: NO withFrame: rect inView: self];
case NSListModeMatrix:
[self setNeedsDisplayInRect: rect];
[window flushWindow];
[_window flushWindow];
case NSHighlightModeMatrix:
case NSTrackModeMatrix:
break;
@ -2328,7 +2328,7 @@ static SEL getSel = @selector(objectAtIndex:);
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
{
NSSize oldBoundsSize = bounds.size;
NSSize oldBoundsSize = _bounds.size;
NSSize newBoundsSize;
NSSize change;
int nc = numCols;
@ -2336,7 +2336,7 @@ static SEL getSel = @selector(objectAtIndex:);
[super resizeWithOldSuperviewSize: oldSize];
newBoundsSize = bounds.size;
newBoundsSize = _bounds.size;
change.height = newBoundsSize.height - oldBoundsSize.height;
change.width = newBoundsSize.width - oldBoundsSize.width;
@ -2441,7 +2441,7 @@ static SEL getSel = @selector(objectAtIndex:);
- (NSText *) currentEditor
{
if (_textObject && ([window firstResponder] == _textObject))
if (_textObject && ([_window firstResponder] == _textObject))
return _textObject;
else
return nil;

View file

@ -1412,10 +1412,10 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
done = YES;
break;
case NSLeftMouseDragged:
location = [window mouseLocationOutsideOfEventStream];
location = [_window mouseLocationOutsideOfEventStream];
if (NSEqualPoints(location, lastLocation) == NO)
{
NSPoint origin = [window frame].origin;
NSPoint origin = [_window frame].origin;
origin.x += (location.x - lastLocation.x);
origin.y += (location.y - lastLocation.y);
@ -1460,8 +1460,8 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
NSImage* closeImage = [NSImage imageNamed: @"common_Close"];
NSImage* closeHImage = [NSImage imageNamed: @"common_CloseH"];
NSSize imageSize = [closeImage size];
NSRect rect = { { frame.size.width - imageSize.width - 4,
(frame.size.height - imageSize.height) / 2},
NSRect rect = { { _frame.size.width - imageSize.width - 4,
(_frame.size.height - imageSize.height) / 2},
{ imageSize.height, imageSize.width } };
int mask = NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin;

View file

@ -176,7 +176,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
[aCell highlight: NO withFrame: aRect inView: self];
[window flushWindow];
[_window flushWindow];
menuv_highlightedItemIndex = -1;
}
@ -191,7 +191,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
[aCell highlight: NO withFrame: aRect inView: self];
[window flushWindow];
[_window flushWindow];
}
if (index != menuv_highlightedItemIndex)
@ -206,7 +206,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
[aCell highlight: YES withFrame: aRect inView: self];
[window flushWindow];
[_window flushWindow];
}
// Set ivar to new index.
@ -540,8 +540,8 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
- (NSRect) innerRect
{
NSRect aRect = {{bounds.origin.x + 1, bounds.origin.y},
{bounds.size.width - 1, bounds.size.height}};
NSRect aRect = {{_bounds.origin.x + 1, _bounds.origin.y},
{_bounds.size.width - 1, _bounds.size.height}};
return aRect;
}
@ -554,9 +554,9 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
[self sizeToFit];
if (index == 0)
theRect.origin.y = bounds.size.height - cellSize.height;
theRect.origin.y = _bounds.size.height - cellSize.height;
else
theRect.origin.y = bounds.size.height - (cellSize.height * (index + 1));
theRect.origin.y = _bounds.size.height - (cellSize.height * (index + 1));
theRect.origin.x = 1;
theRect.size = cellSize;
@ -570,12 +570,12 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
// simple math. (NOTE: if we get horizontal methods we will have to do
// this. Very much like NSTabView.
return ( point.x < frame.origin.x
|| point.x > frame.size.width + frame.origin.x
|| point.y <= frame.origin.y
|| point.y > frame.size.height + frame.origin.y) ?
return ( point.x < _frame.origin.x
|| point.x > _frame.size.width + _frame.origin.x
|| point.y <= _frame.origin.y
|| point.y > _frame.size.height + _frame.origin.y) ?
-1 :
(frame.size.height - point.y) / cellSize.height;
(_frame.size.height - point.y) / cellSize.height;
}
- (void) setNeedsDisplayForItemAtIndex: (int)index
@ -623,7 +623,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
// Get the frameRect
r = [NSMenuWindow frameRectForContentRect: screenRect
styleMask: [window styleMask]];
styleMask: [_window styleMask]];
// Update position,if needed, using the preferredEdge;
// It seems we should be calling [self resizeWindowWithMaxHeight:];
@ -631,7 +631,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
// TODO
// Set the window frame
[window setFrame: r
[_window setFrame: r
display: YES];
}
@ -650,8 +650,8 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
DPSgsave(ctxt);
DPSsetlinewidth(ctxt, 1);
DPSsetgray(ctxt, 0.333);
DPSmoveto(ctxt, bounds.origin.x, bounds.origin.y);
DPSrlineto(ctxt, 0, bounds.size.height);
DPSmoveto(ctxt, _bounds.origin.x, _bounds.origin.y);
DPSrlineto(ctxt, 0, _bounds.size.height);
DPSstroke(ctxt);
DPSgrestore(ctxt);
@ -749,7 +749,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
do
{
location = [window mouseLocationOutsideOfEventStream];
location = [_window mouseLocationOutsideOfEventStream];
index = [self indexOfItemAtPoint: location];
if (index != menuv_highlightedItemIndex)
@ -760,11 +760,11 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
{
if ([menuv_menu isPartlyOffScreen])
{
NSPoint pointerLoc = [window convertBaseToScreen: location];
NSPoint pointerLoc = [_window convertBaseToScreen: location];
// TODO: Why 1 in the Y axis?
if (pointerLoc.x == 0 || pointerLoc.y == 1
|| pointerLoc.x == [[window screen] frame].size.width - 1)
|| pointerLoc.x == [[_window screen] frame].size.width - 1)
[menuv_menu shiftOnScreen];
}
@ -818,7 +818,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
{
NSWindow *w;
location = [window convertBaseToScreen: location];
location = [_window convertBaseToScreen: location];
/*
* If the mouse is back in the supermenu, we return NO so that

View file

@ -310,14 +310,14 @@ Class _nspopupbuttonCellClass = 0;
object: self];
// Attach the popUp
[_cell attachPopUpWithFrame: bounds
[_cell attachPopUpWithFrame: _bounds
inView: self];
// Process events; we start menu events processing by converting
// this event to the menu window, and sending it there.
e = [NSEvent mouseEventWithType: [theEvent type]
location: [[mr window] convertScreenToBase:
[window convertBaseToScreen:
[_window convertBaseToScreen:
[theEvent locationInWindow]]]
modifierFlags: [theEvent modifierFlags]
timestamp: [theEvent timestamp]

View file

@ -153,18 +153,18 @@
// Draw the Bezel
if (isBezeled)
NSDrawGrayBezel(bounds,rect);
NSDrawGrayBezel(_bounds,rect);
// Calc the inside rect to be drawn
if (isBezeled)
{
r = NSMakeRect(NSMinX(bounds) + 2.0,
NSMinY(bounds) + 2.0,
NSWidth(bounds) - 4.0,
NSHeight(bounds) - 4.0);
r = NSMakeRect(NSMinX(_bounds) + 2.0,
NSMinY(_bounds) + 2.0,
NSWidth(_bounds) - 4.0,
NSHeight(_bounds) - 4.0);
}
else
r = bounds;
r = _bounds;
if (isIndeterminate) // Draw indeterminate
{
@ -261,10 +261,10 @@
- (void)_update
{
if (window != nil)
if ([window isVisible])
if (_window != nil)
if ([_window isVisible])
{
[window display];
[_window display];
[GSCurrentContext() flush];
}
}

View file

@ -473,7 +473,7 @@ static Class rulerViewClass = nil;
- (void) tile
{
NSSize contentSize = [isa contentSizeForFrameSize: bounds.size
NSSize contentSize = [isa contentSizeForFrameSize: _bounds.size
hasHorizontalScroller: _hasHorizScroller
hasVerticalScroller: _hasVertScroller
borderType: _borderType];
@ -503,10 +503,10 @@ static Class rulerViewClass = nil;
if (_hasVertScroller)
{
vertScrollerRect.origin.x = bounds.origin.x + borderThickness;
vertScrollerRect.origin.y = bounds.origin.y + borderThickness;
vertScrollerRect.origin.x = _bounds.origin.x + borderThickness;
vertScrollerRect.origin.y = _bounds.origin.y + borderThickness;
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;
}
@ -514,7 +514,7 @@ static Class rulerViewClass = nil;
if (_hasHorizScroller)
{
horizScrollerRect.origin.x = contentRect.origin.x;
horizScrollerRect.origin.y = bounds.origin.y + borderThickness;
horizScrollerRect.origin.y = _bounds.origin.y + borderThickness;
horizScrollerRect.size.width = contentRect.size.width;
horizScrollerRect.size.height = scrollerWidth;
@ -538,7 +538,7 @@ static Class rulerViewClass = nil;
{
NSGraphicsContext *ctxt = GSCurrentContext();
float scrollerWidth = [NSScroller scrollerWidth];
float horizLinePosition, horizLineLength = bounds.size.width;
float horizLinePosition, horizLineLength = _bounds.size.width;
float borderThickness = 0;
DPSgsave(ctxt);
@ -573,7 +573,7 @@ static Class rulerViewClass = nil;
horizLinePosition = scrollerWidth + borderThickness;
horizLineLength -= scrollerWidth + 2 * borderThickness;
DPSmoveto(ctxt, horizLinePosition, borderThickness);
DPSrlineto(ctxt, 0, bounds.size.height - 2 * borderThickness - 1);
DPSrlineto(ctxt, 0, _bounds.size.height - 2 * borderThickness - 1);
DPSstroke(ctxt);
}
@ -582,7 +582,7 @@ static Class rulerViewClass = nil;
float ypos = scrollerWidth + borderThickness + 1;
if (_rFlags.flipped_view)
ypos = bounds.size.height - ypos;
ypos = _bounds.size.height - ypos;
DPSmoveto(ctxt, horizLinePosition, ypos);
DPSrlineto(ctxt, horizLineLength - 1, 0);
DPSstroke(ctxt);

View file

@ -168,7 +168,7 @@ static Class cellClass;
* that represents an exposed part of this view, it will try to draw the
* slider knob positioned in that rectangle ... which is wrong.
*/
[_cell drawWithFrame: bounds inView: self];
[_cell drawWithFrame: _bounds inView: self];
}
- (float)_floatValueForMousePoint: (NSPoint)point knobRect: (NSRect)knobRect
@ -264,8 +264,8 @@ static Class cellClass;
if (floatValue != oldFloatValue)
{
[theCell setFloatValue: floatValue];
[theCell drawWithFrame: bounds inView: self];
[window flushWindow];
[theCell drawWithFrame: _bounds inView: self];
[_window flushWindow];
if (isContinuous)
[target performSelector: action withObject: self];
oldFloatValue = floatValue;
@ -297,8 +297,8 @@ static Class cellClass;
if ([theCell isContinuous])
[[theCell target] performSelector: [theCell action]
withObject: self];
[theCell drawWithFrame: bounds inView: self];
[window flushWindow];
[theCell drawWithFrame: _bounds inView: self];
[_window flushWindow];
}
[self trackKnob: theEvent knobRect: rect];

View file

@ -84,7 +84,7 @@
if (count < 2)
return;
[window setAcceptsMouseMovedEvents: YES];
[_window setAcceptsMouseMovedEvents: YES];
vis = [self visibleRect];
/* find out which divider it is */
@ -152,7 +152,7 @@
if (_isVertical == NO)
{
divVertical = _dividerWidth;
divHorizontal = NSWidth(frame);
divHorizontal = NSWidth(_frame);
/* set the default limits on the dragging */
minCoord = NSMinY(bigRect) + divVertical;
maxCoord = NSHeight(bigRect) + NSMinY(bigRect) - divVertical;
@ -160,7 +160,7 @@
else
{
divHorizontal = _dividerWidth;
divVertical = NSHeight(frame);
divVertical = NSHeight(_frame);
/* set the default limits on the dragging */
minCoord = NSMinX(bigRect) + divHorizontal;
maxCoord = NSWidth(bigRect) + NSMinX(bigRect) - divHorizontal;
@ -296,10 +296,10 @@
(int)NSMinX(r1),(int)NSMinY(r1),(int)NSWidth(r1),
(int)NSHeight(r1));
[window invalidateCursorRectsForView: self];
[_window invalidateCursorRectsForView: self];
RETURN_LABEL:
[window setAcceptsMouseMovedEvents: NO];
[_window setAcceptsMouseMovedEvents: NO];
[self setNeedsDisplay: YES];
[self display];
@ -316,7 +316,7 @@ RETURN_LABEL:
respondsToSelector:
@selector(splitView:resizeSubviewsWithOldSize:)])
{
[_delegate splitView: self resizeSubviewsWithOldSize: frame.size];
[_delegate splitView: self resizeSubviewsWithOldSize: _frame.size];
}
else
{ /* split the area up evenly */
@ -336,7 +336,7 @@ RETURN_LABEL:
[subs getObjects: views];
if (_isVertical == NO)
{
newTotal = NSHeight(bounds) - _dividerWidth*(count - 1);
newTotal = NSHeight(_bounds) - _dividerWidth*(count - 1);
oldTotal = 0.0;
for (i = 0; i < count; i++)
{
@ -355,7 +355,7 @@ RETURN_LABEL:
newHeight = floor(newHeight);
else
newHeight = ceil(newHeight);
newSize = NSMakeSize(NSWidth(bounds), newHeight);
newSize = NSMakeSize(NSWidth(_bounds), newHeight);
running -= newHeight;
newPoint = NSMakePoint(0.0, running);
running -= _dividerWidth;
@ -365,7 +365,7 @@ RETURN_LABEL:
}
else
{
newTotal = NSWidth(bounds) - _dividerWidth*(count - 1);
newTotal = NSWidth(_bounds) - _dividerWidth*(count - 1);
oldTotal = 0.0;
for (i = 0; i < count; i++)
{
@ -383,7 +383,7 @@ RETURN_LABEL:
newWidth = floor(newWidth);
else
newWidth = ceil(newWidth);
newSize = NSMakeSize(newWidth, NSHeight(bounds));
newSize = NSMakeSize(newWidth, NSHeight(_bounds));
newPoint = NSMakePoint(running, 0.0);
running += newWidth + _dividerWidth;
[views[i] setFrameSize: newSize];
@ -540,7 +540,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
{
[super resizeWithOldSuperviewSize: oldSize];
[self adjustSubviews];
[window invalidateCursorRectsForView: self];
[_window invalidateCursorRectsForView: self];
}
- (id) delegate

View file

@ -236,7 +236,7 @@
- (NSRect)contentRect
{
NSRect cRect = frame;
NSRect cRect = _frame;
cRect.origin.x = 0;
cRect.origin.y = 0;
@ -268,7 +268,7 @@
NSRect previousRect;
int previousState = 0;
rect = NSIntersectionRect(bounds, rect);
rect = NSIntersectionRect(_bounds, rect);
DPSgsave(ctxt);
@ -542,6 +542,11 @@
DPSgrestore(ctxt);
}
- (BOOL) isOpaque
{
return NO;
}
// Event handling.
- (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point
@ -572,7 +577,7 @@
// [self setNeedsDisplay:YES];
// [window update];
// [_window update];
return [super hitTest:aPoint];
}

View file

@ -119,9 +119,9 @@
NSAssert(columnIndex > 0, NSInternalInconsistencyException);
NSAssert(columnIndex < [columns count], NSInternalInconsistencyException);
rect.origin.x = bounds.origin.x;
rect.origin.y = bounds.origin.y;
rect.size.height = bounds.size.height;
rect.origin.x = _bounds.origin.x;
rect.origin.y = _bounds.origin.y;
rect.size.height = _bounds.size.height;
for (i = 0; i < columnIndex; i++)
{

View file

@ -115,13 +115,13 @@
//
- (void) selectText: (id)sender
{
if ([self isSelectable] && (super_view != nil))
if ([self isSelectable] && (_super_view != nil))
{
if (_text_object)
[_text_object selectAll: self];
else
{
NSText *t = [window fieldEditor: YES
NSText *t = [_window fieldEditor: YES
forObject: self];
if ([t superview] != nil)
@ -130,7 +130,7 @@
// [NSCursor hide];
_text_object = [_cell setUpFieldEditorAttributes: t];
[_cell selectWithFrame: bounds
[_cell selectWithFrame: _bounds
inView: self
editor: _text_object
delegate: self
@ -271,13 +271,13 @@
if (_text_object)
return;
t = [window fieldEditor: YES forObject: self];
t = [_window fieldEditor: YES forObject: self];
if ([t superview] != nil)
{
if ([t resignFirstResponder] == NO)
{
if ([window makeFirstResponder: window] == NO)
if ([_window makeFirstResponder: _window] == NO)
return;
}
}
@ -286,7 +286,7 @@
// [NSCursor hide];
_text_object = [_cell setUpFieldEditorAttributes: t];
[_cell editWithFrame: bounds
[_cell editWithFrame: _bounds
inView: self
editor: _text_object
delegate: self
@ -322,7 +322,7 @@
- (NSText *) currentEditor
{
if (_text_object && ([window firstResponder] == _text_object))
if (_text_object && ([_window firstResponder] == _text_object))
return _text_object;
else
return nil;
@ -383,10 +383,10 @@
[self sendAction: [self action] to: [self target]];
break;
case NSTabTextMovement:
[window selectKeyViewFollowingView: self];
[_window selectKeyViewFollowingView: self];
break;
case NSBacktabTextMovement:
[window selectKeyViewPrecedingView: self];
[_window selectKeyViewPrecedingView: self];
break;
}
}