Merged r11309:11357 from grc branch.
[debian/gnuradio] / grc / blocks / variable_check_box.xml
index 7054ca1eb253da18cd27ae06989a5c620ef00137..a703703c766ec018c3ad39534c5691d0fb35940b 100644 (file)
        <key>variable_check_box</key>
        <import>from gnuradio.wxgui import forms</import>
        <var_make>self.$(id) = $(id) = $value</var_make>
-       <make>self._$(id)_check_box = forms.check_box(
-       parent=self.GetWin(),
+       <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
+#set $win = 'self._%s_check_box'%$id
+$win = forms.check_box(
+       parent=$(parent).GetWin(),
        value=self.$id,
        callback=self.set_$(id),
        #if $label()
        true=$true,
        false=$false,
 )
-#set $grid_pos = $grid_pos()
-#if not grid_pos
-self.Add(self._$(id)_check_box)
+#if not $grid_pos()
+$(parent).Add($win)
 #else
-self.GridAdd(self._$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $grid_pos[3])
+$(parent).GridAdd($win, $(', '.join(map(str, $grid_pos()))))
 #end if</make>
        <callback>self.set_$(id)($value)</callback>
        <callback>self._$(id)_check_box.set_value($id)</callback>
@@ -61,6 +62,12 @@ self.GridAdd(self._$(id)_check_box, $grid_pos[0], $grid_pos[1], $grid_pos[2], $g
                <value></value>
                <type>grid_pos</type>
        </param>
+       <param>
+               <name>Notebook</name>
+               <key>notebook</key>
+               <value></value>
+               <type>notebook</type>
+       </param>
        <check>$value in ($true, $false)</check>
        <doc>
 This block creates a variable with a check box form. \
@@ -71,5 +78,7 @@ the default being True and False. \
 Override True and False to use alternative states.
 
 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
+
+Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.
        </doc>
 </block>