Statistics
| Branch: | Tag: | Revision:

root / gr-qtgui / grc / qtgui_tab_widget.xml @ 71c0f14a

History | View | Annotate | Download (2.4 kB)

1
<?xml version="1.0"?>
2
<!--
3
###################################################
4
##WX GUI Notebook
5
###################################################
6
 -->
7
<block>
8
        <name>QT GUI Tab Widget</name>
9
        <key>qtgui_tab_widget</key>
10
        <category>QT GUI Widgets</category>
11
        <import>from PyQt4 import Qt</import>
12
        <make>#set $win = 'self.%s'%$id
13
Qt.QTabWidget()
14
#set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())]
15
#for i, label in enumerate($all_labels)
16
self.$(id)_widget_$(i) = Qt.QWidget()
17
self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i))
18
self.$(id)_grid_layout_$(i) = Qt.QGridLayout()
19
self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i))
20
$(win).addTab(self.$(id)_widget_$(i), $label)
21
#end for
22
$(gui_hint()($win))</make>
23
        <param>
24
                <name>Num Tabs</name>
25
                <key>num_tabs</key>
26
                <value>1</value>
27
                <type>enum</type>
28
                <option><name>1</name><key>1</key></option>
29
                <option><name>2</name><key>2</key></option>
30
                <option><name>3</name><key>3</key></option>
31
                <option><name>4</name><key>4</key></option>
32
                <option><name>5</name><key>5</key></option>
33
        </param>
34
        <param>
35
                <name>Label 0</name>
36
                <key>label0</key>
37
                <value>Tab 0</value>
38
                <type>string</type>
39
                <hide>#if int($num_tabs()) > 0 then 'none' else 'all'#</hide>
40
        </param>
41
        <param>
42
                <name>Label 1</name>
43
                <key>label1</key>
44
                <value>Tab 1</value>
45
                <type>string</type>
46
                <hide>#if int($num_tabs()) > 1 then 'none' else 'all'#</hide>
47
        </param>
48
        <param>
49
                <name>Label 2</name>
50
                <key>label2</key>
51
                <value>Tab 2</value>
52
                <type>string</type>
53
                <hide>#if int($num_tabs()) > 2 then 'none' else 'all'#</hide>
54
        </param>
55
        <param>
56
                <name>Label 3</name>
57
                <key>label3</key>
58
                <value>Tab 3</value>
59
                <type>string</type>
60
                <hide>#if int($num_tabs()) > 3 then 'none' else 'all'#</hide>
61
        </param>
62
        <param>
63
                <name>Label 4</name>
64
                <key>label4</key>
65
                <value>Tab 4</value>
66
                <type>string</type>
67
                <hide>#if int($num_tabs()) > 4 then 'none' else 'all'#</hide>
68
        </param>
69
        <param>
70
                <name>GUI Hint</name>
71
                <key>gui_hint</key>
72
                <value></value>
73
                <type>gui_hint</type>
74
                <hide>part</hide>
75
        </param>
76
        <doc>
77
This block creates a tabbed widget to organize other widgets. \
78
The ID of this block can be used as the tab_id in the GUI hints of other widgets.
79
80
The GUI hint can be used to position the widget within the application. \
81
The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \
82
Both the tab specification and the grid position are optional.
83
        </doc>
84
</block>