Patches for browser and matrix bugs

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4931 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-09-21 20:03:46 +00:00
parent 82a4893bef
commit cf0898c81f
3 changed files with 72 additions and 7 deletions

View file

@ -1,3 +1,13 @@
Tue Sep 21 1999 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSBrowser.m ([-selectedColumn]): fix: ignore unloaded
columns when searching the currently selected one.
* Source/NSMatrix.m ([-drawCellAtRow:column:]): fix: added forgotten
lockFocus/unlockFocus.
* Source/NSMatrix.m ([-resizeWithOldSuperviewSize:]): New method
implementing the prescribed autoresizing behaviour according to
autosizesCells.
1999-09-21 Adam Fedor <fedor@gnu.org>
* Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Put

View file

@ -755,12 +755,15 @@
while ((!found) && (o = [e nextObject]))
{
id matrix = [o columnMatrix];
c = [matrix selectedCell];
if (c)
found = YES;
else
if ([o isLoaded])
{
c = [[o columnMatrix] selectedCell];
if (c)
found = YES;
else
--i;
}
else
--i;
}

View file

@ -1272,8 +1272,10 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
if (drawsCellBackground)
{
[self lockFocus];
[cellBackgroundColor set];
NSRectFill(cellFrame);
[self unlockFocus];
}
[aCell drawWithFrame: cellFrame inView: self];
}
@ -2020,7 +2022,57 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
return YES;
}
// TODO: implement resize according to autosizesCells
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
{
NSSize oldBoundsSize = bounds.size;
NSSize newBoundsSize;
NSSize change;
int nc = numCols;
int nr = numRows;
[super resizeWithOldSuperviewSize: oldSize];
newBoundsSize = bounds.size;
change.height = newBoundsSize.height - oldBoundsSize.height;
change.width = newBoundsSize.width - oldBoundsSize.width;
if ((change.height == 0) && (change.width == 0))
return;
if (autosizesCells)
{
if (nr <= 0) nr = 1;
change.height = change.height / nr;
cellSize.height += change.height;
if (cellSize.height < 0)
cellSize.height = 0;
if (nc <= 0) nc = 1;
change.width = change.width / nc;
cellSize.width += change.width;
if (cellSize.width < 0)
cellSize.width = 0;
}
else
{
if (nr > 1)
{
change.height = change.height / (nr - 1);
intercell.height += change.height;
if (intercell.height < 0)
intercell.height = 0;
}
if (nc > 1)
{
change.width = change.width / (nc - 1);
intercell.width += change.width;
if (intercell.width < 0)
intercell.width = 0;
}
}
[self setNeedsDisplay: YES];
}
//
// Methods that may not be needed FIX ME