mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 17:52:42 +00:00
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:
parent
bbdf936f91
commit
f69dea3ac0
1 changed files with 20 additions and 11 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue