mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Fixes from n.pero
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4989 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9196accea4
commit
adba2520a6
4 changed files with 43 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
|||
Sat Oct 9 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
* Source/NSButton.m ([-keyDown:]): Perform a click if
|
||||
the key is SPACE or ENTER.
|
||||
* Source/NSCell.m ([-performClick:]): Completely rewritten.
|
||||
* Source/NSView.m ([-previousValidKeyView]),
|
||||
([-nextValidKeyView]): fix to avoid an infinite loop.
|
||||
|
||||
1999-10-09 <fedor@gnu.org>
|
||||
|
||||
* Model/GMAppKit.m ([NSPopUpButton -initWithModelUnarchiver:]):
|
||||
|
|
|
@ -294,8 +294,24 @@ id _nsbuttonCellClass = nil;
|
|||
|
||||
- (void) keyDown: (NSEvent*)theEvent
|
||||
{
|
||||
if ([self performKeyEquivalent: theEvent] == NO)
|
||||
[super keyDown: theEvent];
|
||||
if ([self isEnabled])
|
||||
{
|
||||
NSString *keyDescription = [theEvent charactersIgnoringModifiers];
|
||||
|
||||
// Handle SPACE or RETURN to perform a click
|
||||
if (([keyDescription compare: @" "] == NSOrderedSame)
|
||||
|| ([theEvent keyCode] == 0x0d))
|
||||
{
|
||||
[self performClick: self];
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Understand better, I don't think this should be here.
|
||||
if ([self performKeyEquivalent: theEvent] == YES)
|
||||
return;
|
||||
}
|
||||
|
||||
[super keyDown: theEvent];
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -825,15 +825,26 @@ static Class cellClass;
|
|||
- (void) performClick: (id)sender
|
||||
{
|
||||
NSView *cv;
|
||||
NSRect cvBounds;
|
||||
NSWindow *cvWin;
|
||||
|
||||
if (control_view)
|
||||
cv = control_view;
|
||||
else
|
||||
cv = [NSView focusView];
|
||||
|
||||
NSLog(@"performClick:");
|
||||
cvBounds = [cv bounds];
|
||||
cvWin = [cv window];
|
||||
|
||||
[self highlight: YES withFrame: cvBounds inView: cv];
|
||||
[cvWin flushWindow];
|
||||
// Wait approx 1/5 seconds
|
||||
[[NSRunLoop currentRunLoop]
|
||||
runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.2]];
|
||||
|
||||
[self highlight: NO withFrame: cvBounds inView: cv];
|
||||
[cvWin flushWindow];
|
||||
|
||||
[self highlight: YES withFrame: [cv frame] inView: cv];
|
||||
if ([self action])
|
||||
{
|
||||
NS_DURING
|
||||
|
@ -842,14 +853,11 @@ static Class cellClass;
|
|||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
[self highlight: NO withFrame: [cv frame] inView: cv];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
[self highlight: NO withFrame: [cv frame] inView: cv];
|
||||
}
|
||||
|
||||
/*
|
||||
* Assigning a Tag
|
||||
*/
|
||||
|
|
|
@ -2090,7 +2090,8 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
theView = _nextKeyView;
|
||||
while (1)
|
||||
{
|
||||
if ([theView acceptsFirstResponder] || (theView == nil))
|
||||
if ([theView acceptsFirstResponder] || (theView == nil)
|
||||
|| (theView == self))
|
||||
return theView;
|
||||
|
||||
theView = [theView nextKeyView];
|
||||
|
@ -2122,7 +2123,8 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
theView = _previousKeyView;
|
||||
while (1)
|
||||
{
|
||||
if ([theView acceptsFirstResponder] || (theView == nil))
|
||||
if ([theView acceptsFirstResponder] || (theView == nil)
|
||||
|| (theView == self))
|
||||
return theView;
|
||||
|
||||
theView = [theView previousKeyView];
|
||||
|
|
Loading…
Reference in a new issue