Imported Upstream version 3.2.2
[debian/gnuradio] / grc / blocks / variable_static_text.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##Variable Static Text:
5 ##      a gui static text form
6 ###################################################
7  -->
8 <block>
9         <name>Variable Static Text</name>
10         <key>variable_static_text</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_static_text'%$id
15 $win = forms.static_text(
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)_static_text.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         </param>
68         <param>
69                 <name>Formatter</name>
70                 <key>formatter</key>
71                 <value>None</value>
72                 <type>raw</type>
73                 <hide>part</hide>
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         <param>
82                 <name>Notebook</name>
83                 <key>notebook</key>
84                 <value></value>
85                 <type>notebook</type>
86         </param>
87         <doc>
88 This block creates a variable with a static text form. \
89 Leave the label blank to use the variable id as the label.
90
91 Format should be a function/lambda that converts a value into a string or None for the default formatter.
92
93 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
94
95 Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.
96         </doc>
97 </block>