Fixes, improvements of editing

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5147 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 1999-11-09 23:08:25 +00:00
parent bbdf936f91
commit f69dea3ac0

View file

@ -493,7 +493,19 @@ static NSColor *shadowCol;
*/
- (NSText*) setUpFieldEditorAttributes: (NSText*)textObject
{
return nil;
if ([self isEnabled])
[textObject setTextColor: txtCol];
else
[textObject setTextColor: dtxtCol];
if (cell_highlighted)
[textObject setBackgroundColor: hbgCol];
else
[textObject setBackgroundColor: bgCol];
[textObject setFont: [self font]];
[textObject setAlignment: [self alignment]];
return textObject;
}
- (void) editWithFrame: (NSRect)aRect
@ -506,13 +518,12 @@ static NSColor *shadowCol;
(cell_type != NSTextCellType))
return;
textObject = [self setUpFieldEditorAttributes: textObject];
[textObject setDelegate: anObject];
aRect.origin.y -= 1;
[textObject setFrame: aRect];
[textObject setText: [self stringValue]];
[controlView addSubview:textObject];
[textObject display];
[[controlView window] makeFirstResponder: textObject];
@ -530,9 +541,10 @@ static NSColor *shadowCol;
[textObject retain];
[textObject removeFromSuperview];
[self setStringValue: [textObject text]];
[textObject setString:@""];
[textObject setString: @""];
}
// TODO: Check, what exactly this method is supposed to do?
- (void) selectWithFrame: (NSRect)aRect
inView: (NSView *)controlView
editor: (NSText *)textObject
@ -544,16 +556,13 @@ static NSColor *shadowCol;
(cell_type != NSTextCellType))
return;
[[controlView window] makeFirstResponder: textObject];
textObject = [self setUpFieldEditorAttributes: textObject];
[textObject setFrame: aRect];
[textObject setAlignment: text_align];
[textObject setText: [self stringValue]];
[textObject setDelegate: anObject];
[textObject setSelectedRange: NSMakeRange (selStart, selLength)];
[controlView addSubview: textObject];
[controlView lockFocus];
NSEraseRect(aRect);
[controlView unlockFocus];
[[controlView window] makeFirstResponder: textObject];
[textObject display];
}