Allow cells to print even when not connected to a window.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21249 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2005-05-22 21:12:08 +00:00
parent 5c4ecb0014
commit eb370a013c
7 changed files with 16 additions and 23 deletions

View file

@ -1,3 +1,14 @@
2005-05-22 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSView.m (-display)
* Source/NSCell.m (-drawWithFrame:inView:)
* Source/NSBrowserCell.m (-drawWithFrame:inView:)
* Source/NSImageCell.m (-drawWithFrame:inView:)
* Source/NSMenuItemCell.m (-drawWithFrame:inView:)
* Source/NSTableHeaderCell.m (-drawWithFrame:inView:)
Removed check for window existence. This should already have been
checked by a surrounding canDraw call. Fixes bug #13140.
2005-05-22 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSComboBox.m (-cellSize) Added simple implementation of

View file

@ -235,10 +235,6 @@ static NSFont *_leafFont;
NSColor *backColor;
NSWindow *cvWin = [controlView window];
if (!cvWin)
return;
if (_cell.is_highlighted || _cell.state)
{
backColor = [self highlightColorInView: controlView];

View file

@ -1658,9 +1658,6 @@ static NSColor *shadowCol;
*/
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
{
if (![controlView window])
return;
cellFrame = [self drawingRectForBounds: cellFrame];
//FIXME: Check if this is also neccessary for images,
@ -1717,7 +1714,7 @@ static NSColor *shadowCol;
- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
{
// do nothing if cell's frame rect is zero
if (NSIsEmptyRect(cellFrame) || ![controlView window])
if (NSIsEmptyRect(cellFrame))
return;
// draw the border if needed

View file

@ -124,7 +124,7 @@
NSDebugLLog(@"NSImageCell", @"NSImageCell -drawWithFrame");
// do nothing if cell's frame rect is zero
if (NSIsEmptyRect(cellFrame) || ![controlView window])
if (NSIsEmptyRect(cellFrame))
return;
// draw the border if needed
@ -215,7 +215,7 @@ scaleProportionally(NSSize imageSize, NSRect canvasRect)
NSDebugLLog(@"NSImageCell", @"NSImageCell drawInteriorWithFrame called");
if (![controlView window] || !_cell_image)
if (!_cell_image)
return;
// leave room for the frame

View file

@ -503,10 +503,6 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
if (NSIsEmptyRect(cellFrame))
return;
// Do nothing if the window is deferred
if ([[controlView window] gState] == 0)
return;
// Draw the border if needed
[self drawBorderAndBackgroundWithFrame: cellFrame inView: controlView];

View file

@ -59,7 +59,7 @@ static NSColor *clearCol = nil;
NSRect interiorFrame = NSMakeRect (cellFrame.origin.x-1, cellFrame.origin.y-1,
cellFrame.size.width+2, cellFrame.size.height+2);
if (NSIsEmptyRect (cellFrame) || ![controlView window])
if (NSIsEmptyRect (cellFrame))
return;
if (_cell.is_highlighted == YES)

View file

@ -1757,14 +1757,7 @@ static NSRect convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matri
- (void) display
{
if (_window != nil)
{
if (_coordinates_valid == NO)
{
[self _rebuildCoordinates];
}
[self displayRect: _visibleRect];
}
[self displayRect: [self visibleRect]];
}
- (void) displayIfNeeded