-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSidebarController.j
More file actions
38 lines (33 loc) · 1.25 KB
/
SidebarController.j
File metadata and controls
38 lines (33 loc) · 1.25 KB
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
// (c) 2010-2011 by Anton Korenyushkin
@import "BufferManager.j"
@import "NavigatorController.j"
@import "WorkspaceController.j"
@implementation SidebarController : CPObject
{
CPView superview;
CPSplitView splitView;
}
- (id)initWithApp:(App)app view:(CPView)aSuperview // public
{
if (self = [super init]) {
superview = aSuperview;
splitView = [[CPSplitView alloc] initWithFrame:[superview bounds]];
[splitView setVertical:NO];
[splitView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
var workspaceView = [CPView new];
[splitView addSubview:workspaceView];
var navigatorView = [CPView new];
[splitView addSubview:navigatorView];
[splitView setPosition:[superview boundsSize].height * 0.3 ofDividerAtIndex:0];
var bufferManager = [[BufferManager alloc] initWithApp:app];
app.navigatorController = [[NavigatorController alloc] initWithApp:app view:navigatorView bufferManager:bufferManager];
app.workspaceController = [[WorkspaceController alloc] initWithApp:app view:workspaceView bufferManager:bufferManager];
}
return self;
}
- (void)show // public
{
[splitView setFrame:[superview bounds]];
[superview addSubview:splitView];
}
@end