forked from pixmeo/osirix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKFSplitView.h
executable file
·71 lines (59 loc) · 2.51 KB
/
KFSplitView.h
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
63
64
65
66
67
68
69
70
//
// KFSplitView.h
// KFSplitView v. 1.3, 11/27/2004
//
// Copyright (c) 2003-2004 Ken Ferry. Some rights reserved.
// http://homepage.mac.com/kenferry/software.html
//
// This work is licensed under a Creative Commons license:
// http://creativecommons.org/licenses/by-nc/1.0/
//
// Send me an email if you have any problems (after you've read what there is to read).
//
// You can reach me at kenferry at the domain mac.com.
#import <AppKit/AppKit.h>
@interface KFSplitView:NSSplitView
{
// retained
NSMutableSet *kfCollapsedSubviews;
NSMutableArray *kfDividerRects;
NSString *kfPositionAutosaveName;
NSCursor *kfIsVerticalResizeCursor;
NSCursor *kfNotIsVerticalResizeCursor;
// not retained
NSCursor *kfCurrentResizeCursor;
NSUserDefaults *kfDefaults;
NSNotificationCenter *kfNotificationCenter;
BOOL kfIsVertical;
id kfDelegate;
}
// sets the collapse-state of a subview, which is completely independent
// of that subview's frame (as in NSSplitView). (Sometime) after calling this
// you'll need to tell the splitview to resize its subviews.
// Normally, that would be this call:
// [kfSplitView resizeSubviewsWithOldSize:[kfSplitView bounds].size];
- (void)setSubview:(NSView *)subview isCollapsed:(BOOL)flag;
// To find documentation for these methods refer to Apple's NSWindow
// documentation for the corresponding methods (e.g. -setFrameAutosaveName:).
// To use an autosave name, call -setPositionAutosaveName: from the -awakeFromNib
// method of a controller.
+ (void)removePositionUsingName:(NSString *)name;
- (void)savePositionUsingName:(NSString *)name;
- (BOOL)setPositionUsingName:(NSString *)name;
- (BOOL)setPositionAutosaveName:(NSString *)name;
- (NSString *)positionAutosaveName;
- (void)setPositionFromPlistObject:(id)string;
- (id)plistObjectWithSavedPosition;
- (void)kfRecalculateDividerRects;
@end
@interface NSObject(KFSplitViewDelegate)
// in notification argument 'object' will be sender, 'userInfo' will have key @"subview"
- (void)splitViewDidCollapseSubview:(NSNotification *)notification;
- (void)splitViewDidExpandSubview:(NSNotification *)notification;
- (void)splitView:(id)sender didDoubleClickInDivider:(int)index;
- (void)splitView:(id)sender didFinishDragInDivider:(int)index;
@end
// notifications: 'object' will be sender, 'userInfo' will have key @"subview".
// The delegate is automatically registered to receive these notifications.
extern NSString* const KFSplitViewDidCollapseSubviewNotification;
extern NSString* const KFSplitViewDidExpandSubviewNotification;