mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
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:
parent
0a6a692734
commit
475b802dee
16 changed files with 169 additions and 164 deletions
|
@ -66,10 +66,10 @@
|
||||||
[_cell setBordered: NO];
|
[_cell setBordered: NO];
|
||||||
[_cell setEditable: NO];
|
[_cell setEditable: NO];
|
||||||
[_cell setDrawsBackground: YES];
|
[_cell setDrawsBackground: YES];
|
||||||
[_cell setBackgroundColor: [window backgroundColor]];
|
[_cell setBackgroundColor: [_window backgroundColor]];
|
||||||
_offsets.width = 5;
|
_offsets.width = 5;
|
||||||
_offsets.height = 5;
|
_offsets.height = 5;
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
_border_type = NSGrooveBorder;
|
_border_type = NSGrooveBorder;
|
||||||
_title_position = NSAtTop;
|
_title_position = NSAtTop;
|
||||||
_title_rect = NSZeroRect;
|
_title_rect = NSZeroRect;
|
||||||
|
@ -216,13 +216,13 @@
|
||||||
{
|
{
|
||||||
// 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 = 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");
|
||||||
|
|
||||||
if (super_view)
|
if (_super_view)
|
||||||
r = [super_view convertRect: r fromView: self];
|
r = [_super_view convertRect: r fromView: self];
|
||||||
|
|
||||||
// Add the difference to the frame
|
// Add the difference to the frame
|
||||||
f.size.width = f.size.width + (contentFrame.size.width - r.size.width);
|
f.size.width = f.size.width + (contentFrame.size.width - r.size.width);
|
||||||
|
@ -283,9 +283,9 @@
|
||||||
f.size.width = titleSize.width;
|
f.size.width = titleSize.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (super_view != nil)
|
if (_super_view != nil)
|
||||||
[self setFrameFromContentFrame: [self convertRect: f toView: super_view]];
|
[self setFrameFromContentFrame: [self convertRect: f toView: _super_view]];
|
||||||
else // super_view == nil
|
else // _super_view == nil
|
||||||
[self setFrameFromContentFrame: f];
|
[self setFrameFromContentFrame: f];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,9 +320,9 @@
|
||||||
//
|
//
|
||||||
- (void) drawRect: (NSRect)rect
|
- (void) drawRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
rect = NSIntersectionRect(bounds, rect);
|
rect = NSIntersectionRect(_bounds, rect);
|
||||||
// Fill inside
|
// Fill inside
|
||||||
[[window backgroundColor] set];
|
[[_window backgroundColor] set];
|
||||||
NSRectFill(rect);
|
NSRectFill(rect);
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
|
@ -345,7 +345,7 @@
|
||||||
// Draw title
|
// Draw title
|
||||||
if (_title_position != NSNoTitle)
|
if (_title_position != NSNoTitle)
|
||||||
{
|
{
|
||||||
[_cell setBackgroundColor: [window backgroundColor]];
|
[_cell setBackgroundColor: [_window backgroundColor]];
|
||||||
[_cell drawWithFrame: _title_rect inView: self];
|
[_cell drawWithFrame: _title_rect inView: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@
|
||||||
at: &_title_position];
|
at: &_title_position];
|
||||||
|
|
||||||
// The content view is our only sub_view
|
// 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");
|
NSDebugLLog(@"NSBox", @"NSBox: decoding without content view\n");
|
||||||
|
@ -392,11 +392,11 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ([sub_views count] != 1)
|
if ([_sub_views count] != 1)
|
||||||
{
|
{
|
||||||
NSLog (@"Warning: Encoded NSBox with more than one content view!");
|
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.
|
// The following also computes _title_rect and _border_rect.
|
||||||
[_content_view setFrame: [self calcSizesAllowingNegative: NO]];
|
[_content_view setFrame: [self calcSizesAllowingNegative: NO]];
|
||||||
}
|
}
|
||||||
|
@ -416,7 +416,7 @@
|
||||||
case NSNoTitle:
|
case NSNoTitle:
|
||||||
{
|
{
|
||||||
NSSize borderSize = _sizeForBorderType (_border_type);
|
NSSize borderSize = _sizeForBorderType (_border_type);
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
_title_rect = NSZeroRect;
|
_title_rect = NSZeroRect;
|
||||||
|
|
||||||
// Add the offsets to the border rect
|
// Add the offsets to the border rect
|
||||||
|
@ -440,7 +440,7 @@
|
||||||
titleSize.height += 1;
|
titleSize.height += 1;
|
||||||
|
|
||||||
// Adjust border rect by title cell
|
// Adjust border rect by title cell
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
_border_rect.size.height -= titleSize.height + borderSize.height;
|
_border_rect.size.height -= titleSize.height + borderSize.height;
|
||||||
|
|
||||||
// Add the offsets to the border rect
|
// Add the offsets to the border rect
|
||||||
|
@ -452,10 +452,10 @@
|
||||||
- (2 * borderSize.height);
|
- (2 * borderSize.height);
|
||||||
|
|
||||||
// center the title cell
|
// center the title cell
|
||||||
c = (bounds.size.width - titleSize.width) / 2;
|
c = (_bounds.size.width - titleSize.width) / 2;
|
||||||
if (c < 0) c = 0;
|
if (c < 0) c = 0;
|
||||||
_title_rect.origin.x = bounds.origin.x + c;
|
_title_rect.origin.x = _bounds.origin.x + c;
|
||||||
_title_rect.origin.y = bounds.origin.y + _border_rect.size.height
|
_title_rect.origin.y = _bounds.origin.y + _border_rect.size.height
|
||||||
+ borderSize.height;
|
+ borderSize.height;
|
||||||
_title_rect.size = titleSize;
|
_title_rect.size = titleSize;
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@
|
||||||
titleSize.height += 1;
|
titleSize.height += 1;
|
||||||
|
|
||||||
// Adjust border rect by title cell
|
// Adjust border rect by title cell
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
|
|
||||||
// Add the offsets to the border rect
|
// Add the offsets to the border rect
|
||||||
r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width;
|
r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width;
|
||||||
|
@ -505,7 +505,7 @@
|
||||||
titleSize.width += 1;
|
titleSize.width += 1;
|
||||||
titleSize.height += 1;
|
titleSize.height += 1;
|
||||||
|
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
|
|
||||||
// Adjust by the title size
|
// Adjust by the title size
|
||||||
_border_rect.size.height -= titleSize.height / 2;
|
_border_rect.size.height -= titleSize.height / 2;
|
||||||
|
@ -541,7 +541,7 @@
|
||||||
titleSize.width += 1;
|
titleSize.width += 1;
|
||||||
titleSize.height += 1;
|
titleSize.height += 1;
|
||||||
|
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
|
|
||||||
// Adjust by the title size
|
// Adjust by the title size
|
||||||
_border_rect.origin.y += titleSize.height / 2;
|
_border_rect.origin.y += titleSize.height / 2;
|
||||||
|
@ -579,7 +579,7 @@
|
||||||
titleSize.height += 1;
|
titleSize.height += 1;
|
||||||
|
|
||||||
// Adjust by the title
|
// Adjust by the title
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
_border_rect.origin.y += titleSize.height + borderSize.height;
|
_border_rect.origin.y += titleSize.height + borderSize.height;
|
||||||
_border_rect.size.height -= titleSize.height + borderSize.height;
|
_border_rect.size.height -= titleSize.height + borderSize.height;
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@
|
||||||
titleSize.width += 1;
|
titleSize.width += 1;
|
||||||
titleSize.height += 1;
|
titleSize.height += 1;
|
||||||
|
|
||||||
_border_rect = bounds;
|
_border_rect = _bounds;
|
||||||
|
|
||||||
// Add the offsets to the border rect
|
// Add the offsets to the border rect
|
||||||
r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width;
|
r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width;
|
||||||
|
|
|
@ -254,7 +254,7 @@ id _nsbuttonCellClass = nil;
|
||||||
|
|
||||||
- (void) highlight: (BOOL)flag
|
- (void) highlight: (BOOL)flag
|
||||||
{
|
{
|
||||||
[_cell highlight: flag withFrame: bounds inView: self];
|
[_cell highlight: flag withFrame: _bounds inView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -89,12 +89,12 @@
|
||||||
_rFlags.flipped_view = [self isFlipped];
|
_rFlags.flipped_view = [self isFlipped];
|
||||||
|
|
||||||
/* TODO: invoke superview's reflectScrolledClipView: ? */
|
/* TODO: invoke superview's reflectScrolledClipView: ? */
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) resetCursorRects
|
- (void) resetCursorRects
|
||||||
{
|
{
|
||||||
[self addCursorRect: 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 = 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 && 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.
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
[_documentView setNeedsDisplayInRect:
|
[_documentView setNeedsDisplayInRect:
|
||||||
[self convertRect: newBounds toView: _documentView]];
|
[self convertRect: newBounds toView: _documentView]];
|
||||||
}
|
}
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSPoint) constrainScrollPoint: (NSPoint)proposedNewOrigin
|
- (NSPoint) constrainScrollPoint: (NSPoint)proposedNewOrigin
|
||||||
|
@ -209,24 +209,24 @@
|
||||||
NSPoint new = proposedNewOrigin;
|
NSPoint new = proposedNewOrigin;
|
||||||
|
|
||||||
if (_documentView == nil)
|
if (_documentView == nil)
|
||||||
return bounds.origin;
|
return _bounds.origin;
|
||||||
|
|
||||||
documentFrame = [_documentView frame];
|
documentFrame = [_documentView frame];
|
||||||
if (documentFrame.size.width <= bounds.size.width)
|
if (documentFrame.size.width <= _bounds.size.width)
|
||||||
new.x = documentFrame.origin.x;
|
new.x = documentFrame.origin.x;
|
||||||
else if (proposedNewOrigin.x <= documentFrame.origin.x)
|
else if (proposedNewOrigin.x <= documentFrame.origin.x)
|
||||||
new.x = documentFrame.origin.x;
|
new.x = documentFrame.origin.x;
|
||||||
else if (proposedNewOrigin.x
|
else if (proposedNewOrigin.x
|
||||||
>= documentFrame.size.width - bounds.size.width)
|
>= documentFrame.size.width - _bounds.size.width)
|
||||||
new.x = 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;
|
new.y = documentFrame.origin.y;
|
||||||
else if (proposedNewOrigin.y <= documentFrame.origin.y)
|
else if (proposedNewOrigin.y <= documentFrame.origin.y)
|
||||||
new.y = documentFrame.origin.y;
|
new.y = documentFrame.origin.y;
|
||||||
else if (proposedNewOrigin.y
|
else if (proposedNewOrigin.y
|
||||||
>= documentFrame.size.height - bounds.size.height)
|
>= documentFrame.size.height - _bounds.size.height)
|
||||||
new.y = documentFrame.size.height - bounds.size.height;
|
new.y = documentFrame.size.height - _bounds.size.height;
|
||||||
|
|
||||||
// make it an integer coordinate in device space
|
// make it an integer coordinate in device space
|
||||||
// to avoid some nice effects when scrolling
|
// to avoid some nice effects when scrolling
|
||||||
|
@ -245,10 +245,10 @@
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
|
|
||||||
if (_documentView == nil)
|
if (_documentView == nil)
|
||||||
return bounds;
|
return _bounds;
|
||||||
|
|
||||||
documentFrame = [_documentView frame];
|
documentFrame = [_documentView frame];
|
||||||
clipViewBounds = bounds;
|
clipViewBounds = _bounds;
|
||||||
rect.origin = documentFrame.origin;
|
rect.origin = documentFrame.origin;
|
||||||
rect.size.width = MAX(documentFrame.size.width, clipViewBounds.size.width);
|
rect.size.width = MAX(documentFrame.size.width, clipViewBounds.size.width);
|
||||||
rect.size.height = MAX(documentFrame.size.height, clipViewBounds.size.height);
|
rect.size.height = MAX(documentFrame.size.height, clipViewBounds.size.height);
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
return NSZeroRect;
|
return NSZeroRect;
|
||||||
|
|
||||||
documentBounds = [_documentView bounds];
|
documentBounds = [_documentView bounds];
|
||||||
clipViewBounds = [self convertRect: bounds toView: _documentView];
|
clipViewBounds = [self convertRect: _bounds toView: _documentView];
|
||||||
rect = NSIntersectionRect(documentBounds, clipViewBounds);
|
rect = NSIntersectionRect(documentBounds, clipViewBounds);
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
|
@ -285,49 +285,49 @@
|
||||||
|
|
||||||
- (void) viewBoundsChanged: (NSNotification*)aNotification
|
- (void) viewBoundsChanged: (NSNotification*)aNotification
|
||||||
{
|
{
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) viewFrameChanged: (NSNotification*)aNotification
|
- (void) viewFrameChanged: (NSNotification*)aNotification
|
||||||
{
|
{
|
||||||
[self setBoundsOrigin: [self constrainScrollPoint: bounds.origin]];
|
[self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) scaleUnitSquareToSize: (NSSize)newUnitSize
|
- (void) scaleUnitSquareToSize: (NSSize)newUnitSize
|
||||||
{
|
{
|
||||||
[super scaleUnitSquareToSize: newUnitSize];
|
[super scaleUnitSquareToSize: newUnitSize];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setBoundsSize: (NSSize)aSize
|
- (void) setBoundsSize: (NSSize)aSize
|
||||||
{
|
{
|
||||||
[super setBoundsSize: aSize];
|
[super setBoundsSize: aSize];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setFrameSize: (NSSize)aSize
|
- (void) setFrameSize: (NSSize)aSize
|
||||||
{
|
{
|
||||||
[super setFrameSize: aSize];
|
[super setFrameSize: aSize];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setFrameOrigin: (NSPoint)aPoint
|
- (void) setFrameOrigin: (NSPoint)aPoint
|
||||||
{
|
{
|
||||||
[super setFrameOrigin: aPoint];
|
[super setFrameOrigin: aPoint];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setFrame: (NSRect)rect
|
- (void) setFrame: (NSRect)rect
|
||||||
{
|
{
|
||||||
[super setFrame: rect];
|
[super setFrame: rect];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) translateOriginToPoint: (NSPoint)aPoint
|
- (void) translateOriginToPoint: (NSPoint)aPoint
|
||||||
{
|
{
|
||||||
[super translateOriginToPoint: aPoint];
|
[super translateOriginToPoint: aPoint];
|
||||||
[super_view reflectScrolledClipView: self];
|
[_super_view reflectScrolledClipView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) isOpaque
|
- (BOOL) isOpaque
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
*/
|
*/
|
||||||
- (void) drawRect: (NSRect)rect
|
- (void) drawRect: (NSRect)rect
|
||||||
{
|
{
|
||||||
NSRect aRect = bounds;
|
NSRect aRect = _bounds;
|
||||||
|
|
||||||
if (NSIntersectsRect(aRect, rect) == NO)
|
if (NSIntersectsRect(aRect, rect) == NO)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -318,7 +318,7 @@ static Class cellClass;
|
||||||
{
|
{
|
||||||
if (_cell == aCell)
|
if (_cell == aCell)
|
||||||
{
|
{
|
||||||
[_cell drawWithFrame: bounds inView: self];
|
[_cell drawWithFrame: _bounds inView: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ static Class cellClass;
|
||||||
{
|
{
|
||||||
if (_cell == aCell)
|
if (_cell == aCell)
|
||||||
{
|
{
|
||||||
[_cell drawInteriorWithFrame: bounds
|
[_cell drawInteriorWithFrame: _bounds
|
||||||
inView: self];
|
inView: self];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -438,7 +438,7 @@ static Class cellClass;
|
||||||
else
|
else
|
||||||
oldActionMask = [_cell sendActionOn: NSPeriodicMask];
|
oldActionMask = [_cell sendActionOn: NSPeriodicMask];
|
||||||
|
|
||||||
[window _captureMouse: self];
|
[_window _captureMouse: self];
|
||||||
|
|
||||||
e = theEvent;
|
e = theEvent;
|
||||||
while (!done) // loop until mouse goes up
|
while (!done) // loop until mouse goes up
|
||||||
|
@ -447,20 +447,20 @@ static Class cellClass;
|
||||||
location = [self convertPoint: location fromView: nil];
|
location = [self convertPoint: location fromView: nil];
|
||||||
// ask the cell to track the mouse only
|
// ask the cell to track the mouse only
|
||||||
// if the mouse is within the cell
|
// if the mouse is within the cell
|
||||||
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: [[_cell class] prefersTrackingUntilMouseUp]])
|
untilMouseUp: [[_cell class] prefersTrackingUntilMouseUp]])
|
||||||
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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,13 +476,13 @@ static Class cellClass;
|
||||||
done = YES;
|
done = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
[window _releaseMouse: self];
|
[_window _releaseMouse: self];
|
||||||
|
|
||||||
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];
|
||||||
|
@ -493,7 +493,7 @@ static Class cellClass;
|
||||||
|
|
||||||
- (void) resetCursorRects
|
- (void) resetCursorRects
|
||||||
{
|
{
|
||||||
[_cell resetCursorRect: bounds inView: self];
|
[_cell resetCursorRect: _bounds inView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) ignoresMultiClick
|
- (BOOL) ignoresMultiClick
|
||||||
|
|
|
@ -676,8 +676,8 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
float approxColsWidth = approxCol * (cellSize.width + intercell.width);
|
float approxColsWidth = approxCol * (cellSize.width + intercell.width);
|
||||||
|
|
||||||
/* First check the limit cases */
|
/* First check the limit cases */
|
||||||
beyondCols = (point.x > bounds.size.width || point.x < 0);
|
beyondCols = (point.x > _bounds.size.width || point.x < 0);
|
||||||
beyondRows = (point.y > bounds.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
|
||||||
|
@ -1130,17 +1130,17 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
// This is a compromise -- and fully OpenStep compliant.
|
// This is a compromise -- and fully OpenStep compliant.
|
||||||
NSSelectionDirection s = NSDirectSelection;
|
NSSelectionDirection s = NSDirectSelection;
|
||||||
|
|
||||||
if (window)
|
if (_window)
|
||||||
s = [window keyViewSelectionDirection];
|
s = [_window keyViewSelectionDirection];
|
||||||
|
|
||||||
switch (s)
|
switch (s)
|
||||||
{
|
{
|
||||||
// window selecting backwards
|
// _window selecting backwards
|
||||||
case NSSelectingPrevious:
|
case NSSelectingPrevious:
|
||||||
[self _selectPreviousSelectableCellBeforeRow: numRows
|
[self _selectPreviousSelectableCellBeforeRow: numRows
|
||||||
column: numCols];
|
column: numCols];
|
||||||
break;
|
break;
|
||||||
// Window selecting forward
|
// _Window selecting forward
|
||||||
case NSSelectingNext:
|
case NSSelectingNext:
|
||||||
[self _selectNextSelectableCellAfterRow: -1
|
[self _selectNextSelectableCellAfterRow: -1
|
||||||
column: -1];
|
column: -1];
|
||||||
|
@ -1184,7 +1184,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
|
|
||||||
// Now _textObject == nil
|
// Now _textObject == nil
|
||||||
{
|
{
|
||||||
NSText *t = [window fieldEditor: YES
|
NSText *t = [_window fieldEditor: YES
|
||||||
forObject: self];
|
forObject: self];
|
||||||
|
|
||||||
if ([t superview] != nil)
|
if ([t superview] != nil)
|
||||||
|
@ -1278,7 +1278,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
column: _selectedColumn])
|
column: _selectedColumn])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[window selectKeyViewFollowingView: self];
|
[_window selectKeyViewFollowingView: self];
|
||||||
break;
|
break;
|
||||||
case NSBacktabTextMovement:
|
case NSBacktabTextMovement:
|
||||||
if (_tabKeyTraversesCells)
|
if (_tabKeyTraversesCells)
|
||||||
|
@ -1287,7 +1287,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
column: _selectedColumn])
|
column: _selectedColumn])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[window selectKeyViewPrecedingView: self];
|
[_window selectKeyViewPrecedingView: self];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1598,7 +1598,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
{
|
{
|
||||||
[_selectedCell setState: NSOffState];
|
[_selectedCell setState: NSOffState];
|
||||||
[self drawCellAtRow: _selectedRow column: _selectedColumn];
|
[self drawCellAtRow: _selectedRow column: _selectedColumn];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
selectedCells[_selectedRow][_selectedColumn] = NO;
|
selectedCells[_selectedRow][_selectedColumn] = NO;
|
||||||
_selectedCell = nil;
|
_selectedCell = nil;
|
||||||
_selectedRow = _selectedColumn = -1;
|
_selectedRow = _selectedColumn = -1;
|
||||||
|
@ -1635,7 +1635,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
[self highlightCell: YES
|
[self highlightCell: YES
|
||||||
atRow: highlightedRow
|
atRow: highlightedRow
|
||||||
column: highlightedColumn];
|
column: highlightedColumn];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseUpInCell = [mouseCell trackMouse: theEvent
|
mouseUpInCell = [mouseCell trackMouse: theEvent
|
||||||
|
@ -1649,7 +1649,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
atRow: highlightedRow
|
atRow: highlightedRow
|
||||||
column: highlightedColumn];
|
column: highlightedColumn];
|
||||||
highlightedCell = nil;
|
highlightedCell = nil;
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1661,7 +1661,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
atRow: highlightedRow
|
atRow: highlightedRow
|
||||||
column: highlightedColumn];
|
column: highlightedColumn];
|
||||||
highlightedCell = nil;
|
highlightedCell = nil;
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1683,7 +1683,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
if ((mode == NSRadioModeMatrix) && !allowsEmptySelection)
|
if ((mode == NSRadioModeMatrix) && !allowsEmptySelection)
|
||||||
{
|
{
|
||||||
[_selectedCell setState: NSOnState];
|
[_selectedCell setState: NSOnState];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1702,7 +1702,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
[self highlightCell: NO
|
[self highlightCell: NO
|
||||||
atRow: highlightedRow
|
atRow: highlightedRow
|
||||||
column: highlightedColumn];
|
column: highlightedColumn];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1748,13 +1748,13 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
{
|
{
|
||||||
if ([cells[row][column] isSelectable])
|
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 superview] != nil)
|
||||||
{
|
{
|
||||||
if ([t resignFirstResponder] == NO)
|
if ([t resignFirstResponder] == NO)
|
||||||
{
|
{
|
||||||
if ([window makeFirstResponder: window] == NO)
|
if ([_window makeFirstResponder: _window] == NO)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1841,7 +1841,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
_selectedRow = row;
|
_selectedRow = row;
|
||||||
_selectedColumn = column;
|
_selectedColumn = column;
|
||||||
[aCell highlight: YES withFrame: rect inView: self];
|
[aCell highlight: YES withFrame: rect inView: self];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
|
|
||||||
if ([aCell trackMouse: lastEvent
|
if ([aCell trackMouse: lastEvent
|
||||||
inRect: rect
|
inRect: rect
|
||||||
|
@ -1851,7 +1851,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
|
|
||||||
[aCell setState: 0];
|
[aCell setState: 0];
|
||||||
[aCell highlight: NO withFrame: rect inView: self];
|
[aCell highlight: NO withFrame: rect inView: self];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSRadioModeMatrix:
|
case NSRadioModeMatrix:
|
||||||
|
@ -1878,7 +1878,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
[aCell setState: 1];
|
[aCell setState: 1];
|
||||||
[aCell highlight: YES withFrame: rect inView: self];
|
[aCell highlight: YES withFrame: rect inView: self];
|
||||||
selectedCells[row][column] = YES;
|
selectedCells[row][column] = YES;
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSListModeMatrix:
|
case NSListModeMatrix:
|
||||||
|
@ -1913,7 +1913,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
withFrame: rect
|
withFrame: rect
|
||||||
inView: self];
|
inView: self];
|
||||||
selectedCells[row][column]=YES;
|
selectedCells[row][column]=YES;
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1923,7 +1923,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
anchor: INDEX_FROM_POINT(anchor)
|
anchor: INDEX_FROM_POINT(anchor)
|
||||||
highlight: YES];
|
highlight: YES];
|
||||||
|
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
_selectedCell = aCell;
|
_selectedCell = aCell;
|
||||||
_selectedRow = row;
|
_selectedRow = row;
|
||||||
_selectedColumn = column;
|
_selectedColumn = column;
|
||||||
|
@ -1980,7 +1980,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
[_selectedCell highlight: NO withFrame: rect inView: self];
|
[_selectedCell highlight: NO withFrame: rect inView: self];
|
||||||
case NSListModeMatrix:
|
case NSListModeMatrix:
|
||||||
[self setNeedsDisplayInRect: rect];
|
[self setNeedsDisplayInRect: rect];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
case NSHighlightModeMatrix:
|
case NSHighlightModeMatrix:
|
||||||
case NSTrackModeMatrix:
|
case NSTrackModeMatrix:
|
||||||
break;
|
break;
|
||||||
|
@ -2328,7 +2328,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
|
|
||||||
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
|
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
|
||||||
{
|
{
|
||||||
NSSize oldBoundsSize = bounds.size;
|
NSSize oldBoundsSize = _bounds.size;
|
||||||
NSSize newBoundsSize;
|
NSSize newBoundsSize;
|
||||||
NSSize change;
|
NSSize change;
|
||||||
int nc = numCols;
|
int nc = numCols;
|
||||||
|
@ -2336,7 +2336,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
|
|
||||||
[super resizeWithOldSuperviewSize: oldSize];
|
[super resizeWithOldSuperviewSize: oldSize];
|
||||||
|
|
||||||
newBoundsSize = bounds.size;
|
newBoundsSize = _bounds.size;
|
||||||
|
|
||||||
change.height = newBoundsSize.height - oldBoundsSize.height;
|
change.height = newBoundsSize.height - oldBoundsSize.height;
|
||||||
change.width = newBoundsSize.width - oldBoundsSize.width;
|
change.width = newBoundsSize.width - oldBoundsSize.width;
|
||||||
|
@ -2441,7 +2441,7 @@ static SEL getSel = @selector(objectAtIndex:);
|
||||||
|
|
||||||
- (NSText *) currentEditor
|
- (NSText *) currentEditor
|
||||||
{
|
{
|
||||||
if (_textObject && ([window firstResponder] == _textObject))
|
if (_textObject && ([_window firstResponder] == _textObject))
|
||||||
return _textObject;
|
return _textObject;
|
||||||
else
|
else
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -1412,10 +1412,10 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
done = YES;
|
done = YES;
|
||||||
break;
|
break;
|
||||||
case NSLeftMouseDragged:
|
case NSLeftMouseDragged:
|
||||||
location = [window mouseLocationOutsideOfEventStream];
|
location = [_window mouseLocationOutsideOfEventStream];
|
||||||
if (NSEqualPoints(location, lastLocation) == NO)
|
if (NSEqualPoints(location, lastLocation) == NO)
|
||||||
{
|
{
|
||||||
NSPoint origin = [window frame].origin;
|
NSPoint origin = [_window frame].origin;
|
||||||
|
|
||||||
origin.x += (location.x - lastLocation.x);
|
origin.x += (location.x - lastLocation.x);
|
||||||
origin.y += (location.y - lastLocation.y);
|
origin.y += (location.y - lastLocation.y);
|
||||||
|
@ -1460,8 +1460,8 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
NSImage* closeImage = [NSImage imageNamed: @"common_Close"];
|
NSImage* closeImage = [NSImage imageNamed: @"common_Close"];
|
||||||
NSImage* closeHImage = [NSImage imageNamed: @"common_CloseH"];
|
NSImage* closeHImage = [NSImage imageNamed: @"common_CloseH"];
|
||||||
NSSize imageSize = [closeImage size];
|
NSSize imageSize = [closeImage size];
|
||||||
NSRect rect = { { frame.size.width - imageSize.width - 4,
|
NSRect rect = { { _frame.size.width - imageSize.width - 4,
|
||||||
(frame.size.height - imageSize.height) / 2},
|
(_frame.size.height - imageSize.height) / 2},
|
||||||
{ imageSize.height, imageSize.width } };
|
{ imageSize.height, imageSize.width } };
|
||||||
int mask = NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin;
|
int mask = NSViewMinXMargin | NSViewMinYMargin | NSViewMaxYMargin;
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
|
|
||||||
[aCell highlight: NO withFrame: aRect inView: self];
|
[aCell highlight: NO withFrame: aRect inView: self];
|
||||||
|
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
|
|
||||||
menuv_highlightedItemIndex = -1;
|
menuv_highlightedItemIndex = -1;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
|
|
||||||
[aCell highlight: NO withFrame: aRect inView: self];
|
[aCell highlight: NO withFrame: aRect inView: self];
|
||||||
|
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index != menuv_highlightedItemIndex)
|
if (index != menuv_highlightedItemIndex)
|
||||||
|
@ -206,7 +206,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
|
|
||||||
[aCell highlight: YES withFrame: aRect inView: self];
|
[aCell highlight: YES withFrame: aRect inView: self];
|
||||||
|
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set ivar to new index.
|
// Set ivar to new index.
|
||||||
|
@ -540,8 +540,8 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
|
|
||||||
- (NSRect) innerRect
|
- (NSRect) innerRect
|
||||||
{
|
{
|
||||||
NSRect aRect = {{bounds.origin.x + 1, bounds.origin.y},
|
NSRect aRect = {{_bounds.origin.x + 1, _bounds.origin.y},
|
||||||
{bounds.size.width - 1, bounds.size.height}};
|
{_bounds.size.width - 1, _bounds.size.height}};
|
||||||
|
|
||||||
return aRect;
|
return aRect;
|
||||||
}
|
}
|
||||||
|
@ -554,9 +554,9 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
|
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
theRect.origin.y = bounds.size.height - cellSize.height;
|
theRect.origin.y = _bounds.size.height - cellSize.height;
|
||||||
else
|
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.origin.x = 1;
|
||||||
theRect.size = cellSize;
|
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
|
// simple math. (NOTE: if we get horizontal methods we will have to do
|
||||||
// this. Very much like NSTabView.
|
// this. Very much like NSTabView.
|
||||||
|
|
||||||
return ( point.x < frame.origin.x
|
return ( point.x < _frame.origin.x
|
||||||
|| point.x > frame.size.width + frame.origin.x
|
|| point.x > _frame.size.width + _frame.origin.x
|
||||||
|| point.y <= frame.origin.y
|
|| point.y <= _frame.origin.y
|
||||||
|| point.y > frame.size.height + frame.origin.y) ?
|
|| point.y > _frame.size.height + _frame.origin.y) ?
|
||||||
-1 :
|
-1 :
|
||||||
(frame.size.height - point.y) / cellSize.height;
|
(_frame.size.height - point.y) / cellSize.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setNeedsDisplayForItemAtIndex: (int)index
|
- (void) setNeedsDisplayForItemAtIndex: (int)index
|
||||||
|
@ -623,7 +623,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
|
|
||||||
// Get the frameRect
|
// Get the frameRect
|
||||||
r = [NSMenuWindow frameRectForContentRect: screenRect
|
r = [NSMenuWindow frameRectForContentRect: screenRect
|
||||||
styleMask: [window styleMask]];
|
styleMask: [_window styleMask]];
|
||||||
|
|
||||||
// Update position,if needed, using the preferredEdge;
|
// Update position,if needed, using the preferredEdge;
|
||||||
// It seems we should be calling [self resizeWindowWithMaxHeight:];
|
// It seems we should be calling [self resizeWindowWithMaxHeight:];
|
||||||
|
@ -631,7 +631,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
// Set the window frame
|
// Set the window frame
|
||||||
[window setFrame: r
|
[_window setFrame: r
|
||||||
display: YES];
|
display: YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,8 +650,8 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
DPSgsave(ctxt);
|
DPSgsave(ctxt);
|
||||||
DPSsetlinewidth(ctxt, 1);
|
DPSsetlinewidth(ctxt, 1);
|
||||||
DPSsetgray(ctxt, 0.333);
|
DPSsetgray(ctxt, 0.333);
|
||||||
DPSmoveto(ctxt, bounds.origin.x, bounds.origin.y);
|
DPSmoveto(ctxt, _bounds.origin.x, _bounds.origin.y);
|
||||||
DPSrlineto(ctxt, 0, bounds.size.height);
|
DPSrlineto(ctxt, 0, _bounds.size.height);
|
||||||
DPSstroke(ctxt);
|
DPSstroke(ctxt);
|
||||||
DPSgrestore(ctxt);
|
DPSgrestore(ctxt);
|
||||||
|
|
||||||
|
@ -749,7 +749,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
location = [window mouseLocationOutsideOfEventStream];
|
location = [_window mouseLocationOutsideOfEventStream];
|
||||||
index = [self indexOfItemAtPoint: location];
|
index = [self indexOfItemAtPoint: location];
|
||||||
|
|
||||||
if (index != menuv_highlightedItemIndex)
|
if (index != menuv_highlightedItemIndex)
|
||||||
|
@ -760,11 +760,11 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
{
|
{
|
||||||
if ([menuv_menu isPartlyOffScreen])
|
if ([menuv_menu isPartlyOffScreen])
|
||||||
{
|
{
|
||||||
NSPoint pointerLoc = [window convertBaseToScreen: location];
|
NSPoint pointerLoc = [_window convertBaseToScreen: location];
|
||||||
|
|
||||||
// TODO: Why 1 in the Y axis?
|
// TODO: Why 1 in the Y axis?
|
||||||
if (pointerLoc.x == 0 || pointerLoc.y == 1
|
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];
|
[menuv_menu shiftOnScreen];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -818,7 +818,7 @@ static float GSMenuBarHeight = 25.0; // A wild guess.
|
||||||
{
|
{
|
||||||
NSWindow *w;
|
NSWindow *w;
|
||||||
|
|
||||||
location = [window convertBaseToScreen: location];
|
location = [_window convertBaseToScreen: location];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the mouse is back in the supermenu, we return NO so that
|
* If the mouse is back in the supermenu, we return NO so that
|
||||||
|
|
|
@ -310,14 +310,14 @@ Class _nspopupbuttonCellClass = 0;
|
||||||
object: self];
|
object: self];
|
||||||
|
|
||||||
// Attach the popUp
|
// Attach the popUp
|
||||||
[_cell attachPopUpWithFrame: bounds
|
[_cell attachPopUpWithFrame: _bounds
|
||||||
inView: self];
|
inView: self];
|
||||||
|
|
||||||
// Process events; we start menu events processing by converting
|
// Process events; we start menu events processing by converting
|
||||||
// this event to the menu window, and sending it there.
|
// this event to the menu window, and sending it there.
|
||||||
e = [NSEvent mouseEventWithType: [theEvent type]
|
e = [NSEvent mouseEventWithType: [theEvent type]
|
||||||
location: [[mr window] convertScreenToBase:
|
location: [[mr window] convertScreenToBase:
|
||||||
[window convertBaseToScreen:
|
[_window convertBaseToScreen:
|
||||||
[theEvent locationInWindow]]]
|
[theEvent locationInWindow]]]
|
||||||
modifierFlags: [theEvent modifierFlags]
|
modifierFlags: [theEvent modifierFlags]
|
||||||
timestamp: [theEvent timestamp]
|
timestamp: [theEvent timestamp]
|
||||||
|
|
|
@ -153,18 +153,18 @@
|
||||||
|
|
||||||
// Draw the Bezel
|
// Draw the Bezel
|
||||||
if (isBezeled)
|
if (isBezeled)
|
||||||
NSDrawGrayBezel(bounds,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(bounds) + 2.0,
|
r = NSMakeRect(NSMinX(_bounds) + 2.0,
|
||||||
NSMinY(bounds) + 2.0,
|
NSMinY(_bounds) + 2.0,
|
||||||
NSWidth(bounds) - 4.0,
|
NSWidth(_bounds) - 4.0,
|
||||||
NSHeight(bounds) - 4.0);
|
NSHeight(_bounds) - 4.0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
r = bounds;
|
r = _bounds;
|
||||||
|
|
||||||
if (isIndeterminate) // Draw indeterminate
|
if (isIndeterminate) // Draw indeterminate
|
||||||
{
|
{
|
||||||
|
@ -261,10 +261,10 @@
|
||||||
|
|
||||||
- (void)_update
|
- (void)_update
|
||||||
{
|
{
|
||||||
if (window != nil)
|
if (_window != nil)
|
||||||
if ([window isVisible])
|
if ([_window isVisible])
|
||||||
{
|
{
|
||||||
[window display];
|
[_window display];
|
||||||
[GSCurrentContext() flush];
|
[GSCurrentContext() flush];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,7 +473,7 @@ static Class rulerViewClass = nil;
|
||||||
|
|
||||||
- (void) tile
|
- (void) tile
|
||||||
{
|
{
|
||||||
NSSize contentSize = [isa contentSizeForFrameSize: bounds.size
|
NSSize contentSize = [isa contentSizeForFrameSize: _bounds.size
|
||||||
hasHorizontalScroller: _hasHorizScroller
|
hasHorizontalScroller: _hasHorizScroller
|
||||||
hasVerticalScroller: _hasVertScroller
|
hasVerticalScroller: _hasVertScroller
|
||||||
borderType: _borderType];
|
borderType: _borderType];
|
||||||
|
@ -503,10 +503,10 @@ static Class rulerViewClass = nil;
|
||||||
|
|
||||||
if (_hasVertScroller)
|
if (_hasVertScroller)
|
||||||
{
|
{
|
||||||
vertScrollerRect.origin.x = bounds.origin.x + borderThickness;
|
vertScrollerRect.origin.x = _bounds.origin.x + borderThickness;
|
||||||
vertScrollerRect.origin.y = bounds.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;
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,7 @@ static Class rulerViewClass = nil;
|
||||||
if (_hasHorizScroller)
|
if (_hasHorizScroller)
|
||||||
{
|
{
|
||||||
horizScrollerRect.origin.x = contentRect.origin.x;
|
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.width = contentRect.size.width;
|
||||||
horizScrollerRect.size.height = scrollerWidth;
|
horizScrollerRect.size.height = scrollerWidth;
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ static Class rulerViewClass = nil;
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
float scrollerWidth = [NSScroller scrollerWidth];
|
float scrollerWidth = [NSScroller scrollerWidth];
|
||||||
float horizLinePosition, horizLineLength = bounds.size.width;
|
float horizLinePosition, horizLineLength = _bounds.size.width;
|
||||||
float borderThickness = 0;
|
float borderThickness = 0;
|
||||||
|
|
||||||
DPSgsave(ctxt);
|
DPSgsave(ctxt);
|
||||||
|
@ -573,7 +573,7 @@ static Class rulerViewClass = nil;
|
||||||
horizLinePosition = scrollerWidth + borderThickness;
|
horizLinePosition = scrollerWidth + borderThickness;
|
||||||
horizLineLength -= scrollerWidth + 2 * borderThickness;
|
horizLineLength -= scrollerWidth + 2 * borderThickness;
|
||||||
DPSmoveto(ctxt, horizLinePosition, 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);
|
DPSstroke(ctxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,7 +582,7 @@ static Class rulerViewClass = nil;
|
||||||
float ypos = scrollerWidth + borderThickness + 1;
|
float ypos = scrollerWidth + borderThickness + 1;
|
||||||
|
|
||||||
if (_rFlags.flipped_view)
|
if (_rFlags.flipped_view)
|
||||||
ypos = bounds.size.height - ypos;
|
ypos = _bounds.size.height - ypos;
|
||||||
DPSmoveto(ctxt, horizLinePosition, ypos);
|
DPSmoveto(ctxt, horizLinePosition, ypos);
|
||||||
DPSrlineto(ctxt, horizLineLength - 1, 0);
|
DPSrlineto(ctxt, horizLineLength - 1, 0);
|
||||||
DPSstroke(ctxt);
|
DPSstroke(ctxt);
|
||||||
|
|
|
@ -168,7 +168,7 @@ static Class cellClass;
|
||||||
* that represents an exposed part of this view, it will try to draw the
|
* that represents an exposed part of this view, it will try to draw the
|
||||||
* slider knob positioned in that rectangle ... which is wrong.
|
* 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
|
- (float)_floatValueForMousePoint: (NSPoint)point knobRect: (NSRect)knobRect
|
||||||
|
@ -264,8 +264,8 @@ static Class cellClass;
|
||||||
if (floatValue != oldFloatValue)
|
if (floatValue != oldFloatValue)
|
||||||
{
|
{
|
||||||
[theCell setFloatValue: floatValue];
|
[theCell setFloatValue: floatValue];
|
||||||
[theCell drawWithFrame: 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];
|
||||||
oldFloatValue = floatValue;
|
oldFloatValue = floatValue;
|
||||||
|
@ -297,8 +297,8 @@ static Class cellClass;
|
||||||
if ([theCell isContinuous])
|
if ([theCell isContinuous])
|
||||||
[[theCell target] performSelector: [theCell action]
|
[[theCell target] performSelector: [theCell action]
|
||||||
withObject: self];
|
withObject: self];
|
||||||
[theCell drawWithFrame: bounds inView: self];
|
[theCell drawWithFrame: _bounds inView: self];
|
||||||
[window flushWindow];
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self trackKnob: theEvent knobRect: rect];
|
[self trackKnob: theEvent knobRect: rect];
|
||||||
|
|
|
@ -84,7 +84,7 @@
|
||||||
if (count < 2)
|
if (count < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
[window setAcceptsMouseMovedEvents: YES];
|
[_window setAcceptsMouseMovedEvents: YES];
|
||||||
vis = [self visibleRect];
|
vis = [self visibleRect];
|
||||||
|
|
||||||
/* find out which divider it is */
|
/* find out which divider it is */
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
if (_isVertical == NO)
|
if (_isVertical == NO)
|
||||||
{
|
{
|
||||||
divVertical = _dividerWidth;
|
divVertical = _dividerWidth;
|
||||||
divHorizontal = NSWidth(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;
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
divHorizontal = _dividerWidth;
|
divHorizontal = _dividerWidth;
|
||||||
divVertical = NSHeight(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;
|
||||||
|
@ -296,10 +296,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));
|
||||||
|
|
||||||
[window invalidateCursorRectsForView: self];
|
[_window invalidateCursorRectsForView: self];
|
||||||
|
|
||||||
RETURN_LABEL:
|
RETURN_LABEL:
|
||||||
[window setAcceptsMouseMovedEvents: NO];
|
[_window setAcceptsMouseMovedEvents: NO];
|
||||||
[self setNeedsDisplay: YES];
|
[self setNeedsDisplay: YES];
|
||||||
|
|
||||||
[self display];
|
[self display];
|
||||||
|
@ -316,7 +316,7 @@ RETURN_LABEL:
|
||||||
respondsToSelector:
|
respondsToSelector:
|
||||||
@selector(splitView:resizeSubviewsWithOldSize:)])
|
@selector(splitView:resizeSubviewsWithOldSize:)])
|
||||||
{
|
{
|
||||||
[_delegate splitView: self resizeSubviewsWithOldSize: frame.size];
|
[_delegate splitView: self resizeSubviewsWithOldSize: _frame.size];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* split the area up evenly */
|
{ /* split the area up evenly */
|
||||||
|
@ -336,7 +336,7 @@ RETURN_LABEL:
|
||||||
[subs getObjects: views];
|
[subs getObjects: views];
|
||||||
if (_isVertical == NO)
|
if (_isVertical == NO)
|
||||||
{
|
{
|
||||||
newTotal = NSHeight(bounds) - _dividerWidth*(count - 1);
|
newTotal = NSHeight(_bounds) - _dividerWidth*(count - 1);
|
||||||
oldTotal = 0.0;
|
oldTotal = 0.0;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -355,7 +355,7 @@ RETURN_LABEL:
|
||||||
newHeight = floor(newHeight);
|
newHeight = floor(newHeight);
|
||||||
else
|
else
|
||||||
newHeight = ceil(newHeight);
|
newHeight = ceil(newHeight);
|
||||||
newSize = NSMakeSize(NSWidth(bounds), newHeight);
|
newSize = NSMakeSize(NSWidth(_bounds), newHeight);
|
||||||
running -= newHeight;
|
running -= newHeight;
|
||||||
newPoint = NSMakePoint(0.0, running);
|
newPoint = NSMakePoint(0.0, running);
|
||||||
running -= _dividerWidth;
|
running -= _dividerWidth;
|
||||||
|
@ -365,7 +365,7 @@ RETURN_LABEL:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newTotal = NSWidth(bounds) - _dividerWidth*(count - 1);
|
newTotal = NSWidth(_bounds) - _dividerWidth*(count - 1);
|
||||||
oldTotal = 0.0;
|
oldTotal = 0.0;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -383,7 +383,7 @@ RETURN_LABEL:
|
||||||
newWidth = floor(newWidth);
|
newWidth = floor(newWidth);
|
||||||
else
|
else
|
||||||
newWidth = ceil(newWidth);
|
newWidth = ceil(newWidth);
|
||||||
newSize = NSMakeSize(newWidth, NSHeight(bounds));
|
newSize = NSMakeSize(newWidth, NSHeight(_bounds));
|
||||||
newPoint = NSMakePoint(running, 0.0);
|
newPoint = NSMakePoint(running, 0.0);
|
||||||
running += newWidth + _dividerWidth;
|
running += newWidth + _dividerWidth;
|
||||||
[views[i] setFrameSize: newSize];
|
[views[i] setFrameSize: newSize];
|
||||||
|
@ -540,7 +540,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
||||||
{
|
{
|
||||||
[super resizeWithOldSuperviewSize: oldSize];
|
[super resizeWithOldSuperviewSize: oldSize];
|
||||||
[self adjustSubviews];
|
[self adjustSubviews];
|
||||||
[window invalidateCursorRectsForView: self];
|
[_window invalidateCursorRectsForView: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) delegate
|
- (id) delegate
|
||||||
|
|
|
@ -236,7 +236,7 @@
|
||||||
|
|
||||||
- (NSRect)contentRect
|
- (NSRect)contentRect
|
||||||
{
|
{
|
||||||
NSRect cRect = frame;
|
NSRect cRect = _frame;
|
||||||
|
|
||||||
cRect.origin.x = 0;
|
cRect.origin.x = 0;
|
||||||
cRect.origin.y = 0;
|
cRect.origin.y = 0;
|
||||||
|
@ -268,7 +268,7 @@
|
||||||
NSRect previousRect;
|
NSRect previousRect;
|
||||||
int previousState = 0;
|
int previousState = 0;
|
||||||
|
|
||||||
rect = NSIntersectionRect(bounds, rect);
|
rect = NSIntersectionRect(_bounds, rect);
|
||||||
|
|
||||||
DPSgsave(ctxt);
|
DPSgsave(ctxt);
|
||||||
|
|
||||||
|
@ -542,6 +542,11 @@
|
||||||
DPSgrestore(ctxt);
|
DPSgrestore(ctxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL) isOpaque
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
// Event handling.
|
// Event handling.
|
||||||
|
|
||||||
- (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point
|
- (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point
|
||||||
|
@ -572,7 +577,7 @@
|
||||||
|
|
||||||
// [self setNeedsDisplay:YES];
|
// [self setNeedsDisplay:YES];
|
||||||
|
|
||||||
// [window update];
|
// [_window update];
|
||||||
|
|
||||||
return [super hitTest:aPoint];
|
return [super hitTest:aPoint];
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,9 +119,9 @@
|
||||||
NSAssert(columnIndex > 0, NSInternalInconsistencyException);
|
NSAssert(columnIndex > 0, NSInternalInconsistencyException);
|
||||||
NSAssert(columnIndex < [columns count], NSInternalInconsistencyException);
|
NSAssert(columnIndex < [columns count], NSInternalInconsistencyException);
|
||||||
|
|
||||||
rect.origin.x = bounds.origin.x;
|
rect.origin.x = _bounds.origin.x;
|
||||||
rect.origin.y = bounds.origin.y;
|
rect.origin.y = _bounds.origin.y;
|
||||||
rect.size.height = bounds.size.height;
|
rect.size.height = _bounds.size.height;
|
||||||
|
|
||||||
for (i = 0; i < columnIndex; i++)
|
for (i = 0; i < columnIndex; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -115,13 +115,13 @@
|
||||||
//
|
//
|
||||||
- (void) selectText: (id)sender
|
- (void) selectText: (id)sender
|
||||||
{
|
{
|
||||||
if ([self isSelectable] && (super_view != nil))
|
if ([self isSelectable] && (_super_view != nil))
|
||||||
{
|
{
|
||||||
if (_text_object)
|
if (_text_object)
|
||||||
[_text_object selectAll: self];
|
[_text_object selectAll: self];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSText *t = [window fieldEditor: YES
|
NSText *t = [_window fieldEditor: YES
|
||||||
forObject: self];
|
forObject: self];
|
||||||
|
|
||||||
if ([t superview] != nil)
|
if ([t superview] != nil)
|
||||||
|
@ -130,7 +130,7 @@
|
||||||
|
|
||||||
// [NSCursor hide];
|
// [NSCursor hide];
|
||||||
_text_object = [_cell setUpFieldEditorAttributes: t];
|
_text_object = [_cell setUpFieldEditorAttributes: t];
|
||||||
[_cell selectWithFrame: bounds
|
[_cell selectWithFrame: _bounds
|
||||||
inView: self
|
inView: self
|
||||||
editor: _text_object
|
editor: _text_object
|
||||||
delegate: self
|
delegate: self
|
||||||
|
@ -271,13 +271,13 @@
|
||||||
if (_text_object)
|
if (_text_object)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
t = [window fieldEditor: YES forObject: self];
|
t = [_window fieldEditor: YES forObject: self];
|
||||||
|
|
||||||
if ([t superview] != nil)
|
if ([t superview] != nil)
|
||||||
{
|
{
|
||||||
if ([t resignFirstResponder] == NO)
|
if ([t resignFirstResponder] == NO)
|
||||||
{
|
{
|
||||||
if ([window makeFirstResponder: window] == NO)
|
if ([_window makeFirstResponder: _window] == NO)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@
|
||||||
// [NSCursor hide];
|
// [NSCursor hide];
|
||||||
|
|
||||||
_text_object = [_cell setUpFieldEditorAttributes: t];
|
_text_object = [_cell setUpFieldEditorAttributes: t];
|
||||||
[_cell editWithFrame: bounds
|
[_cell editWithFrame: _bounds
|
||||||
inView: self
|
inView: self
|
||||||
editor: _text_object
|
editor: _text_object
|
||||||
delegate: self
|
delegate: self
|
||||||
|
@ -322,7 +322,7 @@
|
||||||
|
|
||||||
- (NSText *) currentEditor
|
- (NSText *) currentEditor
|
||||||
{
|
{
|
||||||
if (_text_object && ([window firstResponder] == _text_object))
|
if (_text_object && ([_window firstResponder] == _text_object))
|
||||||
return _text_object;
|
return _text_object;
|
||||||
else
|
else
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -383,10 +383,10 @@
|
||||||
[self sendAction: [self action] to: [self target]];
|
[self sendAction: [self action] to: [self target]];
|
||||||
break;
|
break;
|
||||||
case NSTabTextMovement:
|
case NSTabTextMovement:
|
||||||
[window selectKeyViewFollowingView: self];
|
[_window selectKeyViewFollowingView: self];
|
||||||
break;
|
break;
|
||||||
case NSBacktabTextMovement:
|
case NSBacktabTextMovement:
|
||||||
[window selectKeyViewPrecedingView: self];
|
[_window selectKeyViewPrecedingView: self];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue