Tidyups and fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4836 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-09-06 05:29:24 +00:00
parent c4436b7582
commit 63e43e1956
2 changed files with 49 additions and 10 deletions

View file

@ -781,6 +781,9 @@ static int mouseDownFlags = 0;
NSArray *row;
NSCell *aCell;
if (!allowsEmptySelection && mode == NSRadioModeMatrix)
return;
for (i = 0; i < numRows; i++)
{
row = nil;
@ -800,9 +803,6 @@ static int mouseDownFlags = 0;
}
}
}
if (!allowsEmptySelection && mode == NSRadioModeMatrix)
[self selectCellAtRow: 0 column: 0];
}
- (void) deselectSelectedCell
@ -852,15 +852,21 @@ static int mouseDownFlags = 0;
{
((tMatrix)selectedCells)->matrix[selectedRow][selectedColumn] = NO;
[selectedCell setState: 0];
[self setNeedsDisplayInRect: [self cellFrameAtRow: selectedRow
column: selectedColumn]];
}
selectedCell = aCell;
selectedRow = row;
selectedColumn = column;
((tMatrix)selectedCells)->matrix[row][column] = YES;
[selectedCell setState: 1];
[self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]];
if ((row >= 0) && (column >= 0))
{
selectedCell = aCell;
selectedRow = row;
selectedColumn = column;
((tMatrix)selectedCells)->matrix[row][column] = YES;
[selectedCell setState: 1];
[self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]];
}
}
- (BOOL) selectCellWithTag: (int)anInt
@ -1181,6 +1187,28 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
[self setFrameSize: newSize];
}
- (void) sizeToFit
{
NSSize newSize = NSZeroSize;
NSSize tmpSize;
NSMutableArray *row;
int i,j;
for (i = 0; i < numRows; i++)
{
row = [cells objectAtIndex: i];
for (j = 0; j < numCols; j++)
{
tmpSize = [[row objectAtIndex: j] cellSize];
if (tmpSize.width > newSize.width)
newSize.width = tmpSize.width;
if (tmpSize.height > newSize.height)
newSize.height = tmpSize.height;
}
}
[self setCellSize: newSize];
}
- (void) scrollCellToVisibleAtRow: (int)row
column: (int)column
{
@ -1997,6 +2025,7 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
return YES;
}
// TODO: implement resize according to autosizesCells
//
// Methods that may not be needed FIX ME