-
Notifications
You must be signed in to change notification settings - Fork 0
/
SliderDoubleView.mm
executable file
·98 lines (83 loc) · 1.36 KB
/
SliderDoubleView.mm
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
// SliderDoubleView.m
// VisionSandbox
//
// Created by Joel Brogan on 8/14/14.
// Copyright (c) 2015 Joel Brogan. All rights reserved.
//
#import "SliderDoubleView.h"
@implementation SliderDoubleView
@dynamic min,max;
@synthesize numType;
- (id)initWithFrame:(NSRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
}
return self;
}
-(id)init
{
self = [super init];
if (self)
{
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
}
return self;
}
-(IBAction)sliderChandged:(id)sender
{
[field setStringValue:[slider stringValue]];
[self settingChanged];
}
-(IBAction)valChanged:(id)sender
{
[slider setDoubleValue:field.doubleValue];
[self settingChanged];
}
-(void)applyValue:(id)val
{
if ([val isKindOfClass:NSNumber.class]) {
[slider setDoubleValue:[(NSNumber *)val doubleValue]];
[self sliderChandged:nil];
}
}
-(id)getValue
{
return @(slider.doubleValue);
}
-(void)setting_min:(NSNumber *)m
{
self.min = m.doubleValue;
}
-(void)setting_max:(NSNumber *)m
{
self.max = m.doubleValue;
}
-(void)setMax:(double)m
{
[slider setMaxValue:m];
max = m;
}
-(void)setMin:(double)m
{
[slider setMinValue:m];
min = m;
}
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
// Drawing code here.
}
- (double)doubleVal
{
return slider.doubleValue;
}
@end