mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:50:37 +00:00
Propagate settings from NSBrowser to underlying matrixes.
Stronger typing in NSBrowser. Clearer drawing code in different classes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26020 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fe88cda478
commit
6212a911c4
5 changed files with 105 additions and 115 deletions
|
@ -177,8 +177,6 @@ static inline MPoint MakePoint (int x, int y)
|
|||
column: (int)column;
|
||||
- (BOOL) _selectPreviousSelectableCellBeforeRow: (int)row
|
||||
column: (int)column;
|
||||
- (void) _drawCellAtRow: (int)row
|
||||
column: (int)column;
|
||||
- (void) _setKeyRow: (int) row
|
||||
column: (int) column;
|
||||
@end
|
||||
|
@ -2039,7 +2037,7 @@ static SEL getSel;
|
|||
for (i = row1; i <= row2 && i < _numRows; i++)
|
||||
for (j = col1; j <= col2 && j < _numCols; j++)
|
||||
{
|
||||
[self _drawCellAtRow: i column: j];
|
||||
[self drawCellAtRow: i column: j];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2070,40 +2068,27 @@ static SEL getSel;
|
|||
{
|
||||
NSRect cellFrame = [self cellFrameAtRow: row column: column];
|
||||
|
||||
if (!_drawsBackground)
|
||||
{
|
||||
// the matrix is not opaque, we call displayRect: so
|
||||
// that our opaque ancestor is redrawn
|
||||
[self displayRect: cellFrame];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_drawsCellBackground)
|
||||
{
|
||||
[_cellBackgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
}
|
||||
else
|
||||
{
|
||||
[_backgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
}
|
||||
if (_drawsCellBackground)
|
||||
{
|
||||
[_cellBackgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
}
|
||||
|
||||
if (_dottedRow == row
|
||||
&& _dottedColumn == column
|
||||
&& [aCell acceptsFirstResponder]
|
||||
&& [aCell acceptsFirstResponder]
|
||||
&& [_window isKeyWindow]
|
||||
&& [_window firstResponder] == self)
|
||||
{
|
||||
[aCell setShowsFirstResponder: YES];
|
||||
&& [_window firstResponder] == self)
|
||||
{
|
||||
[aCell setShowsFirstResponder: YES];
|
||||
[aCell drawWithFrame: cellFrame inView: self];
|
||||
[aCell setShowsFirstResponder: NO];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[aCell setShowsFirstResponder: NO];
|
||||
{
|
||||
[aCell setShowsFirstResponder: NO];
|
||||
[aCell drawWithFrame: cellFrame inView: self];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4098,40 +4083,6 @@ static SEL getSel;
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (void) _drawCellAtRow: (int)row column: (int)column
|
||||
{
|
||||
NSCell *aCell = [self cellAtRow: row column: column];
|
||||
|
||||
if (aCell)
|
||||
{
|
||||
NSRect cellFrame = [self cellFrameAtRow: row column: column];
|
||||
|
||||
// we don't need to draw the matrix's background
|
||||
// as it has already been done in drawRect: if needed
|
||||
// (this method is only called by drawRect:)
|
||||
if (_drawsCellBackground)
|
||||
{
|
||||
[_cellBackgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
}
|
||||
|
||||
if (_dottedRow == row && _dottedColumn == column
|
||||
&& [aCell acceptsFirstResponder])
|
||||
{
|
||||
[aCell
|
||||
setShowsFirstResponder: ([_window isKeyWindow]
|
||||
&& [_window firstResponder] == self)];
|
||||
}
|
||||
else
|
||||
{
|
||||
[aCell setShowsFirstResponder: NO];
|
||||
}
|
||||
|
||||
[aCell drawWithFrame: cellFrame inView: self];
|
||||
[aCell setShowsFirstResponder: NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _setKeyRow: (int)row column: (int)column
|
||||
{
|
||||
if (_dottedRow == row && _dottedColumn == column)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue