mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 07:20:58 +00:00
Reinstate changes to NSWindow.m to keep it working.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3480 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ed8cb51bc9
commit
582f5f44ad
2 changed files with 671 additions and 658 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Dec 17 13:20:00 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
* NSWindow.m: Reinstated changes lost in last update (to fix
|
||||||
|
recursion problem on menu creation) and added acceptsFirstResponder.
|
||||||
|
|
||||||
Wed Dec 16 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
Wed Dec 16 1998 Felipe A. Rodriguez <far@ix.netcom.com>
|
||||||
|
|
||||||
* NSWindow.m acceptsFirstResponder implement.
|
* NSWindow.m acceptsFirstResponder implement.
|
||||||
|
|
|
@ -192,9 +192,9 @@ NSRect cframe;
|
||||||
cframe.origin = NSZeroPoint; // Create the content view
|
cframe.origin = NSZeroPoint; // Create the content view
|
||||||
cframe.size = frame.size;
|
cframe.size = frame.size;
|
||||||
[self setContentView:[[[NSView alloc] initWithFrame:cframe] autorelease]];
|
[self setContentView:[[[NSView alloc] initWithFrame:cframe] autorelease]];
|
||||||
// Register ourselves with
|
|
||||||
// the Application object
|
|
||||||
[theApp addWindowsItem:self title:window_title filename:NO];
|
[theApp addWindowsItem: self title: nil filename: NO];
|
||||||
|
|
||||||
_flushRectangles = [[NSMutableArray alloc] initWithCapacity:10];
|
_flushRectangles = [[NSMutableArray alloc] initWithCapacity:10];
|
||||||
|
|
||||||
|
@ -252,7 +252,11 @@ NSView *wv;
|
||||||
ASSIGN(represented_filename, aString);
|
ASSIGN(represented_filename, aString);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setTitle:(NSString *)aString { ASSIGN(window_title,aString); }
|
- (void) setTitle: (NSString*)aString
|
||||||
|
{
|
||||||
|
ASSIGN(window_title, aString);
|
||||||
|
[self setMiniwindowTitle: aString];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) setTitleWithRepresentedFilename: (NSString*)aString
|
- (void) setTitleWithRepresentedFilename: (NSString*)aString
|
||||||
{
|
{
|
||||||
|
@ -291,7 +295,7 @@ NSView *wv;
|
||||||
ASSIGN(miniaturized_image, image);
|
ASSIGN(miniaturized_image, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setMiniwindowTitle:(NSString *)title;
|
- (void) setMiniwindowTitle: (NSString*)title
|
||||||
{
|
{
|
||||||
BOOL isDoc = NO;
|
BOOL isDoc = NO;
|
||||||
|
|
||||||
|
@ -300,7 +304,6 @@ BOOL isDoc = NO;
|
||||||
title = window_title;
|
title = window_title;
|
||||||
if ([title isEqual: represented_filename])
|
if ([title isEqual: represented_filename])
|
||||||
isDoc = YES;
|
isDoc = YES;
|
||||||
|
|
||||||
[[NSApplication sharedApplication] changeWindowsItem: self
|
[[NSApplication sharedApplication] changeWindowsItem: self
|
||||||
title: title
|
title: title
|
||||||
filename: isDoc];
|
filename: isDoc];
|
||||||
|
@ -503,7 +506,6 @@ NSPoint basePoint;
|
||||||
visible = YES;
|
visible = YES;
|
||||||
needs_display = NO; // inform first responder
|
needs_display = NO; // inform first responder
|
||||||
// of it's status so it can
|
// of it's status so it can
|
||||||
if(first_responder)
|
|
||||||
[first_responder becomeFirstResponder]; // set the focus to itself
|
[first_responder becomeFirstResponder]; // set the focus to itself
|
||||||
|
|
||||||
[self disableFlushWindow]; // tmp disable display
|
[self disableFlushWindow]; // tmp disable display
|
||||||
|
@ -627,21 +629,22 @@ NSView *v;
|
||||||
{
|
{
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
NSApplication *theApp = [NSApplication sharedApplication];
|
NSApplication *theApp = [NSApplication sharedApplication];
|
||||||
// Notify delegate
|
|
||||||
|
/*
|
||||||
|
* If 'is_released_when_closed' then the window will be removed from the
|
||||||
|
* applications list of windows (causing it to be released) - so we must
|
||||||
|
* bracket any work we do in a retain/release sequence.
|
||||||
|
*/
|
||||||
|
if (is_released_when_closed)
|
||||||
|
[self retain];
|
||||||
|
|
||||||
[nc postNotificationName: NSWindowWillCloseNotification object: self];
|
[nc postNotificationName: NSWindowWillCloseNotification object: self];
|
||||||
|
[theApp removeWindowsItem: self];
|
||||||
[self orderOut: self];
|
[self orderOut: self];
|
||||||
visible = NO;
|
visible = NO;
|
||||||
// if app has no
|
|
||||||
if(![theApp mainMenu]) // menu terminate
|
if (is_released_when_closed)
|
||||||
[theApp terminate:self];
|
[self release];
|
||||||
else
|
|
||||||
{ // else if should
|
|
||||||
if (is_released_when_closed) // release do so
|
|
||||||
{ // default is YES
|
|
||||||
[theApp removeWindowsItem: self]; // for windows and
|
|
||||||
[self autorelease]; // NO for panels
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)deminiaturize:sender
|
- (void)deminiaturize:sender
|
||||||
|
@ -721,15 +724,15 @@ NSApplication *theApp = [NSApplication sharedApplication];
|
||||||
[theApp discardEventsMatchingMask:mask beforeEvent:lastEvent];
|
[theApp discardEventsMatchingMask:mask beforeEvent:lastEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSResponder *)firstResponder { return first_responder; }
|
- (NSResponder*) firstResponder
|
||||||
- (BOOL)acceptsFirstResponder { return YES; }
|
{
|
||||||
|
return first_responder;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)keyDown:(NSEvent *)theEvent // save the first responder
|
- (BOOL) acceptsFirstResponder
|
||||||
{ // so that the key up goes
|
{
|
||||||
original_responder = first_responder; // to it and not a possible
|
return YES;
|
||||||
// new first responder
|
}
|
||||||
[first_responder keyDown:theEvent]; // Send the first responder
|
|
||||||
} // the key down
|
|
||||||
|
|
||||||
- (BOOL) makeFirstResponder: (NSResponder*)aResponder
|
- (BOOL) makeFirstResponder: (NSResponder*)aResponder
|
||||||
{
|
{
|
||||||
|
@ -972,8 +975,13 @@ NSView *v;
|
||||||
case NSMouseExited: // Mouse exited
|
case NSMouseExited: // Mouse exited
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSKeyDown: // Key down
|
case NSKeyDown:
|
||||||
[self keyDown:theEvent];
|
/*
|
||||||
|
* Save the first responder so that the key up goes to it and not a
|
||||||
|
* possible new first responder.
|
||||||
|
*/
|
||||||
|
original_responder = first_responder;
|
||||||
|
[first_responder keyDown: theEvent];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSKeyUp: // Key up
|
case NSKeyUp: // Key up
|
||||||
|
@ -1362,7 +1370,7 @@ id result = nil;
|
||||||
is_key = NO;
|
is_key = NO;
|
||||||
is_main = NO;
|
is_main = NO;
|
||||||
is_edited = NO;
|
is_edited = NO;
|
||||||
is_released_when_closed = NO;
|
is_released_when_closed = YES;
|
||||||
is_miniaturized = NO;
|
is_miniaturized = NO;
|
||||||
disable_flush_window = NO;
|
disable_flush_window = NO;
|
||||||
menu_exclude = NO;
|
menu_exclude = NO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue