mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 14:00:54 +00:00
Editing patches partly by Andreas Höschler <ahoesch@smartsoft.de>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25426 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
561e8d0985
commit
ddb1df7caa
5 changed files with 140 additions and 111 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2007-08-31 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSWindow.m (-makeFirstResponder:): When parameter is nil,
|
||||
set self as first responder and return YES.
|
||||
* Source/NSCell.m (-isEntryAcceptable:): Accept empty strings.
|
||||
* Source/NSTableView.m (-validateEditing): Check if delegate
|
||||
supports method, before calling it.
|
||||
* Source/NSTextField.m (-validateEditing): Accept empty strings.
|
||||
Patches partly by Andreas Höschler <ahoesch@smartsoft.de>.
|
||||
|
||||
2007-08-29 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSCell.h: Export more private drawing methods.
|
||||
|
|
|
@ -1238,7 +1238,7 @@ static NSColor *shadowCol;
|
|||
|
||||
- (BOOL) isEntryAcceptable: (NSString*)aString
|
||||
{
|
||||
if (_formatter != nil)
|
||||
if ((_formatter != nil) && ![aString isEqualToString: @""])
|
||||
{
|
||||
id newObjectValue;
|
||||
|
||||
|
|
|
@ -3158,7 +3158,7 @@ byExtendingSelection: (BOOL)flag
|
|||
BOOL validatedOK = YES;
|
||||
|
||||
formatter = [_editedCell formatter];
|
||||
string = AUTORELEASE ([[_textObject text] copy]);
|
||||
string = AUTORELEASE([[_textObject text] copy]);
|
||||
|
||||
if (formatter == nil)
|
||||
{
|
||||
|
@ -3171,10 +3171,14 @@ byExtendingSelection: (BOOL)flag
|
|||
if ([formatter getObjectValue: &newObjectValue
|
||||
forString: string
|
||||
errorDescription: &error] == NO)
|
||||
{
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(control:didFailToFormatString:errorDescription:)])
|
||||
{
|
||||
if ([_delegate control: self
|
||||
didFailToFormatString: string
|
||||
errorDescription: error] == NO)
|
||||
|
||||
{
|
||||
validatedOK = NO;
|
||||
}
|
||||
|
@ -3183,6 +3187,16 @@ byExtendingSelection: (BOOL)flag
|
|||
newObjectValue = string;
|
||||
}
|
||||
}
|
||||
// Allow an empty string to fall through
|
||||
else if ([string isEqualToString: @""])
|
||||
{
|
||||
newObjectValue = string;
|
||||
}
|
||||
else
|
||||
{
|
||||
validatedOK = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (validatedOK == YES)
|
||||
{
|
||||
|
|
|
@ -457,15 +457,12 @@ static Class textFieldCellClass;
|
|||
{
|
||||
NSFormatter *formatter;
|
||||
NSString *string;
|
||||
BOOL validatedOK = YES;
|
||||
|
||||
formatter = [_cell formatter];
|
||||
string = AUTORELEASE ([[_text_object text] copy]);
|
||||
|
||||
if (formatter == nil)
|
||||
{
|
||||
[_cell setStringValue: string];
|
||||
}
|
||||
else
|
||||
if (formatter != nil)
|
||||
{
|
||||
id newObjectValue;
|
||||
NSString *error;
|
||||
|
@ -475,20 +472,28 @@ static Class textFieldCellClass;
|
|||
errorDescription: &error] == YES)
|
||||
{
|
||||
[_cell setObjectValue: newObjectValue];
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
SEL sel = @selector(control:didFailToFormatString:errorDescription:);
|
||||
|
||||
if ([_delegate respondsToSelector: sel] &&
|
||||
[_delegate control: self
|
||||
didFailToFormatString: string
|
||||
errorDescription: error] == YES)
|
||||
if ([_delegate respondsToSelector: sel])
|
||||
{
|
||||
[_cell setStringValue: string];
|
||||
validatedOK = [_delegate control: self
|
||||
didFailToFormatString: string
|
||||
errorDescription: error];
|
||||
}
|
||||
else if (![string isEqualToString: @""])
|
||||
{
|
||||
validatedOK = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (validatedOK)
|
||||
{
|
||||
[_cell setStringValue: string];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2819,11 +2819,11 @@ resetCursorRectsForView(NSView *theView)
|
|||
return NO;
|
||||
|
||||
_firstResponder = aResponder;
|
||||
if (![_firstResponder becomeFirstResponder])
|
||||
if ((aResponder == nil) || ![_firstResponder becomeFirstResponder])
|
||||
{
|
||||
_firstResponder = self;
|
||||
[_firstResponder becomeFirstResponder];
|
||||
return NO;
|
||||
return (aResponder == nil);
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
|
Loading…
Reference in a new issue