mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Add MacOS 10.4 methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25653 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3b67603dba
commit
74841fc8ad
3 changed files with 120 additions and 16 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-12-01 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSTableView.h
|
||||
* Source/NSTableView.m: Add MacOSX 10.4 methods.
|
||||
|
||||
2007-11-30 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSImage.m (-drawInRect:fromRect:operation:fraction:):
|
||||
|
|
|
@ -53,6 +53,18 @@ enum {
|
|||
NSTableViewSolidHorizontalGridLineMask = 2
|
||||
};
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
typedef enum _NSTableViewColumnAutoresizingStyle
|
||||
{
|
||||
NSTableViewNoColumnAutoresizing = 0,
|
||||
NSTableViewUniformColumnAutoresizingStyle,
|
||||
NSTableViewSequentialColumnAutoresizingStyle,
|
||||
NSTableViewReverseSequentialColumnAutoresizingStyle,
|
||||
NSTableViewLastColumnOnlyAutoresizingStyle,
|
||||
NSTableViewFirstColumnOnlyAutoresizingStyle
|
||||
} NSTableViewColumnAutoresizingStyle;
|
||||
#endif
|
||||
|
||||
@interface NSTableView : NSControl <NSUserInterfaceValidations>
|
||||
{
|
||||
/*
|
||||
|
@ -122,7 +134,10 @@ enum {
|
|||
computations on sizes so we ignore tile (produced for example by
|
||||
the NSTableColumns) during the computation. We perform a global
|
||||
tile at the end */
|
||||
BOOL _tilingDisabled;
|
||||
BOOL _tilingDisabled;
|
||||
|
||||
unsigned int _draggingSourceOperationMaskForLocal;
|
||||
unsigned int _draggingSourceOperationMaskForRemote;
|
||||
}
|
||||
|
||||
/* Data Source */
|
||||
|
@ -157,8 +172,10 @@ enum {
|
|||
- (float) rowHeight;
|
||||
- (void) setBackgroundColor: (NSColor *)aColor;
|
||||
- (NSColor *) backgroundColor;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (void) setUsesAlternatingRowBackgroundColors: (BOOL)useAlternatingRowColors;
|
||||
- (BOOL) usesAlternatingRowBackgroundColors;
|
||||
#endif
|
||||
|
||||
/* Columns */
|
||||
- (void) addTableColumn: (NSTableColumn *)aColumn;
|
||||
|
@ -197,15 +214,17 @@ enum {
|
|||
- (BOOL) drawsGrid;
|
||||
- (void) setGridColor: (NSColor *)aColor;
|
||||
- (NSColor *) gridColor;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (void) setGridStyleMask: (unsigned int)gridType;
|
||||
- (unsigned int) gridStyleMask;
|
||||
#endif
|
||||
|
||||
/* Editing Cells */
|
||||
/* ALL TODOS */
|
||||
- (void) editColumn: (int)columnIndex
|
||||
row: (int)rowIndex
|
||||
withEvent: (NSEvent *)theEvent
|
||||
select: (BOOL)flag;
|
||||
row: (int)rowIndex
|
||||
withEvent: (NSEvent *)theEvent
|
||||
select: (BOOL)flag;
|
||||
- (int) editedRow;
|
||||
- (int) editedColumn;
|
||||
|
||||
|
@ -229,12 +248,19 @@ enum {
|
|||
- (void) sizeLastColumnToFit;
|
||||
- (void) noteNumberOfRowsChanged;
|
||||
- (void) tile;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (NSTableViewColumnAutoresizingStyle) columnAutoresizingStyle;
|
||||
- (void) setColumnAutoresizingStyle: (NSTableViewColumnAutoresizingStyle)style;
|
||||
- (void) noteHeightOfRowsWithIndexesChanged: (NSIndexSet*)indexes;
|
||||
#endif
|
||||
|
||||
/* Drawing */
|
||||
- (void) drawRow: (int)rowIndex clipRect: (NSRect)clipRect;
|
||||
- (void) drawGridInClipRect: (NSRect)aRect;
|
||||
- (void) highlightSelectionInClipRect: (NSRect)clipRect;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
|
||||
- (void) drawBackgroundInClipRect: (NSRect)clipRect;
|
||||
#endif
|
||||
|
||||
/* Scrolling */
|
||||
- (void) scrollRowToVisible: (int)rowIndex;
|
||||
|
@ -271,12 +297,22 @@ enum {
|
|||
/* dragging rows */
|
||||
/* NB: ALL TODOS */
|
||||
- (NSImage*) dragImageForRows: (NSArray*)dragRows
|
||||
event: (NSEvent*)dragEvent
|
||||
dragImageOffset: (NSPoint*)dragImageOffset;
|
||||
event: (NSEvent*)dragEvent
|
||||
dragImageOffset: (NSPoint*)dragImageOffset;
|
||||
- (void) setDropRow: (int)row
|
||||
dropOperation: (NSTableViewDropOperation)operation;
|
||||
- (void) setVerticalMotionCanBeginDrag: (BOOL)flag;
|
||||
- (BOOL) verticalMotionCanBeginDrag;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (BOOL) canDragRowsWithIndexes: (NSIndexSet*)indexes
|
||||
atPoint: (NSPoint)point;
|
||||
- (NSImage *) dragImageForRowsWithIndexes: (NSIndexSet*)rows
|
||||
tableColumns: (NSArray*)cols
|
||||
event: (NSEvent*)event
|
||||
offset: (NSPoint*)offset;
|
||||
- (void) setDraggingSourceOperationMask: (unsigned int)mask
|
||||
forLocal: (BOOL)isLocal;
|
||||
#endif
|
||||
|
||||
/* sorting */
|
||||
- (void) setSortDescriptors: (NSArray *)array;
|
||||
|
@ -307,15 +343,15 @@ objectValueForTableColumn: (NSTableColumn *)aTableColumn
|
|||
|
||||
/* Dragging */
|
||||
- (BOOL) tableView: (NSTableView*)tableView
|
||||
acceptDrop: (id <NSDraggingInfo>)info
|
||||
row: (int)row
|
||||
acceptDrop: (id <NSDraggingInfo>)info
|
||||
row: (int)row
|
||||
dropOperation: (NSTableViewDropOperation)operation;
|
||||
- (NSDragOperation) tableView: (NSTableView*)tableView
|
||||
validateDrop: (id <NSDraggingInfo>)info
|
||||
proposedRow: (int)row
|
||||
validateDrop: (id <NSDraggingInfo>)info
|
||||
proposedRow: (int)row
|
||||
proposedDropOperation: (NSTableViewDropOperation)operation;
|
||||
- (BOOL) tableView: (NSTableView *)tableView
|
||||
writeRows: (NSArray*)rows
|
||||
writeRows: (NSArray*)rows
|
||||
toPasteboard: (NSPasteboard*)pboard;
|
||||
@end
|
||||
|
||||
|
@ -352,7 +388,16 @@ shouldSelectTableColumn: (NSTableColumn *)aTableColumn;
|
|||
- (void) tableViewColumnDidResize: (NSNotification *)aNotification;
|
||||
- (void) tableViewSelectionDidChange: (NSNotification *)aNotification;
|
||||
- (void) tableViewSelectionIsChanging: (NSNotification *)aNotification;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
- (float) tableView: (NSTableView *)tableView
|
||||
heightOfRow: (int)row;
|
||||
- (NSString *) tableView: (NSTableView *)tableView
|
||||
toolTipForCell: (NSCell *)cell
|
||||
rect: (NSRect *)rect
|
||||
tableColumn: (NSTableColumn *)col
|
||||
row: (int)row
|
||||
mouseLocation: (NSPoint)mouse;
|
||||
#endif
|
||||
@end
|
||||
|
||||
#endif /* _GNUstep_H_NSTableView */
|
||||
|
|
|
@ -2002,6 +2002,8 @@ static void computeNewSelection
|
|||
_selectedColumn = -1;
|
||||
_selectedRow = -1;
|
||||
_highlightedTableColumn = nil;
|
||||
_draggingSourceOperationMaskForLocal = NSDragOperationAll;
|
||||
_draggingSourceOperationMaskForRemote = NSDragOperationAll;
|
||||
}
|
||||
|
||||
- (id) initWithFrame: (NSRect)frameRect
|
||||
|
@ -4400,6 +4402,17 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
return _autoresizesAllColumnsToFit;
|
||||
}
|
||||
|
||||
- (NSTableViewColumnAutoresizingStyle) columnAutoresizingStyle
|
||||
{
|
||||
// FIXME
|
||||
return NSTableViewNoColumnAutoresizing;
|
||||
}
|
||||
|
||||
- (void) setColumnAutoresizingStyle: (NSTableViewColumnAutoresizingStyle)style
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (void) sizeLastColumnToFit
|
||||
{
|
||||
if ((_super_view != nil) && (_numberOfColumns > 0))
|
||||
|
@ -4966,6 +4979,10 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
}
|
||||
}
|
||||
|
||||
- (void) noteHeightOfRowsWithIndexesChanged: (NSIndexSet*)indexes
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
- (void) drawGridInClipRect: (NSRect)aRect
|
||||
{
|
||||
|
@ -5492,10 +5509,22 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
|
||||
/* dragging rows */
|
||||
- (NSImage*) dragImageForRows: (NSArray*)dragRows
|
||||
event: (NSEvent*)dragEvent
|
||||
dragImageOffset: (NSPoint*)dragImageOffset
|
||||
event: (NSEvent*)dragEvent
|
||||
dragImageOffset: (NSPoint*)dragImageOffset
|
||||
{
|
||||
// FIXME
|
||||
NSImage *dragImage = [[NSImage alloc]
|
||||
initWithSize: NSMakeSize(8, 8)];
|
||||
|
||||
return AUTORELEASE(dragImage);
|
||||
}
|
||||
|
||||
- (NSImage *) dragImageForRowsWithIndexes: (NSIndexSet*)rows
|
||||
tableColumns: (NSArray*)cols
|
||||
event: (NSEvent*)event
|
||||
offset: (NSPoint*)offset;
|
||||
{
|
||||
// FIXME
|
||||
NSImage *dragImage = [[NSImage alloc]
|
||||
initWithSize: NSMakeSize(8, 8)];
|
||||
|
||||
|
@ -6139,11 +6168,30 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
}
|
||||
|
||||
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL) flag
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal
|
||||
{
|
||||
return (NSDragOperationAll);
|
||||
if (isLocal)
|
||||
{
|
||||
return _draggingSourceOperationMaskForLocal;
|
||||
}
|
||||
else
|
||||
{
|
||||
return _draggingSourceOperationMaskForRemote;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) setDraggingSourceOperationMask: (unsigned int)mask
|
||||
forLocal: (BOOL)isLocal
|
||||
{
|
||||
if (isLocal)
|
||||
{
|
||||
_draggingSourceOperationMaskForLocal = mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
_draggingSourceOperationMaskForRemote = mask;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender
|
||||
{
|
||||
|
@ -6344,6 +6392,12 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
{
|
||||
}
|
||||
|
||||
- (BOOL) canDragRowsWithIndexes: (NSIndexSet *)indexes
|
||||
atPoint: (NSPoint)point
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
/*
|
||||
* sorting
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue