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,25 +11,31 @@
@implementation RoundBackgroundField
- (void)awakeFromNib
- (id)initWithCoder:(NSCoder *)decoder
{
id cell = [[RoundBackgroundCell alloc] init];
id oldcell = [self cell];
self = [super initWithCoder:decoder];
if (self)
{
id cell = [[RoundBackgroundCell alloc] init];
id oldcell = [self cell];
[cell setBackgroundColor: [self backgroundColor]];
[cell setDrawsBackground: NO];
[cell setScrollable:[oldcell isScrollable]];
[cell setAlignment:[oldcell alignment]];
[cell setLineBreakMode:[oldcell lineBreakMode]];
[cell setAction: [oldcell action]];
[cell setTarget: [oldcell target]];
[cell setStringValue: [oldcell stringValue]];
[self setCell: cell];
[cell release];
}
[cell setBackgroundColor: [self backgroundColor]];
[cell setDrawsBackground: NO];
[cell setScrollable:[oldcell isScrollable]];
[cell setAlignment:[oldcell alignment]];
[cell setLineBreakMode:[oldcell lineBreakMode]];
[cell setAction: [oldcell action]];
[cell setTarget: [oldcell target]];
[cell setStringValue: [oldcell stringValue]];
[self setCell: cell];
[cell release];
return self;
}
@end

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<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>
<dict>
<key>29</key>
@ -28,9 +28,9 @@
<integer>3</integer>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
<integer>513</integer>
<integer>29</integer>
<integer>823</integer>
</array>
<key>IBSystem Version</key>

Binary file not shown.

View File

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

View File

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

View File

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