mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4729 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
79f2fa671d
commit
c6b95314b8
6 changed files with 32 additions and 56 deletions
|
@ -1,6 +1,10 @@
|
||||||
1999-08-20 Michael Hanni <mhanni@sprintmail.com>
|
1999-08-20 Michael Hanni <mhanni@sprintmail.com>
|
||||||
|
|
||||||
* Source/NSSlider.m: added missing [self unlockFocus];.
|
* 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>
|
1999-08-19 Michael Hanni <mhanni@sprintmail.com>
|
||||||
|
|
||||||
|
|
|
@ -792,8 +792,9 @@ static NSString *disabledName = @".GNUstepDisabled";
|
||||||
[item setTag: pos];
|
[item setTag: pos];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[submenu sizeToFit];
|
[submenu update];
|
||||||
[servicesMenu sizeToFit];
|
// [submenu sizeToFit];
|
||||||
|
// [servicesMenu sizeToFit];
|
||||||
[servicesMenu update];
|
[servicesMenu update];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1214,13 +1214,18 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
||||||
break;
|
break;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSLog(@"aString = %@", aString);
|
||||||
|
|
||||||
item = [menu insertItemWithTitle: aString
|
item = [menu insertItemWithTitle: aString
|
||||||
action: @selector(makeKeyAndOrderFront:)
|
action: @selector(makeKeyAndOrderFront:)
|
||||||
keyEquivalent: @""
|
keyEquivalent: @""
|
||||||
atIndex: i];
|
atIndex: i];
|
||||||
[item setTarget: aWindow];
|
[item setTarget: aWindow];
|
||||||
[menu sizeToFit];
|
// [menu sizeToFit];
|
||||||
|
NSLog(@"sizeToFit the windowsMenu.");
|
||||||
[menu update];
|
[menu update];
|
||||||
|
NSLog(@"update the windowsMenu.");
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) removeWindowsItem: (NSWindow*)aWindow
|
- (void) removeWindowsItem: (NSWindow*)aWindow
|
||||||
|
@ -1243,7 +1248,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
||||||
if ([item target] == aWindow)
|
if ([item target] == aWindow)
|
||||||
{
|
{
|
||||||
[menu removeItem: item];
|
[menu removeItem: item];
|
||||||
[menu sizeToFit];
|
// [menu sizeToFit];
|
||||||
[menu update];
|
[menu update];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1300,7 +1305,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
||||||
filename: [win representedFilename] != nil];
|
filename: [win representedFilename] != nil];
|
||||||
[windows removeLastObject];
|
[windows removeLastObject];
|
||||||
}
|
}
|
||||||
[aMenu sizeToFit];
|
// [aMenu sizeToFit];
|
||||||
[aMenu update];
|
[aMenu update];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1362,7 +1367,7 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
[(id)[item controlView] sizeToFit];
|
[(id)[item controlView] sizeToFit];
|
||||||
[menu sizeToFit];
|
// [menu sizeToFit];
|
||||||
[menu update];
|
[menu update];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -537,7 +537,7 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
id cells;
|
id cells;
|
||||||
unsigned i, count;
|
unsigned i, count;
|
||||||
id theApp = [NSApplication sharedApplication];
|
id theApp = [NSApplication sharedApplication];
|
||||||
|
|
||||||
if (menu_changed)
|
if (menu_changed)
|
||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
if (shouldBeEnabled != wasEnabled)
|
if (shouldBeEnabled != wasEnabled)
|
||||||
{
|
{
|
||||||
[cell setEnabled: shouldBeEnabled];
|
[cell setEnabled: shouldBeEnabled];
|
||||||
[[self window] flushWindow];
|
[[self window] display];
|
||||||
// [menu_view setNeedsDisplay:YES];
|
// [menu_view setNeedsDisplay:YES];
|
||||||
// [menu_view setNeedsDisplayInRect:[menu_view rectOfItemAtIndex:i]];
|
// [menu_view setNeedsDisplayInRect:[menu_view rectOfItemAtIndex:i]];
|
||||||
// FIXME
|
// FIXME
|
||||||
|
@ -607,9 +607,6 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menu_changed)
|
|
||||||
[self sizeToFit];
|
|
||||||
|
|
||||||
/* Reenable displaying of menus */
|
/* Reenable displaying of menus */
|
||||||
[self setMenuChangedMessagesEnabled: YES];
|
[self setMenuChangedMessagesEnabled: YES];
|
||||||
}
|
}
|
||||||
|
@ -716,41 +713,11 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
|
|
||||||
if (!menu_is_beholdenToPopUpButton)
|
if (!menu_is_beholdenToPopUpButton)
|
||||||
{
|
{
|
||||||
[titleView setFrameOrigin: NSMakePoint(0, mFrame.size.height)];
|
size.height += 21;
|
||||||
[titleView setFrameSize: NSMakeSize (mFrame.size.width,21)];
|
|
||||||
size.height = mFrame.size.height+21;
|
|
||||||
[aWindow setContentSize: size];
|
[aWindow setContentSize: size];
|
||||||
[bWindow setContentSize: size];
|
[bWindow setContentSize: size];
|
||||||
|
[menu_view setFrameOrigin: NSMakePoint(0, 0)];
|
||||||
/*
|
[titleView setFrame: NSMakeRect(0,size.height-21,size.width,21)];
|
||||||
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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -758,8 +725,10 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations";
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME, popup sets itself up.
|
// FIXME, popup sets itself up.
|
||||||
|
// [menu_view setNeedsDisplay:YES];
|
||||||
[menu_view setNeedsDisplay:YES];
|
|
||||||
|
[aWindow display];
|
||||||
|
|
||||||
menu_changed = NO;
|
menu_changed = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,10 +306,11 @@ static float GSMenuBarHeight = 25.0; // a guess.
|
||||||
if (![menuv_menu _isBeholdenToPopUpButton])
|
if (![menuv_menu _isBeholdenToPopUpButton])
|
||||||
cellSize.width = 7 + neededWidth + 7 + 7 + 5;
|
cellSize.width = 7 + neededWidth + 7 + 7 + 5;
|
||||||
|
|
||||||
if ([window contentView] == self)
|
// if ([window contentView] == self)
|
||||||
[window setContentSize: NSMakeSize(cellSize.width,howHigh)];
|
// [window setContentSize: NSMakeSize(cellSize.width,howHigh)];
|
||||||
else
|
// else
|
||||||
[self setFrame: NSMakeRect(0,0,cellSize.width,howHigh)];
|
// [self setFrame: NSMakeRect(0,0,cellSize.width,howHigh)];
|
||||||
|
[self setFrameSize: NSMakeSize(cellSize.width,howHigh)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)sizeToFitForPopUpButton
|
- (void)sizeToFitForPopUpButton
|
||||||
|
|
|
@ -1215,8 +1215,6 @@ currentCursorY=[self rectForCharacterIndex:NSMaxRange([self selectedRange])].ori
|
||||||
unsigned startIndex;
|
unsigned startIndex;
|
||||||
BOOL didDragging=NO;
|
BOOL didDragging=NO;
|
||||||
|
|
||||||
NSLog(@"mouseDown:");
|
|
||||||
|
|
||||||
if (!is_selectable) return; // If not selectable then don't recognize the mouse down
|
if (!is_selectable) return; // If not selectable then don't recognize the mouse down
|
||||||
|
|
||||||
[[self window] makeFirstResponder:self];
|
[[self window] makeFirstResponder:self];
|
||||||
|
@ -2056,13 +2054,13 @@ NSLog(@"opti hook 2");
|
||||||
//FIXME return MakeRangeFromAbs(startLine,endLine+1);
|
//FIXME return MakeRangeFromAbs(startLine,endLine+1);
|
||||||
if ([plainContent length] != 0) {
|
if ([plainContent length] != 0) {
|
||||||
myTest = MakeRangeFromAbs(startLine,endLine+1);
|
myTest = MakeRangeFromAbs(startLine,endLine+1);
|
||||||
NSLog(@"myTest: length = %d, location = %d\n",
|
NSDebugLog(@"myTest: length = %d, location = %d\n",
|
||||||
(int)myTest.length,
|
(int)myTest.length,
|
||||||
(int)myTest.location);
|
(int)myTest.location);
|
||||||
return myTest;
|
return myTest;
|
||||||
} else {
|
} else {
|
||||||
myTest = MakeRangeFromAbs(startLine,endLine);
|
myTest = MakeRangeFromAbs(startLine,endLine);
|
||||||
NSLog(@"myTest: length = %d, location = %d\n",
|
NSDebugLog(@"myTest: length = %d, location = %d\n",
|
||||||
(int)myTest.length,
|
(int)myTest.length,
|
||||||
(int)myTest.location);
|
(int)myTest.location);
|
||||||
return myTest;
|
return myTest;
|
||||||
|
@ -2078,8 +2076,6 @@ NSLog(@"opti hook 2");
|
||||||
|
|
||||||
redrawLineRange=[self lineRangeForRect:rect];
|
redrawLineRange=[self lineRangeForRect:rect];
|
||||||
|
|
||||||
NSLog(@"should be drawing text here. No big deal.\n");
|
|
||||||
|
|
||||||
if([self drawsBackground]) // clear area under text
|
if([self drawsBackground]) // clear area under text
|
||||||
{ [[self backgroundColor] set]; NSRectFill(rect);
|
{ [[self backgroundColor] set]; NSRectFill(rect);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue