Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /XspfManager/XspfMCoverFlowViewController.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 283 - (hide annotations) (download)
Thu Jan 28 15:06:50 2010 UTC (14 years, 2 months ago) by masaki
File size: 2150 byte(s)
[Fix] 引数がnilである時の処理がおかしかったので修正。
1 masaki 281 //
2     // XspfMCoverFlowViewController.m
3     // XspfManager
4     //
5     // Created by Hori,Masaki on 10/01/21.
6     // Copyright 2010 masakih. All rights reserved.
7     //
8    
9     #import "XspfMCoverFlowViewController.h"
10    
11     #import "MBCoverFlowView.h"
12     #import "XspfMListViewController.h"
13     #import "XspfMCoverFlowAccessoryViewController.h"
14    
15     #import "XspfMDragControl.h"
16    
17    
18     @implementation XspfMCoverFlowViewController
19    
20     - (id)init
21     {
22     self = [super initWithNibName:@"XspfMCoverFlowView" bundle:nil];
23    
24     return self;
25     }
26    
27     - (void)awakeFromNib
28     {
29     NSArrayController *rep = [self representedObject];
30    
31     coverFlow.imageKeyPath = @"thumbnail";
32     coverFlow.showsScrollbar = YES;
33    
34     [dragControl setDrawsBackground:NO];
35     [dragControl setDragPosition:NSImageAlignCenter];
36     [dragControl setVertical:NO];
37    
38     listViewController = [[XspfMListViewController alloc] init];
39     [listViewController view];
40     [listViewController setRepresentedObject:rep];
41     [listViewController recalculateKeyViewLoop];
42     [listPlaceHolder addSubview:[listViewController view]];
43     [[listViewController view] setFrame:[listPlaceHolder bounds]];
44     [self recalculateKeyViewLoop];
45    
46     accessoryController = [[XspfMCoverFlowAccessoryViewController alloc] init];
47     [accessoryController setXspfMDragControlDelegate:self];
48     coverFlow.dragControl = [accessoryController dragControl];
49     coverFlow.accessoryController = accessoryController;
50     }
51    
52     - (void)setRepresentedObject:(id)representedObject
53     {
54     [super setRepresentedObject:representedObject];
55 masaki 283 [listViewController setRepresentedObject:representedObject];
56 masaki 281
57     if(representedObject) {
58 masaki 283 coverFlow.itemSize = NSMakeSize(200, 150);
59 masaki 281 [coverFlow bind:@"content" toObject:representedObject withKeyPath:@"arrangedObjects" options:nil];
60     [coverFlow bind:@"selectionIndex" toObject:representedObject withKeyPath:@"selectionIndex" options:nil];
61 masaki 283 } else {
62     [coverFlow unbind:@"content"];
63     [coverFlow unbind:@"selectionIndex"];
64 masaki 281 }
65     }
66    
67     - (void)dragControl:(XspfMDragControl *)control dragDelta:(NSSize)delta
68     {
69     HMLog(HMLogLevelDebug, @"Enter %@", NSStringFromSelector(_cmd));
70    
71     CGFloat libWidth = [coverFlow frame].size.height;
72     [splitView setPosition:libWidth - delta.height ofDividerAtIndex:0];
73     }
74    
75    
76     @end

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26