Imported Upstream version 3.2.2
[debian/gnuradio] / grc / blocks / notebook.xml
1 <?xml version="1.0"?>
2 <!--
3 ###################################################
4 ##WX GUI Notebook
5 ###################################################
6  -->
7 <block>
8         <name>Notebook</name>
9         <key>notebook</key>
10         <import>from grc_gnuradio import wxgui as grc_wxgui</import>
11         <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self'
12 self.$(id) = wx.Notebook($(parent).GetWin(), style=$style)
13 #for $label in $labels()
14 self.$(id).AddPage(grc_wxgui.Panel(self.$(id)), "$label")
15 #end for
16 #if not $grid_pos()
17 $(parent).Add(self.$(id))
18 #else
19 $(parent).GridAdd(self.$(id), $(', '.join(map(str, $grid_pos()))))
20 #end if</make>
21         <param>
22                 <name>Tab Orientation</name>
23                 <key>style</key>
24                 <value>wx.NB_TOP</value>
25                 <type>enum</type>
26                 <option>
27                         <name>Top</name>
28                         <key>wx.NB_TOP</key>
29                 </option>
30                 <option>
31                         <name>Right</name>
32                         <key>wx.NB_RIGHT</key>
33                 </option>
34                 <option>
35                         <name>Bottom</name>
36                         <key>wx.NB_BOTTOM</key>
37                 </option>
38                 <option>
39                         <name>Left</name>
40                         <key>wx.NB_LEFT</key>
41                 </option>
42         </param>
43         <param>
44                 <name>Labels</name>
45                 <key>labels</key>
46                 <value>['tab1', 'tab2', 'tab3']</value>
47                 <type>raw</type>
48         </param>
49         <param>
50                 <name>Grid Position</name>
51                 <key>grid_pos</key>
52                 <value></value>
53                 <type>grid_pos</type>
54         </param>
55         <param>
56                 <name>Notebook</name>
57                 <key>notebook</key>
58                 <value></value>
59                 <type>notebook</type>
60         </param>
61         <check>isinstance($labels, (list, tuple))</check>
62         <check>all(map(lambda x: isinstance(x, str), $labels))</check>
63         <check>len($labels) &gt; 0</check>
64         <doc>
65 Use the Grid Position (row, column, row span, column span) to position the graphical element in the window.
66
67 Use the Notebook Param (notebook-id, page-index) to place the graphical element inside of a notebook page.
68         </doc>
69 </block>