Merging r11186:11273 from grc branch.
[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>self.$(id)_static_text = forms.static_text(
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         #if $formatter()
23         converter=forms.$(converver)(formatter=$formatter),
24         #else
25         converter=forms.$(converver)(),
26         #end if
27 )
28 #set $grid_pos = $grid_pos()
29 #if not grid_pos
30 self.Add(self.$(id)_static_text)
31 #else
32 self.GridAdd(self.$(id)_static_text, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
33 #end if</make>
34         <callback>self.set_$(id)($value)</callback>
35         <callback>self.$(id)_static_text.set_value($id)</callback>
36         <param>
37                 <name>Label</name>
38                 <key>label</key>
39                 <value></value>
40                 <type>string</type>
41                 <hide>#if $label() then 'none' else 'part'#</hide>
42         </param>
43         <param>
44                 <name>Default Value</name>
45                 <key>value</key>
46                 <value>0</value>
47                 <type>raw</type>
48         </param>
49         <param>
50                 <name>Converter</name>
51                 <key>converver</key>
52                 <value>float_converter</value>
53                 <type>enum</type>
54                 <option>
55                         <name>Float</name>
56                         <key>float_converter</key>
57                 </option>
58                 <option>
59                         <name>Integer</name>
60                         <key>int_converter</key>
61                 </option>
62                 <option>
63                         <name>String</name>
64                         <key>str_converter</key>
65                 </option>
66         </param>
67         <param>
68                 <name>Formatter</name>
69                 <key>formatter</key>
70                 <value>None</value>
71                 <type>raw</type>
72                 <hide>part</hide>
73         </param>
74         <param>
75                 <name>Grid Position</name>
76                 <key>grid_pos</key>
77                 <value></value>
78                 <type>grid_pos</type>
79         </param>
80         <doc>
81 This block creates a variable with a static text form. \
82 Leave the label blank to use the variable id as the label.
83
84 Format should be a function/lambda that converts a value into a string or None for the default formatter.
85
86 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
87         </doc>
88 </block>