Add help key support

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23749 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-10-04 05:26:47 +00:00
parent 8a49acfb4c
commit ebbab146de
3 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2006-10-04 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSWindow.m: Add help key support for context help.
2006-10-02 20:41-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Resources/Esperanto.lproj/Localizable.strings

View file

@ -287,6 +287,7 @@ static NSCursor *helpCursor = nil;
+ (void) setContextHelpModeActive: (BOOL) flag
{
NSLog(@"setContextHelpModeActive: %d", flag);
if (flag != _gnu_contextHelpActive)
{
_gnu_contextHelpActive = flag;

View file

@ -2807,6 +2807,12 @@ resetCursorRectsForView(NSView *theView)
character = [characters characterAtIndex: 0];
}
if (character == NSHelpFunctionKey)
{
[NSHelpManager setContextHelpModeActive: YES];
return;
}
// If this is a TAB or TAB+SHIFT event, move to the next key view
if (character == NSTabCharacter)
{
@ -2866,6 +2872,27 @@ resetCursorRectsForView(NSView *theView)
[super keyDown: theEvent];
}
- (void) keyUp: (NSEvent*)theEvent
{
if ([NSHelpManager isContextHelpModeActive])
{
NSString *characters = [theEvent characters];
unichar character = 0;
if ([characters length] > 0)
{
character = [characters characterAtIndex: 0];
}
if (character == NSHelpFunctionKey)
{
[NSHelpManager setContextHelpModeActive: NO];
return;
}
}
[super keyUp: theEvent];
}
/* Return mouse location in reciever's base coord system, ignores event
* loop status */
- (NSPoint) mouseLocationOutsideOfEventStream