mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
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:
parent
c4436b7582
commit
63e43e1956
2 changed files with 49 additions and 10 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
1999-09-06 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
* Source/NSMatrix: Added missing method ([-sizeToFit]).
|
||||
([-deselectAllCells]): do nothing, as in MacOS-X, if mode is
|
||||
NSRadioModeMatrix and empty selection is not allowed.
|
||||
([-selectCellAtRow:column:]): mark both the cells, newly selected
|
||||
and deselected one, as needing redraw, not only the newly selected
|
||||
cell. If row or column is negative, just deselect the currently
|
||||
selected cell, as in MacOS-X.
|
||||
|
||||
Mon Sep 6 6:37:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSWindow.m: added enable/disable flush fix from dawn.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue