/
TMSliderControl.h
57 lines (43 loc) · 1.04 KB
/
TMSliderControl.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
//
// TMSliderControl.h
// TMSliderControl
//
// Created by Rick Fillion on 01/02/09.
// All code is provided under the New BSD license.
//
#import <Cocoa/Cocoa.h>
typedef enum
{
kTMSliderControlState_Inactive = 0,
kTMSliderControlState_Active = 1
}TMSliderControlState;
@class TMSliderControlHandle;
@interface TMSliderControl : NSControl {
NSImage *sliderWell;
NSImage *overlayMask;
NSImage *sliderHandle;
NSImage *sliderHandleDown;
TMSliderControlHandle *sliderHandleView;
// drawing
NSRect handleControlRect;
NSRect handleControlRectOn;
NSRect handleControlRectOff;
NSPoint mouseDownPosition;
// state
TMSliderControlState controlState;
BOOL hasDragged;
BOOL state;
id target;
SEL action;
}
// events
- (void)mouseDown:(NSEvent*)theEvent;
- (void)mouseDragged:(NSEvent*)theEvent;
- (void)mouseUp:(NSEvent*)theEvent;
- (BOOL)state;
- (void)setState:(BOOL)newState;
- (void)setTarget:(id)anObject;
- (id)target;
- (void)setAction:(SEL)aSelector;
- (SEL)action;
@end