Merging r11186:11273 from grc branch.
[debian/gnuradio] / grc / blocks / variable_check_box.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Variable Check Box:
5 ##      a gui check box form
6 ###################################################
7  -->
8 <block>
9         <name>Variable Check Box</name>
10         <key>variable_check_box</key>
11         <import>from gnuradio.wxgui import forms</import>
12         <var_make>self.$(id) = $(id) = $value</var_make>
13         <make>self.$(id)_check_box = forms.check_box(
14         parent=self.GetWin(),
15         value=self.$id,
16         callback=self.set_$(id),
17         #if $label()
18         label=$label,
19         #else
20         label='$id',
21         #end if
22         true=$true,
23         false=$false,
24 )
25 #set $grid_pos = $grid_pos()
26 #if not grid_pos
27 self.Add(self.$(id)_check_box)
28 #else
29 self.GridAdd(self.$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
30 #end if</make>
31         <callback>self.set_$(id)($value)</callback>
32         <callback>self.$(id)_check_box.set_value($id)</callback>
33         <param>
34                 <name>Label</name>
35                 <key>label</key>
36                 <value></value>
37                 <type>string</type>
38                 <hide>#if $label() then 'none' else 'part'#</hide>
39         </param>
40         <param>
41                 <name>Default Value</name>
42                 <key>value</key>
43                 <value>True</value>
44                 <type>raw</type>
45         </param>
46         <param>
47                 <name>True</name>
48                 <key>true</key>
49                 <value>True</value>
50                 <type>raw</type>
51         </param>
52         <param>
53                 <name>False</name>
54                 <key>false</key>
55                 <value>False</value>
56                 <type>raw</type>
57         </param>
58         <param>
59                 <name>Grid Position</name>
60                 <key>grid_pos</key>
61                 <value></value>
62                 <type>grid_pos</type>
63         </param>
64         <check>$value in ($true, $false)</check>
65         <doc>
66 This block creates a variable with a check box form. \
67 Leave the label blank to use the variable id as the label.
68
69 A check box form can switch between two states; \
70 the default being True and False. \
71 Override True and False to use alternative states.
72
73 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
74         </doc>
75 </block>