Check in the control not in the text field whether the cell is currently

being edited.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26613 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2008-06-09 10:04:49 +00:00
parent 3d9091f2d4
commit d2cdcf7415
4 changed files with 40 additions and 32 deletions

View file

@ -1,3 +1,10 @@
2008-06-09 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTableView.m: Indentation changes.
* Source/NSTextFieldCell.m ([-drawInteriorWithFrame:inView:]):
Move editing check from here to ...
* Source/NSControl.m (-drawRect:): ... here.
2008-06-02 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:):

View file

@ -625,6 +625,18 @@ static NSNotificationCenter *nc;
- (void) drawRect: (NSRect)aRect
{
/* Do nothing if there is already a text editor doing the drawing;
* otherwise, we draw everything twice. That is bad if there are
* any transparency involved (eg, even an anti-alias font!) because
* if the semi-transparent pixels are drawn over themselves they
* become less transparent (eg, an anti-alias font becomes darker
* and gives the impression of being bold).
*/
if ([self currentEditor] != nil)
{
return;
}
[self drawCell: _cell];
}

View file

@ -3254,9 +3254,9 @@ byExtendingSelection: (BOOL)flag
}
- (void) editColumn: (int) columnIndex
row: (int) rowIndex
withEvent: (NSEvent *) theEvent
select: (BOOL) flag
row: (int) rowIndex
withEvent: (NSEvent *) theEvent
select: (BOOL) flag
{
NSText *t;
NSTableColumn *tb;
@ -5188,7 +5188,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
for (i = startingRow; i <= endingRow; i++)
{
(*imp)(self, sel, i, aRect);
(*imp)(self, sel, i, aRect);
}
}
}
@ -5924,10 +5924,10 @@ static BOOL selectContiguousRegion(NSTableView *self,
if ([self _isCellEditableColumn: column row:row])
{
[self editColumn: column
row: row
withEvent: nil
select: YES];
[self editColumn: column
row: row
withEvent: nil
select: YES];
}
}
}

View file

@ -235,31 +235,20 @@ static NSColor *txtCol;
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
{
/* Do nothing if there is already a text editor doing the drawing;
* otherwise, we draw everything twice. That is bad if there are
* any transparency involved (eg, even an anti-alias font!) because
* if the semi-transparent pixels are drawn over themselves they
* become less transparent (eg, an anti-alias font becomes darker
* and gives the impression of being bold).
*/
if (([controlView respondsToSelector: @selector(currentEditor)] == NO)
|| ([(NSTextField *)controlView currentEditor] == nil))
{
if (_textfieldcell_draws_background)
{
if ([self isEnabled])
{
[_background_color set];
}
else
{
[[NSColor controlBackgroundColor] set];
}
NSRectFill([self drawingRectForBounds: cellFrame]);
}
[super drawInteriorWithFrame: cellFrame inView: controlView];
if (_textfieldcell_draws_background)
{
if ([self isEnabled])
{
[_background_color set];
}
else
{
[[NSColor controlBackgroundColor] set];
}
NSRectFill([self drawingRectForBounds: cellFrame]);
}
[super drawInteriorWithFrame: cellFrame inView: controlView];
}
/*