another distcheck fix
[debian/gnuradio] / grc / data / grc_gnuradio / blocks / variable_chooser.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Variable Chooser: a grc variable with multiple choices
5 ###################################################
6  -->
7 <block>
8         <name>Variable Chooser</name>
9         <key>variable_chooser</key>
10         <make>$(choices)[$value_index]
11 _$(id)_control = grc_wxgui.$(chooser_type)_control(
12         window=self.GetWin(),
13         callback=self.set_$(id),
14                 #if $label.eval
15         label=$label,
16                 #else
17         label=&quot;$id&quot;,
18                 #end if
19         index=$value_index,
20         choices=$choices,
21         labels=$labels,
22 )
23 #set $grid_pos = $grid_pos.eval
24 #if not grid_pos
25 self.Add(_$(id)_control)
26 #else
27 self.GridAdd(_$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
28 #end if</make>
29         <param>
30                 <name>Label</name>
31                 <key>label</key>
32                 <value></value>
33                 <type>string</type>
34         </param>
35         <param>
36                 <name>Value Index</name>
37                 <key>value_index</key>
38                 <value>0</value>
39                 <type>int</type>
40         </param>
41         <param>
42                 <name>Choices</name>
43                 <key>choices</key>
44                 <value>[1, 2, 3]</value>
45                 <type>raw</type>
46         </param>
47         <param>
48                 <name>Labels</name>
49                 <key>labels</key>
50                 <value>[]</value>
51                 <type>raw</type>
52         </param>
53         <param>
54                 <name>Chooser Type</name>
55                 <key>chooser_type</key>
56                 <value>drop_down</value>
57                 <type>enum</type>
58                 <option>
59                         <name>Drop Down</name>
60                         <key>drop_down</key>
61                 </option>
62                 <option>
63                         <name>Radio Buttons Horizontal</name>
64                         <key>radio_buttons_horizontal</key>
65                 </option>
66                 <option>
67                         <name>Radio Buttons Vertical</name>
68                         <key>radio_buttons_vertical</key>
69                 </option>
70                 <option>
71                         <name>Button</name>
72                         <key>button</key>
73                 </option>
74         </param>
75         <param>
76                 <name>Grid Position</name>
77                 <key>grid_pos</key>
78                 <value></value>
79                 <type>grid_pos</type>
80         </param>
81         <check>$value_index in range(len($choices))</check>
82         <check>not $labels or len($labels) == len($choices)</check>
83         <doc>
84 This block creates a variable with a drop down, radio buttons, or a button. \
85 Leave the label blank to use the variable id as the label. \
86 The value index is the index of a particular choice, \
87 which defines the default choice when the flow graph starts. \
88 The choices must be a list of possible values. \
89 Leave labels empty to use the choices as the labels.
90
91 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
92         </doc>
93 </block>