12
12
namespace cycfi ::elements
13
13
{
14
14
// //////////////////////////////////////////////////////////////////////////
15
- // dial_base
15
+ // basic_dial
16
16
// //////////////////////////////////////////////////////////////////////////
17
- dial_base::dial_base (double init_value)
17
+ basic_dial::basic_dial (double init_value)
18
18
: _value(init_value)
19
19
{
20
20
clamp (_value, 0.0 , 1.0 );
21
21
}
22
22
23
- void dial_base ::prepare_subject (context& ctx)
23
+ void basic_dial ::prepare_subject (context& ctx)
24
24
{
25
25
proxy_base::prepare_subject (ctx);
26
26
if (auto * rcvr = find_subject<receiver<double >*>(this ))
27
27
rcvr->value (_value);
28
28
}
29
29
30
- void dial_base ::value (double val)
30
+ void basic_dial ::value (double val)
31
31
{
32
32
_value = clamp (val, 0.0 , 1.0 );
33
33
if (auto * rcvr = find_subject<receiver<double >*>(this ))
@@ -36,21 +36,21 @@ namespace cycfi::elements
36
36
37
37
namespace
38
38
{
39
- inline void edit_value (dial_base * this_, double val)
39
+ inline void edit_value (basic_dial * this_, double val)
40
40
{
41
41
this_->value (val);
42
42
if (this_->on_change )
43
43
this_->on_change (this_->value ());
44
44
}
45
45
}
46
46
47
- void dial_base ::edit (view& view_, param_type val)
47
+ void basic_dial ::edit (view& view_, param_type val)
48
48
{
49
49
edit_value (this , val);
50
50
receiver<double >::notify_edit (view_);
51
51
}
52
52
53
- double dial_base ::radial_value (context const & ctx, tracker_info& track_info)
53
+ double basic_dial ::radial_value (context const & ctx, tracker_info& track_info)
54
54
{
55
55
using namespace radial_consts ;
56
56
@@ -66,7 +66,7 @@ namespace cycfi::elements
66
66
return value ();
67
67
}
68
68
69
- double dial_base ::linear_value (context const & /* ctx*/ , tracker_info& track_info)
69
+ double basic_dial ::linear_value (context const & /* ctx*/ , tracker_info& track_info)
70
70
{
71
71
point delta{
72
72
track_info.current .x - track_info.previous .x ,
@@ -81,15 +81,15 @@ namespace cycfi::elements
81
81
return clamp (val, 0.0 , 1.0 );
82
82
}
83
83
84
- double dial_base ::compute_value (context const & ctx, tracker_info& track_info)
84
+ double basic_dial ::compute_value (context const & ctx, tracker_info& track_info)
85
85
{
86
86
return (get_theme ().dial_mode == dial_mode_enum::radial)?
87
87
radial_value (ctx, track_info) :
88
88
linear_value (ctx, track_info)
89
89
;
90
90
}
91
91
92
- void dial_base ::keep_tracking (context const & ctx, tracker_info& track_info)
92
+ void basic_dial ::keep_tracking (context const & ctx, tracker_info& track_info)
93
93
{
94
94
if (track_info.current != track_info.previous )
95
95
{
@@ -102,7 +102,7 @@ namespace cycfi::elements
102
102
}
103
103
}
104
104
105
- bool dial_base ::scroll (context const & ctx, point dir, point p)
105
+ bool basic_dial ::scroll (context const & ctx, point dir, point p)
106
106
{
107
107
auto sdir = scroll_direction ();
108
108
track_scroll (ctx, dir, p);
0 commit comments