-
Notifications
You must be signed in to change notification settings - Fork 4
/
InspectorPaneIntegration.m
62 lines (47 loc) · 1.69 KB
/
InspectorPaneIntegration.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// InspectorPaneView.m
// InspectorPane
//
// Created by Steven on 3/7/09.
// Copyright 2009 Thoughtful Tree Software. All rights reserved.
//
#import <InterfaceBuilderKit/InterfaceBuilderKit.h>
#import <InspectorKit/InspectorPane.h>
#import "InspectorPaneInspector.h"
@implementation InspectorPane ( InspectorPane )
- (void)ibPopulateKeyPaths:(NSMutableDictionary *)keyPaths {
[super ibPopulateKeyPaths:keyPaths];
[[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray:
[NSArray arrayWithObjects:@"resizable", @"minHeight", @"maxHeight", @"titleTextField.stringValue", nil]];
}
- (void)ibPopulateAttributeInspectorClasses:(NSMutableArray *)classes {
[super ibPopulateAttributeInspectorClasses:classes];
[classes addObject:[InspectorPaneInspector class]];
}
- (NSView *)ibDesignableContentView {
return (NSView*)paneBody;
}
- (id) init {
NSArray *topLevelObjects;
NSNib *nib = [[[NSNib alloc] initWithNibNamed:@"InspectorLibrary" bundle:[NSBundle bundleForClass:[InspectorPaneInspector class]]] autorelease];
[nib instantiateNibWithOwner:nil topLevelObjects:&topLevelObjects];
for (id object in topLevelObjects) {
if ([object isKindOfClass:[NSView class]]) {
for (NSView *subview in [object subviews]) {
if ([subview isKindOfClass:[InspectorPane class]]) {
NSData *viewData = [NSKeyedArchiver archivedDataWithRootObject:subview];
InspectorPane *pane = [NSKeyedUnarchiver unarchiveObjectWithData:viewData];
NSLog(@"%@", pane);
[pane setFrame:NSMakeRect(0, 0, 100, 100)];
return [pane retain];
}
}
}
}
return nil;
}
// no idea what this is
//- (IBDirection) ibPreferredResizeDirection {
// return IBMaxYDirection;
//}
@end