Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /XspfManager/XspfMCoverFlowViewController.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 281 - (hide annotations) (download)
Tue Jan 26 12:10:30 2010 UTC (14 years, 2 months ago) by masaki
File size: 2129 byte(s)
[New] MBCoverFlowViewを使用。
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     if(rep) {
32     [coverFlow bind:@"content" toObject:rep withKeyPath:@"arrangedObjects" options:nil];
33     }
34     coverFlow.imageKeyPath = @"thumbnail";
35     coverFlow.showsScrollbar = YES;
36    
37     [dragControl setDrawsBackground:NO];
38     [dragControl setDragPosition:NSImageAlignCenter];
39     [dragControl setVertical:NO];
40    
41     listViewController = [[XspfMListViewController alloc] init];
42     [listViewController view];
43     [listViewController setRepresentedObject:rep];
44     [listViewController recalculateKeyViewLoop];
45    
46     [listPlaceHolder addSubview:[listViewController view]];
47     [[listViewController view] setFrame:[listPlaceHolder bounds]];
48     [self recalculateKeyViewLoop];
49    
50     accessoryController = [[XspfMCoverFlowAccessoryViewController alloc] init];
51     [accessoryController setXspfMDragControlDelegate:self];
52     coverFlow.dragControl = [accessoryController dragControl];
53     coverFlow.accessoryController = accessoryController;
54     }
55    
56     - (void)setRepresentedObject:(id)representedObject
57     {
58     [super setRepresentedObject:representedObject];
59    
60     if(representedObject) {
61     [coverFlow bind:@"content" toObject:representedObject withKeyPath:@"arrangedObjects" options:nil];
62     [coverFlow bind:@"selectionIndex" toObject:representedObject withKeyPath:@"selectionIndex" options:nil];
63    
64     [listViewController setRepresentedObject:representedObject];
65     }
66     }
67    
68     - (void)dragControl:(XspfMDragControl *)control dragDelta:(NSSize)delta
69     {
70     HMLog(HMLogLevelDebug, @"Enter %@", NSStringFromSelector(_cmd));
71    
72     CGFloat libWidth = [coverFlow frame].size.height;
73     [splitView setPosition:libWidth - delta.height ofDividerAtIndex:0];
74     }
75    
76    
77     @end

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