added include <cstdio> statements in several files to make it compatible with g+...
[debian/gnuradio] / grc / data / platforms / python / blocks / variable_chooser.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Variable Chooser:
5 ##      a gui form with enumerated choices
6 ##      radio buttons, drop down, or button
7 ###################################################
8  -->
9 <block>
10         <name>Variable Chooser</name>
11         <key>variable_chooser</key>
12         <import>from gnuradio.wxgui import forms</import>
13         <make>$value
14 self['$id'] = $id
15 self.subscribe('$id', self.set_$(id))
16 self._$(id)_control = forms.$(type)(
17         parent=self.GetWin(),
18         ps=self,
19         key='$id',
20         #if $label()
21         label=$label,
22         #else
23         label='$id',
24         #end if
25         choices=$choices,
26         labels=$labels,
27 #if $type() == 'radio_buttons'
28         style=$style,
29 #end if
30 )
31 #set $grid_pos = $grid_pos()
32 #if not grid_pos
33 self.Add(self._$(id)_control)
34 #else
35 self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
36 #end if</make>
37         <param>
38                 <name>Label</name>
39                 <key>label</key>
40                 <value></value>
41                 <type>string</type>
42                 <hide>#if $label() then 'none' else 'part'#</hide>
43         </param>
44         <param>
45                 <name>Default Value</name>
46                 <key>value</key>
47                 <value>1</value>
48                 <type>raw</type>
49         </param>
50         <param>
51                 <name>Choices</name>
52                 <key>choices</key>
53                 <value>[1, 2, 3]</value>
54                 <type>raw</type>
55         </param>
56         <param>
57                 <name>Labels</name>
58                 <key>labels</key>
59                 <value>[]</value>
60                 <type>raw</type>
61         </param>
62         <param>
63                 <name>Type</name>
64                 <key>type</key>
65                 <value>drop_down</value>
66                 <type>enum</type>
67                 <option>
68                         <name>Drop Down</name>
69                         <key>drop_down</key>
70                 </option>
71                 <option>
72                         <name>Radio Buttons</name>
73                         <key>radio_buttons</key>
74                 </option>
75                 <option>
76                         <name>Button</name>
77                         <key>button</key>
78                 </option>
79         </param>
80         <param>
81                 <name>Style</name>
82                 <key>style</key>
83                 <value>wx.RA_HORIZONTAL</value>
84                 <type>enum</type>
85                 <hide>#if $type() == 'radio_buttons' then 'part' else 'all'#</hide>
86                 <option>
87                         <name>Horizontal</name>
88                         <key>wx.RA_HORIZONTAL</key>
89                 </option>
90                 <option>
91                         <name>Vertical</name>
92                         <key>wx.RA_VERTICAL</key>
93                 </option>
94         </param>
95         <param>
96                 <name>Grid Position</name>
97                 <key>grid_pos</key>
98                 <value></value>
99                 <type>grid_pos</type>
100         </param>
101         <check>$value in $choices</check>
102         <check>not $labels or len($labels) == len($choices)</check>
103         <doc>
104 This block creates a variable with a drop down, radio buttons, or a button. \
105 Leave the label blank to use the variable id as the label. \
106 The value index is the index of a particular choice, \
107 which defines the default choice when the flow graph starts. \
108 The choices must be a list of possible values. \
109 Leave labels empty to use the choices as the labels.
110
111 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
112         </doc>
113 </block>