mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 00:21:36 +00:00
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:
parent
3d9091f2d4
commit
d2cdcf7415
4 changed files with 40 additions and 32 deletions
|
@ -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>
|
2008-06-02 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:):
|
* Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:):
|
||||||
|
|
|
@ -625,6 +625,18 @@ static NSNotificationCenter *nc;
|
||||||
|
|
||||||
- (void) drawRect: (NSRect)aRect
|
- (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];
|
[self drawCell: _cell];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3254,9 +3254,9 @@ byExtendingSelection: (BOOL)flag
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) editColumn: (int) columnIndex
|
- (void) editColumn: (int) columnIndex
|
||||||
row: (int) rowIndex
|
row: (int) rowIndex
|
||||||
withEvent: (NSEvent *) theEvent
|
withEvent: (NSEvent *) theEvent
|
||||||
select: (BOOL) flag
|
select: (BOOL) flag
|
||||||
{
|
{
|
||||||
NSText *t;
|
NSText *t;
|
||||||
NSTableColumn *tb;
|
NSTableColumn *tb;
|
||||||
|
@ -5188,7 +5188,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
||||||
|
|
||||||
for (i = startingRow; i <= endingRow; i++)
|
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])
|
if ([self _isCellEditableColumn: column row:row])
|
||||||
{
|
{
|
||||||
[self editColumn: column
|
[self editColumn: column
|
||||||
row: row
|
row: row
|
||||||
withEvent: nil
|
withEvent: nil
|
||||||
select: YES];
|
select: YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,31 +235,20 @@ static NSColor *txtCol;
|
||||||
|
|
||||||
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||||
{
|
{
|
||||||
/* Do nothing if there is already a text editor doing the drawing;
|
if (_textfieldcell_draws_background)
|
||||||
* otherwise, we draw everything twice. That is bad if there are
|
{
|
||||||
* any transparency involved (eg, even an anti-alias font!) because
|
if ([self isEnabled])
|
||||||
* if the semi-transparent pixels are drawn over themselves they
|
{
|
||||||
* become less transparent (eg, an anti-alias font becomes darker
|
[_background_color set];
|
||||||
* and gives the impression of being bold).
|
}
|
||||||
*/
|
else
|
||||||
if (([controlView respondsToSelector: @selector(currentEditor)] == NO)
|
{
|
||||||
|| ([(NSTextField *)controlView currentEditor] == nil))
|
[[NSColor controlBackgroundColor] set];
|
||||||
{
|
}
|
||||||
if (_textfieldcell_draws_background)
|
NSRectFill([self drawingRectForBounds: cellFrame]);
|
||||||
{
|
|
||||||
if ([self isEnabled])
|
|
||||||
{
|
|
||||||
[_background_color set];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
[[NSColor controlBackgroundColor] set];
|
|
||||||
}
|
|
||||||
NSRectFill([self drawingRectForBounds: cellFrame]);
|
|
||||||
}
|
|
||||||
|
|
||||||
[super drawInteriorWithFrame: cellFrame inView: controlView];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[super drawInteriorWithFrame: cellFrame inView: controlView];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue