mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +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
96b4180a73
commit
55f804b003
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>
|
Mon Sep 6 6:37:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSWindow.m: added enable/disable flush fix from dawn.
|
* Source/NSWindow.m: added enable/disable flush fix from dawn.
|
||||||
|
|
|
@ -781,6 +781,9 @@ static int mouseDownFlags = 0;
|
||||||
NSArray *row;
|
NSArray *row;
|
||||||
NSCell *aCell;
|
NSCell *aCell;
|
||||||
|
|
||||||
|
if (!allowsEmptySelection && mode == NSRadioModeMatrix)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < numRows; i++)
|
for (i = 0; i < numRows; i++)
|
||||||
{
|
{
|
||||||
row = nil;
|
row = nil;
|
||||||
|
@ -800,9 +803,6 @@ static int mouseDownFlags = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allowsEmptySelection && mode == NSRadioModeMatrix)
|
|
||||||
[self selectCellAtRow: 0 column: 0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) deselectSelectedCell
|
- (void) deselectSelectedCell
|
||||||
|
@ -852,15 +852,21 @@ static int mouseDownFlags = 0;
|
||||||
{
|
{
|
||||||
((tMatrix)selectedCells)->matrix[selectedRow][selectedColumn] = NO;
|
((tMatrix)selectedCells)->matrix[selectedRow][selectedColumn] = NO;
|
||||||
[selectedCell setState: 0];
|
[selectedCell setState: 0];
|
||||||
|
|
||||||
|
[self setNeedsDisplayInRect: [self cellFrameAtRow: selectedRow
|
||||||
|
column: selectedColumn]];
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedCell = aCell;
|
if ((row >= 0) && (column >= 0))
|
||||||
selectedRow = row;
|
{
|
||||||
selectedColumn = column;
|
selectedCell = aCell;
|
||||||
((tMatrix)selectedCells)->matrix[row][column] = YES;
|
selectedRow = row;
|
||||||
[selectedCell setState: 1];
|
selectedColumn = column;
|
||||||
|
((tMatrix)selectedCells)->matrix[row][column] = YES;
|
||||||
[self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]];
|
[selectedCell setState: 1];
|
||||||
|
|
||||||
|
[self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) selectCellWithTag: (int)anInt
|
- (BOOL) selectCellWithTag: (int)anInt
|
||||||
|
@ -1181,6 +1187,28 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
||||||
[self setFrameSize: newSize];
|
[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
|
- (void) scrollCellToVisibleAtRow: (int)row
|
||||||
column: (int)column
|
column: (int)column
|
||||||
{
|
{
|
||||||
|
@ -1997,6 +2025,7 @@ fprintf(stderr, " NSMatrix: selectTextAtRow --- ");
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: implement resize according to autosizesCells
|
||||||
|
|
||||||
//
|
//
|
||||||
// Methods that may not be needed FIX ME
|
// Methods that may not be needed FIX ME
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue