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