mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 10:11:56 +00:00
Patch for initial first responder stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4965 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c4dc4c3fa6
commit
b3d034d497
5 changed files with 55 additions and 3 deletions
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
||||||
|
Mon Oct 4 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
Implementation of 'initial first responder' stuff for NSWindow:
|
||||||
|
* Headers/AppKit/NSWindow.h: New instance variable
|
||||||
|
_initial_first_responder
|
||||||
|
* Source/NSWindow.m: ([-dealloc]), ([-initDefaults]),
|
||||||
|
([-encodeWithCoder:]), ([-decodeWithCoder:]): updated to take
|
||||||
|
account for the new ivar _initial_first_responder.
|
||||||
|
* Model/GMAppKit.m ([NSWindow -encodeWithModelArchiver:]): Added
|
||||||
|
initialFirstResponder
|
||||||
|
([NSWindow -initWithModelUnarchiver:]): idem
|
||||||
|
([NSPanel -encodeWithModelArchiver:]): idem
|
||||||
|
([NSPanel -initWithModelUnarchiver:]): idem
|
||||||
|
([NSSavePanel -encodeWithModelArchiver:]): idem
|
||||||
|
([NSSavePanel -initWithModelUnarchiver:]): idem
|
||||||
|
* Source/NSWindow.m ([-setInitialFirstResponder:]): implemented method.
|
||||||
|
([-initialFirstResponder]): implemented method.
|
||||||
|
* Source/NSWindow.m ([-display]): If there is no first_responder,
|
||||||
|
set it to _initial_first_responder (if non-nil).
|
||||||
|
|
||||||
|
Minor fixes:
|
||||||
|
* Source/GNUmakefile: Added missing AppKit/AppKitExceptions.h
|
||||||
|
* Source/NSOpenPanel.m ([+openPanel]): Set defaults after creating.
|
||||||
|
|
||||||
Tue Sep 28 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
Tue Sep 28 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
* Source/NSBrowser.m Fixed bug: ([-mouseDown:]): New method with a
|
* Source/NSBrowser.m Fixed bug: ([-mouseDown:]): New method with a
|
||||||
|
|
|
@ -95,6 +95,7 @@ extern NSSize NSTokenSize;
|
||||||
id content_view;
|
id content_view;
|
||||||
id first_responder;
|
id first_responder;
|
||||||
id original_responder;
|
id original_responder;
|
||||||
|
NSView *_initial_first_responder;
|
||||||
id delegate;
|
id delegate;
|
||||||
id _fieldEditor;
|
id _fieldEditor;
|
||||||
id _lastDragView;
|
id _lastDragView;
|
||||||
|
|
|
@ -255,7 +255,8 @@ AppKit/PSOperators.h \
|
||||||
AppKit/GSHelpManagerPanel.h \
|
AppKit/GSHelpManagerPanel.h \
|
||||||
AppKit/GSPasteboardServer.h \
|
AppKit/GSPasteboardServer.h \
|
||||||
AppKit/GSServicesManager.h \
|
AppKit/GSServicesManager.h \
|
||||||
AppKit/GSWraps.h
|
AppKit/GSWraps.h \
|
||||||
|
AppKit/AppKitExceptions.h
|
||||||
|
|
||||||
-include GNUmakefile.preamble
|
-include GNUmakefile.preamble
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,8 @@ static NSOpenPanel *gnustep_gui_open_panel = nil;
|
||||||
|
|
||||||
//if( ![GMModel loadIMFile:@"SavePanel" owner:NSApp] )
|
//if( ![GMModel loadIMFile:@"SavePanel" owner:NSApp] )
|
||||||
[[NSOpenPanel alloc] _initWithoutGModel];
|
[[NSOpenPanel alloc] _initWithoutGModel];
|
||||||
|
|
||||||
|
[gnustep_gui_open_panel _setDefaults];
|
||||||
[gnustep_gui_open_panel setTitle:@"Open"];
|
[gnustep_gui_open_panel setTitle:@"Open"];
|
||||||
|
|
||||||
// [GMUnarchiver decodeClassName:@"NSSavePanel"
|
// [GMUnarchiver decodeClassName:@"NSSavePanel"
|
||||||
|
|
|
@ -124,6 +124,7 @@ static SEL ctSel = @selector(_checkTrackingRectangles:forEvent:);
|
||||||
static IMP ccImp;
|
static IMP ccImp;
|
||||||
static IMP ctImp;
|
static IMP ctImp;
|
||||||
static Class responderClass;
|
static Class responderClass;
|
||||||
|
static Class viewClass;
|
||||||
static NSMutableSet *autosaveNames;
|
static NSMutableSet *autosaveNames;
|
||||||
static NSRecursiveLock *windowsLock;
|
static NSRecursiveLock *windowsLock;
|
||||||
|
|
||||||
|
@ -139,6 +140,7 @@ static NSRecursiveLock *windowsLock;
|
||||||
ccImp = [self instanceMethodForSelector: ccSel];
|
ccImp = [self instanceMethodForSelector: ccSel];
|
||||||
ctImp = [self instanceMethodForSelector: ctSel];
|
ctImp = [self instanceMethodForSelector: ctSel];
|
||||||
responderClass = [NSResponder class];
|
responderClass = [NSResponder class];
|
||||||
|
viewClass = [NSView class];
|
||||||
autosaveNames = [NSMutableSet new];
|
autosaveNames = [NSMutableSet new];
|
||||||
windowsLock = [NSRecursiveLock new];
|
windowsLock = [NSRecursiveLock new];
|
||||||
}
|
}
|
||||||
|
@ -214,7 +216,8 @@ static NSRecursiveLock *windowsLock;
|
||||||
TEST_RELEASE(miniaturized_image);
|
TEST_RELEASE(miniaturized_image);
|
||||||
TEST_RELEASE(window_title);
|
TEST_RELEASE(window_title);
|
||||||
TEST_RELEASE(rectsBeingDrawn);
|
TEST_RELEASE(rectsBeingDrawn);
|
||||||
|
TEST_RELEASE(_initial_first_responder);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME This should not be necessary - the views should have removed
|
* FIXME This should not be necessary - the views should have removed
|
||||||
* their drag types, so we should already have been removed.
|
* their drag types, so we should already have been removed.
|
||||||
|
@ -808,6 +811,9 @@ static NSRecursiveLock *windowsLock;
|
||||||
- (void) display
|
- (void) display
|
||||||
{
|
{
|
||||||
needs_display = NO;
|
needs_display = NO;
|
||||||
|
if (!first_responder)
|
||||||
|
if (_initial_first_responder)
|
||||||
|
[self makeFirstResponder: _initial_first_responder];
|
||||||
/*
|
/*
|
||||||
* inform first responder of it's status so it can set the focus to itself
|
* inform first responder of it's status so it can set the focus to itself
|
||||||
*/
|
*/
|
||||||
|
@ -1220,6 +1226,22 @@ static NSRecursiveLock *windowsLock;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) setInitialFirstResponder: (NSView *)aView
|
||||||
|
{
|
||||||
|
if ([aView isKindOfClass: viewClass])
|
||||||
|
{
|
||||||
|
if (_initial_first_responder)
|
||||||
|
[_initial_first_responder autorelease];
|
||||||
|
_initial_first_responder = [aView retain];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSView *) initialFirstResponder
|
||||||
|
{
|
||||||
|
return _initial_first_responder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Return mouse location in reciever's base coord system, ignores event
|
/* Return mouse location in reciever's base coord system, ignores event
|
||||||
* loop status */
|
* loop status */
|
||||||
- (NSPoint) mouseLocationOutsideOfEventStream
|
- (NSPoint) mouseLocationOutsideOfEventStream
|
||||||
|
@ -2100,6 +2122,7 @@ static NSRecursiveLock *windowsLock;
|
||||||
[aCoder encodeSize: minimum_size];
|
[aCoder encodeSize: minimum_size];
|
||||||
[aCoder encodeSize: maximum_size];
|
[aCoder encodeSize: maximum_size];
|
||||||
[aCoder encodeObject: miniaturized_image];
|
[aCoder encodeObject: miniaturized_image];
|
||||||
|
[aCoder encodeConditionalObject: _initial_first_responder];
|
||||||
[aCoder encodeValueOfObjCType: @encode(NSBackingStoreType) at: &backing_type];
|
[aCoder encodeValueOfObjCType: @encode(NSBackingStoreType) at: &backing_type];
|
||||||
[aCoder encodeValueOfObjCType: @encode(int) at: &window_level];
|
[aCoder encodeValueOfObjCType: @encode(int) at: &window_level];
|
||||||
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &disable_flush_window];
|
[aCoder encodeValueOfObjCType: @encode(unsigned) at: &disable_flush_window];
|
||||||
|
@ -2141,6 +2164,7 @@ static NSRecursiveLock *windowsLock;
|
||||||
minimum_size = [aDecoder decodeSize];
|
minimum_size = [aDecoder decodeSize];
|
||||||
maximum_size = [aDecoder decodeSize];
|
maximum_size = [aDecoder decodeSize];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &miniaturized_image];
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &miniaturized_image];
|
||||||
|
[aDecoder decodeValueOfObjCType: @encode(id) at: &_initial_first_responder];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(NSBackingStoreType)
|
[aDecoder decodeValueOfObjCType: @encode(NSBackingStoreType)
|
||||||
at: &backing_type];
|
at: &backing_type];
|
||||||
[aDecoder decodeValueOfObjCType: @encode(int) at: &window_level];
|
[aDecoder decodeValueOfObjCType: @encode(int) at: &window_level];
|
||||||
|
@ -2205,6 +2229,7 @@ static NSRecursiveLock *windowsLock;
|
||||||
{
|
{
|
||||||
first_responder = nil;
|
first_responder = nil;
|
||||||
original_responder = nil;
|
original_responder = nil;
|
||||||
|
_initial_first_responder = nil;
|
||||||
delegate = nil;
|
delegate = nil;
|
||||||
window_num = 0;
|
window_num = 0;
|
||||||
gstate = 0;
|
gstate = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue