mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
2005-01-18 16:53 Alexander Malmberg <alexander@malmberg.org>
* Source/NSCell.m (-setUpFieldEditorAttributes:): Clear the text object's string. * Source/NSControl.m (-setDoubleValue:, -setFloatValue:) (-setIntValue:, -setStringValue:, -setObjectValue:): If the receiver was being edited when the method was called, make it the first responder after changing the value. (-abortEditing): Don't clear the text object's string. * Source/NSMatrix.m (-abortEditing): Don't clear the text object's string. * Source/NSTableView.m (-abortEditing): Ditto. * Source/NSTextField.m (-abortEditing): Ditto. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20580 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cc5de74696
commit
f282f87e88
6 changed files with 46 additions and 15 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2005-01-18 16:53 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSCell.m (-setUpFieldEditorAttributes:): Clear the
|
||||
text object's string.
|
||||
* Source/NSControl.m (-setDoubleValue:, -setFloatValue:)
|
||||
(-setIntValue:, -setStringValue:, -setObjectValue:): If the receiver
|
||||
was being edited when the method was called, make it the first
|
||||
responder after changing the value.
|
||||
(-abortEditing): Don't clear the text object's string.
|
||||
* Source/NSMatrix.m (-abortEditing): Don't clear the text object's
|
||||
string.
|
||||
* Source/NSTableView.m (-abortEditing): Ditto.
|
||||
* Source/NSTextField.m (-abortEditing): Ditto.
|
||||
|
||||
2005-01-18 16:39 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSBitmapImageRep.m
|
||||
|
|
|
@ -870,6 +870,7 @@ static NSColor *shadowCol;
|
|||
|
||||
- (NSText*) setUpFieldEditorAttributes: (NSText*)textObject
|
||||
{
|
||||
[textObject setString: @""];
|
||||
[textObject setTextColor: [self textColor]];
|
||||
if (_cell.contents_is_attributed_string == NO)
|
||||
{
|
||||
|
|
|
@ -181,56 +181,76 @@ static Class actionCellClass;
|
|||
- (void) setDoubleValue: (double)aDouble
|
||||
{
|
||||
NSCell *selected = [self selectedCell];
|
||||
|
||||
[self abortEditing];
|
||||
BOOL wasEditing = [self abortEditing];
|
||||
|
||||
[selected setDoubleValue: aDouble];
|
||||
if (![selected isKindOfClass: actionCellClass])
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (wasEditing)
|
||||
{
|
||||
[[self window] makeFirstResponder: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setFloatValue: (float)aFloat
|
||||
{
|
||||
NSCell *selected = [self selectedCell];
|
||||
|
||||
[self abortEditing];
|
||||
BOOL wasEditing = [self abortEditing];
|
||||
|
||||
[selected setFloatValue: aFloat];
|
||||
if (![selected isKindOfClass: actionCellClass])
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (wasEditing)
|
||||
{
|
||||
[[self window] makeFirstResponder: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setIntValue: (int)anInt
|
||||
{
|
||||
NSCell *selected = [self selectedCell];
|
||||
|
||||
[self abortEditing];
|
||||
BOOL wasEditing = [self abortEditing];
|
||||
|
||||
[selected setIntValue: anInt];
|
||||
if (![selected isKindOfClass: actionCellClass])
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (wasEditing)
|
||||
{
|
||||
[[self window] makeFirstResponder: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setStringValue: (NSString *)aString
|
||||
{
|
||||
NSCell *selected = [self selectedCell];
|
||||
|
||||
[self abortEditing];
|
||||
BOOL wasEditing = [self abortEditing];
|
||||
|
||||
[selected setStringValue: aString];
|
||||
if (![selected isKindOfClass: actionCellClass])
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (wasEditing)
|
||||
{
|
||||
[[self window] makeFirstResponder: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setObjectValue: (id)anObject
|
||||
{
|
||||
NSCell *selected = [self selectedCell];
|
||||
|
||||
[self abortEditing];
|
||||
BOOL wasEditing = [self abortEditing];
|
||||
|
||||
[selected setObjectValue: anObject];
|
||||
if (![selected isKindOfClass: actionCellClass])
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
if (wasEditing)
|
||||
{
|
||||
[[self window] makeFirstResponder: self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setNeedsDisplay
|
||||
|
@ -354,7 +374,6 @@ static Class actionCellClass;
|
|||
return NO;
|
||||
}
|
||||
|
||||
[t setString: @""];
|
||||
[[self selectedCell] endEditing: t];
|
||||
return YES;
|
||||
}
|
||||
|
|
|
@ -3442,7 +3442,6 @@ static SEL getSel;
|
|||
{
|
||||
if (_textObject)
|
||||
{
|
||||
[_textObject setString: @""];
|
||||
[_selectedCell endEditing: _textObject];
|
||||
_textObject = nil;
|
||||
return YES;
|
||||
|
|
|
@ -3099,7 +3099,6 @@ byExtendingSelection: (BOOL)flag
|
|||
{
|
||||
if (_textObject)
|
||||
{
|
||||
[_textObject setString: @""];
|
||||
[_editedCell endEditing: _textObject];
|
||||
RELEASE (_editedCell);
|
||||
[self setNeedsDisplayInRect:
|
||||
|
|
|
@ -371,7 +371,6 @@ static Class textFieldCellClass;
|
|||
{
|
||||
if (_text_object)
|
||||
{
|
||||
[_text_object setString: @""];
|
||||
[_cell endEditing: _text_object];
|
||||
_text_object = nil;
|
||||
return YES;
|
||||
|
@ -388,7 +387,7 @@ static Class textFieldCellClass;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (void) validateEditing
|
||||
- (void) validateEditing
|
||||
{
|
||||
if (_text_object)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue