3 ###################################################
5 ## a combined slider and text box form
6 ###################################################
9 <name>Variable Slider</name>
10 <key>variable_slider</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 = '_%s_sizer'%$id
15 $win = wx.BoxSizer(wx.VERTICAL)
16 self._$(id)_text_box = forms.text_box(
17 parent=$(parent).GetWin(),
20 callback=self.set_$(id),
26 converter=forms.$(converver)(),
29 self._$(id)_slider = forms.slider(
30 parent=$(parent).GetWin(),
33 callback=self.set_$(id),
38 cast=$(converver.slider_cast),
44 $(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
46 <callback>self.set_$(id)($value)</callback>
47 <callback>self._$(id)_slider.set_value($id)</callback>
48 <callback>self._$(id)_text_box.set_value($id)</callback>
54 <hide>#if $label() then 'none' else 'part'#</hide>
57 <name>Default Value</name>
75 <name>Num Steps</name>
84 <value>wx.SL_HORIZONTAL</value>
88 <name>Horizontal</name>
89 <key>wx.SL_HORIZONTAL</key>
93 <key>wx.SL_VERTICAL</key>
97 <name>Converter</name>
99 <value>float_converter</value>
103 <key>float_converter</key>
104 <opt>slider_cast:float</opt>
108 <key>int_converter</key>
109 <opt>slider_cast:int</opt>
113 <name>Grid Position</name>
116 <type>grid_pos</type>
119 <name>Notebook</name>
122 <type>notebook</type>
124 <check>$min <= $value <= $max</check>
125 <check>$min < $max</check>
126 <check>0 < $num_steps <= 1000</check>
128 This block creates a variable with a slider. \
129 Leave the label blank to use the variable id as the label. \
130 The value must be a real number. \
131 The value must be between the minimum and the maximum. \
132 The number of steps must be between 0 and 1000.
134 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
136 Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.