mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 09:41:07 +00:00
Reverted changes of previous commit to rollback unintentional reformatting of code in the files NSTableView.m and NSOutlineView.m.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36044 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
10ad99f43f
commit
fe5d19ee8e
2 changed files with 6704 additions and 6786 deletions
|
@ -1526,7 +1526,6 @@ namesOfPromisedFilesDroppedAtDestination: dropDestination
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Autosave methods...
|
// Autosave methods...
|
||||||
- (void) setAutosaveName: (NSString *)name
|
- (void) setAutosaveName: (NSString *)name
|
||||||
{
|
{
|
||||||
|
@ -2266,25 +2265,6 @@ namesOfPromisedFilesDroppedAtDestination: dropDestination
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is used to build the drag image.
|
|
||||||
- (NSString *) _objectStringForTableColum:(NSTableColumn *)column item:(int)row {
|
|
||||||
NSString *draggedItemString = nil;
|
|
||||||
if ([[self dataSource] respondsToSelector:@selector(outlineView:objectValueForTableColumn:byItem:)]) {
|
|
||||||
id item = [self itemAtRow:row];
|
|
||||||
id draggedObject = [[self dataSource] outlineView:self
|
|
||||||
objectValueForTableColumn:column
|
|
||||||
byItem:item];
|
|
||||||
|
|
||||||
// Pad the string to match its indentation level:
|
|
||||||
int level = [self levelForRow:row];
|
|
||||||
NSString *pad = [@"" stringByPaddingToLength:(level*4)
|
|
||||||
withString:@" "
|
|
||||||
startingAtIndex:0];
|
|
||||||
draggedItemString = [pad stringByAppendingString:[draggedObject description]];
|
|
||||||
}
|
|
||||||
return draggedItemString;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSOutlineView (Private)
|
@implementation NSOutlineView (Private)
|
||||||
|
@ -2302,5 +2282,4 @@ namesOfPromisedFilesDroppedAtDestination: dropDestination
|
||||||
}
|
}
|
||||||
[autoExpanded removeAllObjects];
|
[autoExpanded removeAllObjects];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -68,8 +68,6 @@
|
||||||
#import "AppKit/NSCustomImageRep.h"
|
#import "AppKit/NSCustomImageRep.h"
|
||||||
#import "GNUstepGUI/GSTheme.h"
|
#import "GNUstepGUI/GSTheme.h"
|
||||||
#import "GSBindingHelpers.h"
|
#import "GSBindingHelpers.h"
|
||||||
#import "AppKit/NSAttributedString.h"
|
|
||||||
#import "AppKit/NSStringDrawing.h"
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
static NSNotificationCenter *nc = nil;
|
static NSNotificationCenter *nc = nil;
|
||||||
|
@ -1986,8 +1984,6 @@ static void computeNewSelection
|
||||||
- (void) _autoloadTableColumns;
|
- (void) _autoloadTableColumns;
|
||||||
- (NSCell *) _dataCellForTableColumn: (NSTableColumn *)tb
|
- (NSCell *) _dataCellForTableColumn: (NSTableColumn *)tb
|
||||||
row: (int) rowIndex;
|
row: (int) rowIndex;
|
||||||
- (NSString *) _objectStringForTableColum:(NSTableColumn *)column item:(int)row;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -5341,10 +5337,6 @@ name: NSTableView##notif_name##Notification object: self]
|
||||||
event: (NSEvent*)event
|
event: (NSEvent*)event
|
||||||
offset: (NSPoint*)offset
|
offset: (NSPoint*)offset
|
||||||
{
|
{
|
||||||
if (!cols && ([self tableColumns]) && ([[self tableColumns] count] > 0)) {
|
|
||||||
cols = [NSArray arrayWithObject:[[self tableColumns] objectAtIndex:0]];
|
|
||||||
}
|
|
||||||
if (!rows || [rows count] < 1 || !cols || [cols count] < 1) {
|
|
||||||
// FIXME
|
// FIXME
|
||||||
NSArray *rowArray;
|
NSArray *rowArray;
|
||||||
|
|
||||||
|
@ -5354,46 +5346,6 @@ name: NSTableView##notif_name##Notification object: self]
|
||||||
dragImageOffset: offset];
|
dragImageOffset: offset];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build a string of texts, each representing a line from the tableView,
|
|
||||||
// separated by "\n":
|
|
||||||
NSString *descriptionsList = nil;
|
|
||||||
unsigned int index = [rows firstIndex];
|
|
||||||
while (index != NSNotFound) {
|
|
||||||
NSString *draggedItemString = [self _objectStringForTableColum:[cols objectAtIndex:0]
|
|
||||||
item:index];
|
|
||||||
if (!descriptionsList) {
|
|
||||||
descriptionsList = [NSMutableString stringWithString:draggedItemString];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
descriptionsList = [descriptionsList stringByAppendingFormat:@"\n%@", draggedItemString];
|
|
||||||
}
|
|
||||||
index = [rows indexGreaterThanIndex:index];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NSAttributedString *attributedString = [[[NSAttributedString alloc] initWithString:descriptionsList] autorelease];
|
|
||||||
|
|
||||||
NSSize boxSize = [attributedString size];
|
|
||||||
NSRect rect = NSMakeRect(0.0, 0.0, boxSize.width, boxSize.height);
|
|
||||||
NSImage *image = [[NSImage alloc] initWithSize:boxSize];
|
|
||||||
NSColor *bg = [NSColor whiteColor];
|
|
||||||
|
|
||||||
|
|
||||||
[image lockFocus];
|
|
||||||
// Filling with white color for now, transparent is showing as blackColor.
|
|
||||||
[bg set];
|
|
||||||
NSRectFill(rect);
|
|
||||||
[attributedString drawInRect:rect];
|
|
||||||
[image unlockFocus];
|
|
||||||
|
|
||||||
// Offset the image so it sits neatly next to the mouse cursor.
|
|
||||||
// Note: Cocoa actually offsets the image to position of the mouse down.
|
|
||||||
offset->x = (boxSize.width / 2) + 5;
|
|
||||||
offset->y = (boxSize.height / -2) + 5;
|
|
||||||
|
|
||||||
return [image autorelease];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setDropRow: (int)row
|
- (void) setDropRow: (int)row
|
||||||
dropOperation: (NSTableViewDropOperation)operation
|
dropOperation: (NSTableViewDropOperation)operation
|
||||||
{
|
{
|
||||||
|
@ -6101,19 +6053,6 @@ mouseDownInHeaderOfTableColumn: tc];
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) _objectStringForTableColum:(NSTableColumn *)column item:(int)row
|
|
||||||
{
|
|
||||||
NSString *draggedItemString = nil;
|
|
||||||
if ([_dataSource respondsToSelector:@selector(tableView:objectValueForTableColumn:byItem:)]) {
|
|
||||||
id draggedObject = [_dataSource tableView:self
|
|
||||||
objectValueForTableColumn:column
|
|
||||||
row:row];
|
|
||||||
|
|
||||||
draggedItemString = [draggedObject description];
|
|
||||||
}
|
|
||||||
return draggedItemString;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) superviewFrameChanged: (NSNotification*)aNotification
|
- (void) superviewFrameChanged: (NSNotification*)aNotification
|
||||||
{
|
{
|
||||||
if (_autoresizesAllColumnsToFit == YES)
|
if (_autoresizesAllColumnsToFit == YES)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue