diff options
author | jblum | 2009-06-23 20:38:18 +0000 |
---|---|---|
committer | jblum | 2009-06-23 20:38:18 +0000 |
commit | 9988664127b367fa8fee4409f8460673d6f265e1 (patch) | |
tree | 96752c15b7f1447e5e78a7282d1de141f9e0000b /grc/blocks/variable_text_box.xml | |
parent | 885e6fe1fd0e06476511c79515f34ffcef50287d (diff) | |
download | gnuradio-9988664127b367fa8fee4409f8460673d6f265e1.tar.gz gnuradio-9988664127b367fa8fee4409f8460673d6f265e1.tar.bz2 gnuradio-9988664127b367fa8fee4409f8460673d6f265e1.zip |
Merging r11186:11273 from grc branch.
Fixes, features, and reorganization for grc.
Minor fixes and features for wxgui forms.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11274 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/blocks/variable_text_box.xml')
-rw-r--r-- | grc/blocks/variable_text_box.xml | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/grc/blocks/variable_text_box.xml b/grc/blocks/variable_text_box.xml new file mode 100644 index 000000000..2bcb680f2 --- /dev/null +++ b/grc/blocks/variable_text_box.xml @@ -0,0 +1,92 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Variable Text Box: +## a gui text box form +################################################### + --> +<block> + <name>Variable Text Box</name> + <key>variable_text_box</key> + <import>from gnuradio.wxgui import forms</import> + <var_make>self.$(id) = $(id) = $value</var_make> + <make>self.$(id)_text_box = forms.text_box( + parent=self.GetWin(), + value=self.$id, + callback=self.set_$(id), + #if $label() + label=$label, + #else + label='$id', + #end if + #if $formatter() + converter=forms.$(converver)(formatter=$formatter), + #else + converter=forms.$(converver)(), + #end if +) +#set $grid_pos = $grid_pos() +#if not grid_pos +self.Add(self.$(id)_text_box) +#else +self.GridAdd(self.$(id)_text_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3]) +#end if</make> + <callback>self.set_$(id)($value)</callback> + <callback>self.$(id)_text_box.set_value($id)</callback> + <param> + <name>Label</name> + <key>label</key> + <value></value> + <type>string</type> + <hide>#if $label() then 'none' else 'part'#</hide> + </param> + <param> + <name>Default Value</name> + <key>value</key> + <value>0</value> + <type>raw</type> + </param> + <param> + <name>Converter</name> + <key>converver</key> + <value>float_converter</value> + <type>enum</type> + <option> + <name>Float</name> + <key>float_converter</key> + </option> + <option> + <name>Integer</name> + <key>int_converter</key> + </option> + <option> + <name>String</name> + <key>str_converter</key> + </option> + <option> + <name>Evaluate</name> + <key>eval_converter</key> + </option> + </param> + <param> + <name>Formatter</name> + <key>formatter</key> + <value>None</value> + <type>raw</type> + <hide>part</hide> + </param> + <param> + <name>Grid Position</name> + <key>grid_pos</key> + <value></value> + <type>grid_pos</type> + </param> + <doc> +This block creates a variable with a text box. \ +Leave the label blank to use the variable id as the label. + +Format should be a function/lambda that converts a value into a string or None for the default formatter. + +Use the Grid Position (row, column, row span, column span) to position the graphical element in the window. + </doc> +</block> |