Source/NSTableView.m

Source/NSTableColumn.m


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13269 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
pyr 2002-03-29 16:04:24 +00:00
parent 8220303b86
commit 34d93685c8
3 changed files with 99 additions and 16 deletions

View file

@ -48,7 +48,7 @@
#include <math.h>
static NSNotificationCenter *nc = nil;
static const int currentVersion = 2;
static const int currentVersion = 3;
static NSRect oldDraggingRect;
static int oldDropRow;
@ -2227,7 +2227,7 @@ static void computeNewSelection
if (((pos = [_selectedRows
indexOfObject:
[NSNumber numberWithInt: i]])
!= NSNotFound) && (count > 0))
!= NSNotFound) && (count > 1))
{
[tv setNeedsDisplayInRect:
[tv rectOfRow: i]];
@ -2261,7 +2261,7 @@ static void computeNewSelection
if (((pos = [_selectedRows
indexOfObject:
[NSNumber numberWithInt: i]])
!= NSNotFound) && (count > 0))
!= NSNotFound) && (count > 1))
{
[tv setNeedsDisplayInRect:
[tv rectOfRow: i]];
@ -6320,6 +6320,7 @@ byExtendingSelection: (BOOL)flag
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnSelection];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnResizing];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnReordering];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoresizesAllColumnsToFit];
}
@ -6352,6 +6353,55 @@ byExtendingSelection: (BOOL)flag
[aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfRows];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfColumns];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_drawsGrid];
[aDecoder decodeValueOfObjCType: @encode(float) at: &_rowHeight];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_doubleAction];
_intercellSpacing = [aDecoder decodeSize];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnSelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnResizing];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnReordering];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_autoresizesAllColumnsToFit];
ASSIGN (_selectedColumns, [NSMutableArray array]);
ASSIGN (_selectedRows, [NSMutableArray array]);
if (_numberOfColumns)
_columnOrigins = NSZoneMalloc (NSDefaultMallocZone (),
sizeof(float) * _numberOfColumns);
_clickedRow = -1;
_clickedColumn = -1;
_selectingColumns = NO;
_selectedColumn = -1;
_selectedRow = -1;
_editedColumn = -1;
_editedRow = -1;
[self tile];
}
else if (version == 2)
{
self = [super initWithCoder: aDecoder];
_dataSource = [aDecoder decodeObject];
_tableColumns = RETAIN([aDecoder decodeObject]);
_gridColor = RETAIN([aDecoder decodeObject]);
_backgroundColor = RETAIN([aDecoder decodeObject]);
_headerView = RETAIN([aDecoder decodeObject]);
_cornerView = RETAIN([aDecoder decodeObject]);
aDelegate = [aDecoder decodeObject];
_target = [aDecoder decodeObject];
[self setDelegate: aDelegate];
[_headerView setTableView: self];
[_tableColumns makeObjectsPerformSelector: @selector(setTableView:)
withObject: self];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfRows];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfColumns];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_drawsGrid];
[aDecoder decodeValueOfObjCType: @encode(float) at: &_rowHeight];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_doubleAction];