mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
Source/GSSimpleLayoutManager.m
Source/NSMatrix.m Source/NSButtonCell.m git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14133 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
411804ebd7
commit
d56846ede3
4 changed files with 98 additions and 9 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2002-07-11 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
|
||||
|
||||
* Source/NSButtonCell.m ([-isOpaque]): New behaviour
|
||||
that is more consistent with our look and feel
|
||||
* Source/NSMatrix.m ([-drawCellAtRow:column:]):
|
||||
Draws matrix's background if needed and make the opaque ancestor
|
||||
redraw if the matrix is not opaque.
|
||||
([-_drawCellAtRow:column:]): New private method to avoid looping
|
||||
([-drawRect:]): Use _drawCellAtRow:column instead of
|
||||
drawCellAtRow:column.
|
||||
* Source/GSSimpleLayoutManager.m
|
||||
([-rebuildForRange:delta:inTextContainer:]): Empty lines
|
||||
are not fixed height anymore. The height does now depend on the
|
||||
current font or on the current paragraph's settings.
|
||||
|
||||
2002-07-11 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Source/NSOutlineView.m: ([-editColumn:row:withEvent:select:])
|
||||
|
|
|
@ -1105,15 +1105,20 @@ scanRange(NSScanner *scanner, NSCharacterSet* aSet)
|
|||
{
|
||||
// newline - induced premature lineending: flush
|
||||
if (eol.length)
|
||||
{
|
||||
{
|
||||
// Add information for the line break
|
||||
scannerPosition += eol.length;
|
||||
usedLineRect.size.width += 1;
|
||||
/* FIXME: This should use the real font size!! not
|
||||
the default one !! */
|
||||
// FIXME: This should use the real font size!! not
|
||||
// the default one !!
|
||||
// This should be fixed (04-07-02)
|
||||
if (usedLineRect.size.height == 0)
|
||||
{
|
||||
usedLineRect.size.height = defaultFontHeight ();
|
||||
// usedLineRect.size.height = defaultFontHeight ();
|
||||
usedLineRect.size.height =
|
||||
[self _sizeOfRange: NSMakeRange(startingLineCharIndex,
|
||||
eol.length)].height;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -383,6 +383,14 @@
|
|||
* we draw the interior of the cell to fill completely the bounds.
|
||||
* They are likely to draw differently.
|
||||
*/
|
||||
|
||||
// This seems the best to achieve a correct behaviour
|
||||
// (consistent with Nextstep)
|
||||
if (!(_cell.is_bordered
|
||||
|| (_highlightsByMask & NSChangeBackgroundCellMask)
|
||||
|| (_highlightsByMask & NSChangeGrayCellMask)))
|
||||
return NO;
|
||||
|
||||
return !_buttoncell_is_transparent;
|
||||
}
|
||||
|
||||
|
@ -639,10 +647,17 @@
|
|||
if (backgroundColor == nil)
|
||||
backgroundColor = [NSColor controlBackgroundColor];
|
||||
|
||||
/* Draw the cell's background color. We always draw the background,
|
||||
/* Draw the cell's background color.
|
||||
We draw when there is a border or when highlightsByMask
|
||||
is NSChangeBackgroundCellMask or NSChangeGrayCellMask,
|
||||
as required by our nextstep-like look and feel. */
|
||||
[backgroundColor set];
|
||||
NSRectFill (cellFrame);
|
||||
if (_cell.is_bordered
|
||||
|| (_highlightsByMask & NSChangeBackgroundCellMask)
|
||||
|| (_highlightsByMask & NSChangeGrayCellMask))
|
||||
{
|
||||
[backgroundColor set];
|
||||
NSRectFill (cellFrame);
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the image and the title that will be
|
||||
|
|
|
@ -126,6 +126,8 @@ 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;
|
||||
@end
|
||||
|
||||
enum {
|
||||
|
@ -1807,7 +1809,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];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1834,6 +1836,14 @@ 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)
|
||||
{
|
||||
[self lockFocus];
|
||||
|
@ -1841,7 +1851,14 @@ static SEL getSel;
|
|||
NSRectFill(cellFrame);
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
[self lockFocus];
|
||||
[_backgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
if (_dottedRow == row && _dottedColumn == column
|
||||
&& [aCell acceptsFirstResponder])
|
||||
{
|
||||
|
@ -3673,4 +3690,41 @@ 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)
|
||||
{
|
||||
[self lockFocus];
|
||||
[_cellBackgroundColor set];
|
||||
NSRectFill(cellFrame);
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue