Ivar type change on NSTableView and selection cleanup.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18929 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-03-27 17:48:00 +00:00
parent 93e4b68162
commit 97692a624e
4 changed files with 765 additions and 1668 deletions

View file

@ -1,3 +1,12 @@
2004-03-27 Fred Kiefer <FredKiefer@gmx.de>
* Header/AppKit/NSTableView.h:
Added ivars _selectedColumns and _selectedRows to NSMutableIndexSet.
* Source/NSTableView.m:
* Source/NSOutlineView.m:
Chnaged all the uses of these ivars and started to restructure the
row selection code. Also removed some (not all) dead code.
2004-03-23 23:52 Alexander Malmberg <alexander@malmberg.org>
* Headers/Additions/GNUstepGUI/GSToolbar.h,

View file

@ -35,6 +35,7 @@
@class NSArray;
@class NSIndexSet;
@class NSMutableIndexSet;
@class NSTableColumn;
@class NSTableHeaderView;
@class NSText;
@ -72,8 +73,8 @@ enum {
int _clickedRow;
int _clickedColumn;
NSTableColumn *_highlightedTableColumn;
NSMutableArray *_selectedColumns;
NSMutableArray *_selectedRows;
NSMutableIndexSet *_selectedColumns;
NSMutableIndexSet *_selectedRows;
int _selectedColumn;
int _selectedRow;
BOOL _allowsMultipleSelection;

View file

@ -31,6 +31,7 @@
#include <Foundation/NSArray.h>
#include <Foundation/NSException.h>
#include <Foundation/NSIndexSet.h>
#include <Foundation/NSMapTable.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSNull.h>
@ -350,7 +351,7 @@ static NSImage *unexpandable = nil;
if([self isExpandable: item] && [self isItemExpanded: item] && canCollapse)
{
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
int i, count, row;
unsigned int row;
[infoDict setObject: item forKey: @"NSObject"];
@ -362,16 +363,14 @@ static NSImage *unexpandable = nil;
// We save the selection
[_selectedItems removeAllObjects];
count = [_selectedRows count];
for (i = 0; i < count; i++)
{
row = [[_selectedRows objectAtIndex: i] intValue];
row = [_selectedRows firstIndex];
while (row != NSNotFound)
{
if ([self itemAtRow: row])
{
[_selectedItems addObject: [self itemAtRow: row]];
}
row = [_selectedRows indexGreaterThanIndex: row];
}
// collapse...
@ -439,7 +438,7 @@ static NSImage *unexpandable = nil;
if(![self isItemExpanded: item] && canExpand)
{
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
int i, count, row;
unsigned int row;
[infoDict setObject: item forKey: @"NSObject"];
@ -451,16 +450,14 @@ static NSImage *unexpandable = nil;
// We save the selection
[_selectedItems removeAllObjects];
count = [_selectedRows count];
for (i = 0; i < count; i++)
row = [_selectedRows firstIndex];
while (row != NSNotFound)
{
row = [[_selectedRows objectAtIndex: i] intValue];
if ([self itemAtRow: row])
{
{
[_selectedItems addObject: [self itemAtRow: row]];
}
row = [_selectedRows indexGreaterThanIndex: row];
}
// insert the root element, if necessary otherwise insert the
@ -745,7 +742,7 @@ static NSImage *unexpandable = nil;
int i, count, row;
/* We restore the selection */
[_selectedRows removeAllObjects];
[_selectedRows removeAllIndexes];
count = [_selectedItems count];
for (i = 0; i < count; i++)
@ -754,7 +751,7 @@ static NSImage *unexpandable = nil;
if (row >= 0 && row < _numberOfRows)
{
[_selectedRows addObject: [NSNumber numberWithInt: row]];
[_selectedRows addIndex: row];
}
}
}

File diff suppressed because it is too large Load diff