Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /XspfManager/XspfMCollectionViewController.m

Parent Directory Parent Directory | Revision Log Revision Log


Revision 304 - (hide annotations) (download)
Thu Feb 4 14:27:49 2010 UTC (14 years, 2 months ago) by masaki
File size: 1894 byte(s)
[Mod] QLPreviewPanelの表示/非表示時の動きを最適化。
1 masaki 16 //
2     // XspfMCollectionViewController.m
3     // XspfManager
4     //
5     // Created by Hori,Masaki on 09/11/05.
6     // Copyright 2009 masakih. All rights reserved.
7     //
8    
9     #import "XspfMCollectionViewController.h"
10    
11 masaki 304 #import "XspfMCollectionView.h"
12 masaki 175 #import "XspfMCollectionViewItem.h"
13 masaki 238 #import "XspfMXspfObject.h"
14 masaki 16
15 masaki 175
16 masaki 16 @implementation XspfMCollectionViewController
17    
18     - (id)init
19     {
20     [super initWithNibName:@"CollectionView" bundle:nil];
21    
22     return self;
23     }
24    
25 masaki 82 - (void)awakeFromNib
26     {
27     NSView *view = [collectionViewItem view];
28    
29     [scrollView setVerticalLineScroll:[view frame].size.height];
30     }
31    
32 masaki 190 - (void)setCollectionItem:(XspfMCollectionViewItem *)newItem
33 masaki 175 {
34     [collectionView setItemPrototype:newItem];
35     NSSize viewSize = [[newItem view] frame].size;
36     [collectionView setMinItemSize:viewSize];
37     [collectionView setMaxItemSize:viewSize];
38     [scrollView setVerticalLineScroll:viewSize.height];
39 masaki 190 collectionViewItem = newItem;
40 masaki 175 }
41 masaki 229
42     - (IBAction)changeLabel:(id)sender
43     {
44 masaki 238 XspfMXspfObject *object = [sender representedObject];
45 masaki 229 object.label = [sender objectValue];
46     }
47    
48 masaki 175 - (IBAction)collectionViewItemViewRegular:(id)sender
49     {
50     [self setCollectionItem:regularItem];
51     }
52     - (IBAction)collectionViewItemViewSmall:(id)sender
53     {
54     [self setCollectionItem:smallItem];
55     }
56    
57 masaki 190 - (XspfMCollectionItemType)collectionItemType
58     {
59     if(collectionViewItem == regularItem) return typeXspfMRegularItem;
60     if(collectionViewItem == smallItem) return typeXSpfMSmallItem;
61    
62     return typeXspfMUnknownItem;
63     }
64    
65 masaki 16 #pragma mark#### XspfMCollectionView Delegate ####
66     - (void)enterAction:(XspfMCollectionView *)view
67     {
68 masaki 74 [NSApp sendAction:@selector(openXspf:) to:nil from:self];
69 masaki 16 }
70    
71 masaki 304 // QLPreviewPanel support
72     - (NSRect)selectionItemRect
73     {
74     id item = [collectionView itemAtIndex:[[self representedObject] selectionIndex]];
75     NSRect rect = [item thumbnailFrameCoordinateBase];
76     return rect;
77     }
78    
79 masaki 16 #pragma mark#### Test ####
80     - (void)test01:(id)sender
81     {
82 masaki 188 HMLog(HMLogLevelError, @"hoge");
83 masaki 16 }
84    
85    
86     @end

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