Imported Upstream version 3.2.2
[debian/gnuradio] / grc / blocks / variable_slider.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Variable Slider:
5 ##      a combined slider and text box form
6 ###################################################
7  -->
8 <block>
9         <name>Variable Slider</name>
10         <key>variable_slider</key>
11         <import>from gnuradio.wxgui import forms</import>
12         <var_make>self.$(id) = $(id) = $value</var_make>
13         <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
14 #set $win = '_%s_sizer'%$id
15 $win = wx.BoxSizer(wx.VERTICAL)
16 self._$(id)_text_box = forms.text_box(
17         parent=$(parent).GetWin(),
18         sizer=$win,
19         value=self.$id,
20         callback=self.set_$(id),
21         #if $label()
22         label=$label,
23         #else
24         label='$id',
25         #end if
26         converter=forms.$(converver)(),
27         proportion=0,
28 )
29 self._$(id)_slider = forms.slider(
30         parent=$(parent).GetWin(),
31         sizer=$win,
32         value=self.$id,
33         callback=self.set_$(id),
34         minimum=$min,
35         maximum=$max,
36         num_steps=$num_steps,
37         style=$style,
38         cast=$(converver.slider_cast),
39         proportion=1,
40 )
41 #if not $grid_pos()
42 $(parent).Add($win)
43 #else
44 $(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
45 #end if</make>
46         <callback>self.set_$(id)($value)</callback>
47         <callback>self._$(id)_slider.set_value($id)</callback>
48         <callback>self._$(id)_text_box.set_value($id)</callback>
49         <param>
50                 <name>Label</name>
51                 <key>label</key>
52                 <value></value>
53                 <type>string</type>
54                 <hide>#if $label() then 'none' else 'part'#</hide>
55         </param>
56         <param>
57                 <name>Default Value</name>
58                 <key>value</key>
59                 <value>50</value>
60                 <type>real</type>
61         </param>
62         <param>
63                 <name>Minimum</name>
64                 <key>min</key>
65                 <value>0</value>
66                 <type>real</type>
67         </param>
68         <param>
69                 <name>Maximum</name>
70                 <key>max</key>
71                 <value>100</value>
72                 <type>real</type>
73         </param>
74         <param>
75                 <name>Num Steps</name>
76                 <key>num_steps</key>
77                 <value>100</value>
78                 <type>int</type>
79                 <hide>part</hide>
80         </param>
81         <param>
82                 <name>Style</name>
83                 <key>style</key>
84                 <value>wx.SL_HORIZONTAL</value>
85                 <type>enum</type>
86                 <hide>part</hide>
87                 <option>
88                         <name>Horizontal</name>
89                         <key>wx.SL_HORIZONTAL</key>
90                 </option>
91                 <option>
92                         <name>Vertical</name>
93                         <key>wx.SL_VERTICAL</key>
94                 </option>
95         </param>
96         <param>
97                 <name>Converter</name>
98                 <key>converver</key>
99                 <value>float_converter</value>
100                 <type>enum</type>
101                 <option>
102                         <name>Float</name>
103                         <key>float_converter</key>
104                         <opt>slider_cast:float</opt>
105                 </option>
106                 <option>
107                         <name>Integer</name>
108                         <key>int_converter</key>
109                         <opt>slider_cast:int</opt>
110                 </option>
111         </param>
112         <param>
113                 <name>Grid Position</name>
114                 <key>grid_pos</key>
115                 <value></value>
116                 <type>grid_pos</type>
117         </param>
118         <param>
119                 <name>Notebook</name>
120                 <key>notebook</key>
121                 <value></value>
122                 <type>notebook</type>
123         </param>
124         <check>$min &lt;= $value &lt;= $max</check>
125         <check>$min &lt; $max</check>
126         <check>0 &lt; $num_steps &lt;= 1000</check>
127         <doc>
128 This block creates a variable with a slider. \
129 Leave the label blank to use the variable id as the label. \
130 The value must be a real number. \
131 The value must be between the minimum and the maximum. \
132 The number of steps must be between 0 and 1000.
133
134 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
135
136 Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.
137         </doc>
138 </block>