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 Frith-MacDonald 1999-09-01 08:35:16 +00:00
parent 33c1be1a1f
commit 738bb09559
15 changed files with 87 additions and 73 deletions

View file

@ -373,7 +373,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
- (NSRect)innerRect
{
return [self bounds];
return bounds;
// this could change if we drew menuitemcells as
// 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];
if (index == 0)
theRect.origin.y = [self frame].size.height - cellSize.height;
theRect.origin.y = frame.size.height - cellSize.height;
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.size = cellSize;
@ -406,7 +406,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
NSRect aRect = [self rectOfItemAtIndex: 0];
// 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
@ -445,7 +445,7 @@ static float GSMenuBarHeight = 25.0; // a guess.
- (void)drawRect: (NSRect)rect
{
int i;
NSRect aRect = [self frame];
NSRect aRect = frame;
int howMany = [menuv_items_link count];
// 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
{
NSPoint lastLocation = [event locationInWindow];
float height = [self frame].size.height;
float height = frame.size.height;
int index;
int lastIndex = 0;
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
// stream.
lastLocation = [[self window] mouseLocationOutsideOfEventStream];
lastLocation = [window mouseLocationOutsideOfEventStream];
index = (height - lastLocation.y) / cellSize.height;
@ -521,21 +521,21 @@ static float GSMenuBarHeight = 25.0; // a guess.
break;
case NSRightMouseDragged:
case NSLeftMouseDragged:
lastLocation = [[self window] mouseLocationOutsideOfEventStream];
lastLocation = [window mouseLocationOutsideOfEventStream];
lastLocation = [self convertPoint: lastLocation fromView: nil];
#if 0
NSLog (@"location = (%f, %f, %f)", lastLocation.x, [[self window]
frame].origin.x, [[self window] frame].size.width);
NSLog (@"location = %f (%f, %f)", lastLocation.y, [[self window]
frame].origin.y, [[self window] frame].size.height);
NSLog (@"location = (%f, %f, %f)", lastLocation.x, [window
frame].origin.x, [window frame].size.width);
NSLog (@"location = %f (%f, %f)", lastLocation.y, [window
frame].origin.y, [window frame].size.height);
#endif
/* If the location of the mouse is inside the window on the
x-axis. */
if (lastLocation.x > 0
&& lastLocation.x < [[self window] frame].size.width)
&& lastLocation.x < [window frame].size.width)
{
/* 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
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)
{
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
submenu. */
else if (lastLocation.x > [[self window] frame].size.width)
else if (lastLocation.x > [window frame].size.width)
{
NSRect aRect = [self rectOfItemAtIndex: lastIndex];
if (lastLocation.y > aRect.origin.y
@ -768,7 +768,7 @@ cell do the following */
else if (weRightMenu)
{
NSPoint cP = [[self window] convertBaseToScreen: lastLocation];
NSPoint cP = [window convertBaseToScreen: lastLocation];
[self setHighlightedItemIndex: -1];
@ -779,7 +779,7 @@ cell do the following */
location: cP
modifierFlags: [event modifierFlags]
timestamp: [event timestamp]
windowNumber: [[self window] windowNumber]
windowNumber: [window windowNumber]
context: [event context]
eventNumber: [event eventNumber]
clickCount: [event clickCount]
@ -802,7 +802,7 @@ cell do the following */
else if (weLeftMenu)
{ /* The weLeftMenu case */
NSPoint cP = [[self window] convertBaseToScreen: lastLocation];
NSPoint cP = [window convertBaseToScreen: lastLocation];
selectedCell = [menuv_items_link objectAtIndex: lastIndex];
if ([selectedCell hasSubmenu])
@ -812,7 +812,7 @@ cell do the following */
location: cP
modifierFlags: [event modifierFlags]
timestamp: [event timestamp]
windowNumber: [[self window] windowNumber]
windowNumber: [window windowNumber]
context: [event context]
eventNumber: [event eventNumber]
clickCount: [event clickCount]