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
99
100
101
|
<?xml version="1.0"?>
<!--
###################################################
##Variable Slider: a grc variable with key, value, min, max, step
###################################################
-->
<block>
<name>Variable Slider</name>
<key>variable_slider</key>
<make>$value
_$(id)_control = grc_wxgui.slider_$(slider_type)_control(
window=self.GetWin(),
callback=self.set_$(id),
#if $label.eval
label=$label,
#else
label='$id',
#end if
value=$id,
min=$min,
max=$max,
num_steps=$num_steps,
slider_length=$slider_length,
)
#set $grid_pos = $grid_pos.eval
#if not grid_pos
self.Add(_$(id)_control)
#else
self.GridAdd(_$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
#end if</make>
<param>
<name>Label</name>
<key>label</key>
<value></value>
<type>string</type>
</param>
<param>
<name>Default Value</name>
<key>value</key>
<value>50</value>
<type>real</type>
</param>
<param>
<name>Minimum</name>
<key>min</key>
<value>0</value>
<type>real</type>
</param>
<param>
<name>Maximum</name>
<key>max</key>
<value>100</value>
<type>real</type>
</param>
<param>
<name>Num Steps</name>
<key>num_steps</key>
<value>100</value>
<type>int</type>
<hide>part</hide>
</param>
<param>
<name>Slider Length (px)</name>
<key>slider_length</key>
<value>200</value>
<type>int</type>
<hide>part</hide>
</param>
<param>
<name>Slider Type</name>
<key>slider_type</key>
<value>horizontal</value>
<type>enum</type>
<option>
<name>Horizontal</name>
<key>horizontal</key>
</option>
<option>
<name>Vertical</name>
<key>vertical</key>
</option>
</param>
<param>
<name>Grid Position</name>
<key>grid_pos</key>
<value></value>
<type>grid_pos</type>
</param>
<check>$min <= $value <= $max</check>
<check>$min < $max</check>
<check>0 < $num_steps <= 1000</check>
<doc>
This block creates a variable with a slider. \
Leave the label blank to use the variable id as the label. \
The value must be a real number. \
The value must be between the minimum and the maximum. \
The number of steps must be between 0 and 1000.
Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
</doc>
</block>
|