Imported Upstream version 3.2.2
[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>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
14 #set $win = 'self._%s_check_box'%$id
15 $win = forms.check_box(
16         parent=$(parent).GetWin(),
17         value=self.$id,
18         callback=self.set_$(id),
19         #if $label()
20         label=$label,
21         #else
22         label='$id',
23         #end if
24         true=$true,
25         false=$false,
26 )
27 #if not $grid_pos()
28 $(parent).Add($win)
29 #else
30 $(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
31 #end if</make>
32         <callback>self.set_$(id)($value)</callback>
33         <callback>self._$(id)_check_box.set_value($id)</callback>
34         <param>
35                 <name>Label</name>
36                 <key>label</key>
37                 <value></value>
38                 <type>string</type>
39                 <hide>#if $label() then 'none' else 'part'#</hide>
40         </param>
41         <param>
42                 <name>Default Value</name>
43                 <key>value</key>
44                 <value>True</value>
45                 <type>raw</type>
46         </param>
47         <param>
48                 <name>True</name>
49                 <key>true</key>
50                 <value>True</value>
51                 <type>raw</type>
52         </param>
53         <param>
54                 <name>False</name>
55                 <key>false</key>
56                 <value>False</value>
57                 <type>raw</type>
58         </param>
59         <param>
60                 <name>Grid Position</name>
61                 <key>grid_pos</key>
62                 <value></value>
63                 <type>grid_pos</type>
64         </param>
65         <param>
66                 <name>Notebook</name>
67                 <key>notebook</key>
68                 <value></value>
69                 <type>notebook</type>
70         </param>
71         <check>$value in ($true, $false)</check>
72         <doc>
73 This block creates a variable with a check box form. \
74 Leave the label blank to use the variable id as the label.
75
76 A check box form can switch between two states; \
77 the default being True and False. \
78 Override True and False to use alternative states.
79
80 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
81
82 Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.
83         </doc>
84 </block>