diff --git a/ChangeLog b/ChangeLog index 4a66cf9ce..e1cdc5360 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-09-11 Mirko Viviani + + * Source/NSBrowser.m ([NSBrowser -_performLoadOfColumn:]): set + intercell spacing to 0. + * Source/NSMatrix.m ([NSMatrix -mouseDown:]): in NSRadioModeMatrix + deselect the previous selected cell only if the cell is valid. + 2000-09-10 Mirko Viviani * Tools/gpbs.m ([PasteboardEntry -lostOwnership]): workaround to avoid diff --git a/Source/NSBrowser.m b/Source/NSBrowser.m index 3c43f33a3..67b41c399 100644 --- a/Source/NSBrowser.m +++ b/Source/NSBrowser.m @@ -2815,6 +2815,7 @@ static float scrollerWidth; // == [NSScroller scrollerWidth] { id bc, sc, matrix = nil; NSRect matrixRect = {{0, 0}, {100, 100}}; + NSSize matrixIntercellSpace = {{0, 0}}; #if defined NSBTRACE__performLoadOfColumn || defined NSBTRACE_all fprintf(stderr, "NSBrowser - (void)_performLoadOfColumn: %d\n", column); @@ -2846,6 +2847,7 @@ static float scrollerWidth; // == [NSScroller scrollerWidth] prototype: _browserCellPrototype numberOfRows: n numberOfColumns: 1]; + [matrix setIntercellSpacing:matrixIntercellSpace]; [matrix setAllowsEmptySelection: _allowsEmptySelection]; if (!_allowsMultipleSelection) [matrix setMode: NSRadioModeMatrix]; @@ -2877,6 +2879,7 @@ static float scrollerWidth; // == [NSScroller scrollerWidth] prototype: _browserCellPrototype numberOfRows: 0 numberOfColumns: 0]; + [matrix setIntercellSpacing:matrixIntercellSpace]; [matrix setAllowsEmptySelection: _allowsEmptySelection]; if (_allowsMultipleSelection) [matrix setMode: NSListModeMatrix]; diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index 9f18d1597..183a70246 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -1917,6 +1917,16 @@ static SEL getSel = @selector(objectAtIndex:); column: &column forPoint: lastLocation]) { + if ((_mode == NSRadioModeMatrix) && _selectedCell != nil) + { + [_selectedCell setState: NSOffState]; + [self drawCellAtRow: _selectedRow column: _selectedColumn]; + [_window flushWindow]; + _selectedCells[_selectedRow][_selectedColumn] = NO; + _selectedCell = nil; + _selectedRow = _selectedColumn = -1; + } + if ([_cells[row][column] isSelectable]) { NSText* t = [_window fieldEditor: YES forObject: self]; @@ -1969,16 +1979,6 @@ static SEL getSel = @selector(objectAtIndex:); withPeriod: 0.05]; ASSIGN(lastEvent, theEvent); - if ((_mode == NSRadioModeMatrix) && _selectedCell != nil) - { - [_selectedCell setState: NSOffState]; - [self drawCellAtRow: _selectedRow column: _selectedColumn]; - [_window flushWindow]; - _selectedCells[_selectedRow][_selectedColumn] = NO; - _selectedCell = nil; - _selectedRow = _selectedColumn = -1; - } - // selection involves two steps, first // a loop that continues until the left mouse goes up; then a series of // steps which send actions and display the cell as it should appear after @@ -2036,7 +2036,7 @@ static SEL getSel = @selector(objectAtIndex:); case NSRadioModeMatrix: // Radio mode allows no more than one cell to be selected - if (previousCell == aCell) + if (previousCell == aCell || aCell == nil) break; // deselect previously selected cell