3 ###################################################
4 ##Variable Chooser: a grc variable with multiple choices
5 ###################################################
8 <name>Variable Chooser</name>
9 <key>variable_chooser</key>
10 <make>$(choices)[$value_index]
11 _$(id)_control = grc_wxgui.$(chooser_type)_control(
13 callback=self.set_$(id),
17 label="$id",
23 #set $grid_pos = $grid_pos.eval
25 self.Add(_$(id)_control)
27 self.GridAdd(_$(id)_control, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
36 <name>Value Index</name>
37 <key>value_index</key>
44 <value>[1, 2, 3]</value>
54 <name>Chooser Type</name>
55 <key>chooser_type</key>
56 <value>drop_down</value>
59 <name>Drop Down</name>
63 <name>Radio Buttons Horizontal</name>
64 <key>radio_buttons_horizontal</key>
67 <name>Radio Buttons Vertical</name>
68 <key>radio_buttons_vertical</key>
76 <name>Grid Position</name>
81 <check>$value_index in range(len($choices))</check>
82 <check>not $labels or len($labels) == len($choices)</check>
84 This block creates a variable with a drop down, radio buttons, or a button. \
85 Leave the label blank to use the variable id as the label. \
86 The value index is the index of a particular choice, \
87 which defines the default choice when the flow graph starts. \
88 The choices must be a list of possible values. \
89 Leave labels empty to use the choices as the labels.
91 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.