Imported Upstream version 3.2.2
[debian/gnuradio] / grc / blocks / variable_text_box.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Variable Text Box:
5 ##      a gui text box form
6 ###################################################
7  -->
8 <block>
9         <name>Variable Text Box</name>
10         <key>variable_text_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_text_box'%$id
15 $win = forms.text_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         #if $formatter()
25         converter=forms.$(converver)(formatter=$formatter),
26         #else
27         converter=forms.$(converver)(),
28         #end if
29 )
30 #if not $grid_pos()
31 $(parent).Add($win)
32 #else
33 $(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
34 #end if</make>
35         <callback>self.set_$(id)($value)</callback>
36         <callback>self._$(id)_text_box.set_value($id)</callback>
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>0</value>
48                 <type>raw</type>
49         </param>
50         <param>
51                 <name>Converter</name>
52                 <key>converver</key>
53                 <value>float_converter</value>
54                 <type>enum</type>
55                 <option>
56                         <name>Float</name>
57                         <key>float_converter</key>
58                 </option>
59                 <option>
60                         <name>Integer</name>
61                         <key>int_converter</key>
62                 </option>
63                 <option>
64                         <name>String</name>
65                         <key>str_converter</key>
66                 </option>
67                 <option>
68                         <name>Evaluate</name>
69                         <key>eval_converter</key>
70                 </option>
71         </param>
72         <param>
73                 <name>Formatter</name>
74                 <key>formatter</key>
75                 <value>None</value>
76                 <type>raw</type>
77                 <hide>part</hide>
78         </param>
79         <param>
80                 <name>Grid Position</name>
81                 <key>grid_pos</key>
82                 <value></value>
83                 <type>grid_pos</type>
84         </param>
85         <param>
86                 <name>Notebook</name>
87                 <key>notebook</key>
88                 <value></value>
89                 <type>notebook</type>
90         </param>
91         <doc>
92 This block creates a variable with a text box. \
93 Leave the label blank to use the variable id as the label.
94
95 Format should be a function/lambda that converts a value into a string or None for the default formatter.
96
97 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
98
99 Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.
100         </doc>
101 </block>