forked from erndev/EDSidebar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EDSideBar.h
57 lines (46 loc) · 1.45 KB
/
EDSideBar.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
//
// ECSideBar.h
//
//
// Created by erndev
// BSD license.
//
#import <Cocoa/Cocoa.h>
@class EDSideBar;
@protocol EDSideBarDelegate <NSObject>
@required
- (void)sideBar:(EDSideBar*)tabBar didSelectButton:(NSInteger)index;
@end
enum {
ECSideBarLayoutTop = 0,
ECSideBarLayoutCenter = 1,
ECSideBarLayoutBottom = 2,
};
typedef NSUInteger ECSideBarLayoutMode;
@interface EDSideBar : NSView {
ECSideBarLayoutMode layoutMode;
NSColor *_backgroundColor;
CGFloat buttonsHeight;
id<EDSideBarDelegate> sidebarDelegate;
NSMatrix *_matrix;
Class cellClass;
NSImageView *selectorImageView;
BOOL animateSelection;
NSTimeInterval animationDuration;
}
-(void)setLayoutMode:(ECSideBarLayoutMode)layout;
-(void)addButtonWithTitle:(NSString*)title;
-(void)addButtonWithTitle:(NSString*)title image:(NSImage*)image;
-(void)addButtonWithTitle:(NSString*)title image:(NSImage*)image alternateImage:(NSImage*)alternateImage;
-(void)selectButtonAtRow:(NSUInteger)row;
-(void)drawBackground:(NSRect)rect;
-(void)setSelectionImage:(NSImage*)image;
-(id)cellForItem:(NSInteger)index;
@property (nonatomic,retain) NSColor *backgroundColor;
@property (nonatomic,retain) id<EDSideBarDelegate>sidebarDelegate;
@property (nonatomic,retain,setter=setCellClass:) Class cellClass;
@property (setter=setLayoutMode:) ECSideBarLayoutMode layoutMode;
@property (setter=setButtonsHeight:) CGFloat buttonsHeight;
@property BOOL animateSelection;
@property NSTimeInterval animationDuration;
@end