Added -columnIndexesInRect: and updated documentation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29175 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Quentin Mathe 2009-12-27 16:05:48 +00:00
parent d831e0a199
commit c444ae92d2
3 changed files with 38 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2009-12-27 Quentin Mathe <quentin.mathe@gmail.com>
* Headers/NSTableView.h
* Source/NSTableView.m
(-columnIndexesInRect:): Added new Mac OS 10.5 method.
2009-12-26 Riccardo Mottola <rmottola@users.sf.net>
* Source/NSTextView.m: Corrected multi-line string constant
@ -59,7 +65,6 @@
allowsOtherFileTypes attribute to its default when a fresh save
panel is requested.
>>>>>>> .r29159
2009-12-21 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSIconManager.h,

View file

@ -237,6 +237,9 @@ typedef enum _NSTableViewColumnAutoresizingStyle
/* Layout */
- (NSRect) rectOfColumn: (int)columnIndex;
- (NSRect) rectOfRow: (int)rowIndex;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSIndexSet *) columnIndexesInRect: (NSRect)aRect;
#endif
- (NSRange) columnsInRect: (NSRect)aRect;
- (NSRange) rowsInRect: (NSRect)aRect;
- (int) columnAtPoint: (NSPoint)aPoint;

View file

@ -4278,6 +4278,35 @@ static BOOL selectContiguousRegion(NSTableView *self,
return rect;
}
/** Returns the indexes of the table columns which intersects the given rect.
The rect is expressed in the receiver coordinate space.
Hidden table columns are never tested. */
- (NSIndexSet *) columnIndexesInRect: (NSRect)aRect
{
NSRange range = [self columnsInRect: aRect];
NSMutableIndexSet *indexes = [NSMutableIndexSet indexSetWithIndexesInRange: range];
int i;
for (i = range.location; i < range.length; i++)
{
NSTableColumn *tableColumn = [_tableColumns objectAtIndex: i];
if ([tableColumn isHidden])
[indexes removeIndex: i];
}
return indexes;
}
/** Returns the index range of the table columns which intersects the given rect.
The rect is expressed in the receiver coordinate space.
The returned range can include hidden table column indexes.
This method is deprecated, use -columnIndexesInRect:. */
- (NSRange) columnsInRect: (NSRect)aRect
{
NSRange range;