git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4729 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Michael Silva 1999-08-20 20:55:23 +00:00
parent 9ecfd23ff9
commit c2bfbe3350
6 changed files with 32 additions and 56 deletions

View file

@ -1,6 +1,10 @@
1999-08-20 Michael Hanni <mhanni@sprintmail.com>
* Source/NSSlider.m: added missing [self unlockFocus];.
* Source/NSMenu.m: fixes to sizeToFit and update. This allows you
to keep the windows and services menus tornoff and when you rerun
the program these menus will look correct.
* Source/NSMenuView.m: ditto.
1999-08-19 Michael Hanni <mhanni@sprintmail.com>

View file

@ -792,8 +792,9 @@ static NSString *disabledName = @".GNUstepDisabled";
[item setTag: pos];
}
}
[submenu sizeToFit];
[servicesMenu sizeToFit];
[submenu update];
// [submenu sizeToFit];
// [servicesMenu sizeToFit];
[servicesMenu update];
}
}

View file

@ -1214,13 +1214,18 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
break;
i++;
}
NSLog(@"aString = %@", aString);
item = [menu insertItemWithTitle: aString
action: @selector(makeKeyAndOrderFront:)
keyEquivalent: @""
atIndex: i];
[item setTarget: aWindow];
[menu sizeToFit];
// [menu sizeToFit];
NSLog(@"sizeToFit the windowsMenu.");
[menu update];
NSLog(@"update the windowsMenu.");
}
- (void) removeWindowsItem: (NSWindow*)aWindow
@ -1243,7 +1248,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
if ([item target] == aWindow)
{
[menu removeItem: item];
[menu sizeToFit];
// [menu sizeToFit];
[menu update];
break;
}
@ -1300,7 +1305,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
filename: [win representedFilename] != nil];
[windows removeLastObject];
}
[aMenu sizeToFit];
// [aMenu sizeToFit];
[aMenu update];
}
}
@ -1362,7 +1367,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
if (changed)
{
[(id)[item controlView] sizeToFit];
[menu sizeToFit];
// [menu sizeToFit];
[menu update];
}
break;

View file

@ -537,7 +537,7 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
id cells;
unsigned i, count;
id theApp = [NSApplication sharedApplication];
if (menu_changed)
[self sizeToFit];
@ -599,7 +599,7 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
if (shouldBeEnabled != wasEnabled)
{
[cell setEnabled: shouldBeEnabled];
[[self window] flushWindow];
[[self window] display];
// [menu_view setNeedsDisplay:YES];
// [menu_view setNeedsDisplayInRect:[menu_view rectOfItemAtIndex:i]];
// FIXME
@ -607,9 +607,6 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
}
}
if (menu_changed)
[self sizeToFit];
/* Reenable displaying of menus */
[self setMenuChangedMessagesEnabled: YES];
}
@ -716,41 +713,11 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
if (!menu_is_beholdenToPopUpButton)
{
[titleView setFrameOrigin: NSMakePoint(0, mFrame.size.height)];
[titleView setFrameSize: NSMakeSize (mFrame.size.width,21)];
size.height = mFrame.size.height+21;
size.height += 21;
[aWindow setContentSize: size];
[bWindow setContentSize: size];
/*
if (menu_supermenu)
{
frame.origin = [supermenu locationForSubmenu: self];
}
else
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSDictionary* menuLocations = [defaults
objectForKey: NSMenuLocationsKey];
NSString* key;
NSArray* array;
if ([[NSApplication sharedApplication] mainMenu] == self)
key = @"Main menu";
else
key = [self title];
if (key)
{
array = [menuLocations objectForKey: key];
if (array && [array isKindOfClass: [NSArray class]])
{
frame.origin.x = [[array objectAtIndex: 0] floatValue];
frame.origin.y = [[array objectAtIndex: 1] floatValue];
}
}
}
*/
[menu_view setFrameOrigin: NSMakePoint(0, 0)];
[titleView setFrame: NSMakeRect(0,size.height-21,size.width,21)];
}
else
{
@ -758,8 +725,10 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
}
// FIXME, popup sets itself up.
[menu_view setNeedsDisplay:YES];
// [menu_view setNeedsDisplay:YES];
[aWindow display];
menu_changed = NO;
}

View file

@ -306,10 +306,11 @@ static float GSMenuBarHeight = 25.0; // a guess.
if (![menuv_menu _isBeholdenToPopUpButton])
cellSize.width = 7 + neededWidth + 7 + 7 + 5;
if ([window contentView] == self)
[window setContentSize: NSMakeSize(cellSize.width,howHigh)];
else
[self setFrame: NSMakeRect(0,0,cellSize.width,howHigh)];
// if ([window contentView] == self)
// [window setContentSize: NSMakeSize(cellSize.width,howHigh)];
// else
// [self setFrame: NSMakeRect(0,0,cellSize.width,howHigh)];
[self setFrameSize: NSMakeSize(cellSize.width,howHigh)];
}
- (void)sizeToFitForPopUpButton

View file

@ -1215,8 +1215,6 @@ currentCursorY=[self rectForCharacterIndex:NSMaxRange([self selectedRange])].ori
unsigned startIndex;
BOOL didDragging=NO;
NSLog(@"mouseDown:");
if (!is_selectable) return; // If not selectable then don't recognize the mouse down
[[self window] makeFirstResponder:self];
@ -2056,13 +2054,13 @@ NSLog(@"opti hook 2");
//FIXME return MakeRangeFromAbs(startLine,endLine+1);
if ([plainContent length] != 0) {
myTest = MakeRangeFromAbs(startLine,endLine+1);
NSLog(@"myTest: length = %d, location = %d\n",
NSDebugLog(@"myTest: length = %d, location = %d\n",
(int)myTest.length,
(int)myTest.location);
return myTest;
} else {
myTest = MakeRangeFromAbs(startLine,endLine);
NSLog(@"myTest: length = %d, location = %d\n",
NSDebugLog(@"myTest: length = %d, location = %d\n",
(int)myTest.length,
(int)myTest.location);
return myTest;
@ -2078,8 +2076,6 @@ NSLog(@"opti hook 2");
redrawLineRange=[self lineRangeForRect:rect];
NSLog(@"should be drawing text here. No big deal.\n");
if([self drawsBackground]) // clear area under text
{ [[self backgroundColor] set]; NSRectFill(rect);
}