UI changes

CQTexperiment
vspader 2006-04-29 00:03:28 +00:00
parent 307c3fce7b
commit 15139ac8d5
6 changed files with 45 additions and 29 deletions

View File

@ -11,8 +11,11 @@
@implementation RoundBackgroundField @implementation RoundBackgroundField
- (void)awakeFromNib - (id)initWithCoder:(NSCoder *)decoder
{ {
self = [super initWithCoder:decoder];
if (self)
{
id cell = [[RoundBackgroundCell alloc] init]; id cell = [[RoundBackgroundCell alloc] init];
id oldcell = [self cell]; id oldcell = [self cell];
@ -30,6 +33,9 @@
[self setCell: cell]; [self setCell: cell];
[cell release]; [cell release];
}
return self;
} }
@end @end

View File

@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>42 324 617 240 0 0 1024 746 </string> <string>273 33 617 240 0 0 1024 746 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>29</key> <key>29</key>
@ -28,9 +28,9 @@
<integer>3</integer> <integer>3</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>29</integer>
<integer>21</integer> <integer>21</integer>
<integer>513</integer> <integer>513</integer>
<integer>29</integer>
<integer>823</integer> <integer>823</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>

Binary file not shown.

View File

@ -9,7 +9,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
- (void)awakeFromNib - (void)awakeFromNib
{ {
// register for drag and drop // register for drag and drop
// DBLog(@"AWOKE"); NSLog(@"AWOKE");
[tableView registerForDraggedTypes:[NSArray arrayWithObjects:MovedRowsType, NSFilenamesPboardType, nil]]; [tableView registerForDraggedTypes:[NSArray arrayWithObjects:MovedRowsType, NSFilenamesPboardType, nil]];
// [tableView setVerticalMotionCanBeginDrag:YES]; // [tableView setVerticalMotionCanBeginDrag:YES];
// [tableView setAllowsMultipleSelection:NO]; // [tableView setAllowsMultipleSelection:NO];
@ -22,7 +22,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
writeRows:(NSArray*)rows writeRows:(NSArray*)rows
toPasteboard:(NSPasteboard*)pboard toPasteboard:(NSPasteboard*)pboard
{ {
// DBLog(@"WRITE ROWS"); NSLog(@"WRITE ROWS");
NSData *data; NSData *data;
data = [NSKeyedArchiver archivedDataWithRootObject:rows]; data = [NSKeyedArchiver archivedDataWithRootObject:rows];
@ -41,7 +41,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
{ {
NSDragOperation dragOp = NSDragOperationCopy; NSDragOperation dragOp = NSDragOperationCopy;
// DBLog(@"VALIDATING"); NSLog(@"VALIDATING");
if ([info draggingSource] == tv) if ([info draggingSource] == tv)
dragOp = NSDragOperationMove; dragOp = NSDragOperationMove;
@ -62,7 +62,7 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
{ {
row = 0; row = 0;
} }
// DBLog(@"ACCEPTATING"); NSLog(@"ACCEPTATING");
// if drag source is self, it's a move // if drag source is self, it's a move
if ([info draggingSource] == tableView) if ([info draggingSource] == tableView)
{ {

View File

@ -158,13 +158,20 @@
return acceptableFileTypes; return acceptableFileTypes;
} }
- (void)tableView:(NSTableView *)tableView
didClickTableColumn:(NSTableColumn *)tableColumn
{
NSLog(@"SORTING");
[self updateIndexesFromRow:0];
}
- (BOOL)tableView:(NSTableView*)tv - (BOOL)tableView:(NSTableView*)tv
acceptDrop:(id <NSDraggingInfo>)info acceptDrop:(id <NSDraggingInfo>)info
row:(int)row row:(int)row
dropOperation:(NSTableViewDropOperation)op dropOperation:(NSTableViewDropOperation)op
{ {
int i; int i;
NSLog(@"DRAGGING?");
[super tableView:tv acceptDrop:info row:row dropOperation:op]; [super tableView:tv acceptDrop:info row:row dropOperation:op];
if ([info draggingSource] == tableView) if ([info draggingSource] == tableView)
{ {
@ -183,6 +190,7 @@
i = firstIndex; i = firstIndex;
} }
NSLog(@"Updating indexes: %i", i);
[self updateIndexesFromRow:i]; [self updateIndexesFromRow:i];
return YES; return YES;
@ -207,7 +215,7 @@
{ {
double tt=0; double tt=0;
NSEnumerator *enumerator = [[self content] objectEnumerator]; NSEnumerator *enumerator = [[self arrangedObjects] objectEnumerator];
PlaylistEntry* pe; PlaylistEntry* pe;
while (pe = [enumerator nextObject]) { while (pe = [enumerator nextObject]) {
@ -238,10 +246,10 @@
{ {
// DBLog(@"UPDATE INDEXES: %i", row); // DBLog(@"UPDATE INDEXES: %i", row);
int j; int j;
for (j = row; j < [[self content] count]; j++) for (j = row; j < [[self arrangedObjects] count]; j++)
{ {
PlaylistEntry *p; PlaylistEntry *p;
p = [[self content] objectAtIndex:j]; p = [[self arrangedObjects] objectAtIndex:j];
[p setIndex:j]; [p setIndex:j];
} }

View File

@ -27,6 +27,8 @@
[[c dataCell] setControlSize:s]; [[c dataCell] setControlSize:s];
[[c dataCell] setFont:f]; [[c dataCell] setFont:f];
} }
[self setVerticalMotionCanBeginDrag:YES];
} }
- (BOOL)acceptsFirstResponder - (BOOL)acceptsFirstResponder
@ -45,14 +47,14 @@
- (void)mouseDown:(NSEvent *)e - (void)mouseDown:(NSEvent *)e
{ {
// DBLog(@"MOUSE DOWN"); NSLog(@"MOUSE DOWN");
if ([e type] == NSLeftMouseDown && [e clickCount] == 2) if ([e type] == NSLeftMouseDown && [e clickCount] == 2)
{ {
[playbackController play:self]; [playbackController play:self];
} }
else else
{ {
// DBLog(@"Super"); NSLog(@"Super");
[super mouseDown:e]; [super mouseDown:e];
} }
} }