3 ###################################################
5 ## a gui form with enumerated choices
6 ## radio buttons, drop down, or button
7 ###################################################
10 <name>Variable Chooser</name>
11 <key>variable_chooser</key>
12 <import>from gnuradio.wxgui import forms</import>
15 self.subscribe('$id', self.set_$(id))
16 self._$(id)_control = forms.$(type)(
27 #if $type() == 'radio_buttons'
31 #set $grid_pos = $grid_pos()
33 self.Add(self._$(id)_control)
35 self.GridAdd(self._$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
42 <hide>#if $label() then 'none' else 'part'#</hide>
45 <name>Default Value</name>
53 <value>[1, 2, 3]</value>
65 <value>drop_down</value>
68 <name>Drop Down</name>
72 <name>Radio Buttons</name>
73 <key>radio_buttons</key>
83 <value>wx.RA_HORIZONTAL</value>
85 <hide>#if $type() == 'radio_buttons' then 'part' else 'all'#</hide>
87 <name>Horizontal</name>
88 <key>wx.RA_HORIZONTAL</key>
92 <key>wx.RA_VERTICAL</key>
96 <name>Grid Position</name>
101 <check>$value in $choices</check>
102 <check>not $labels or len($labels) == len($choices)</check>
104 This block creates a variable with a drop down, radio buttons, or a button. \
105 Leave the label blank to use the variable id as the label. \
106 The value index is the index of a particular choice, \
107 which defines the default choice when the flow graph starts. \
108 The choices must be a list of possible values. \
109 Leave labels empty to use the choices as the labels.
111 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.