-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.xul
159 lines (144 loc) · 3.96 KB
/
list.xul
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window title="XUL Lists"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script>
<![CDATA[
function selectAll(listID)
{
document.getElementById(listID).selectAll();
}
function clearAll(listID)
{
document.getElementById(listID).selectItem(-1);
}
function setText(listID,textID)
{
var listBox = document.getElementById(listID);
var selectedItem = listBox.getSelectedItem(0);
var newText = selectedItem.getAttribute("label");
document.getElementById(textID).value = newText;
}
function setCount(listID,textID)
{
var listBox = document.getElementById(listID);
document.getElementById(textID).value = listBox.selectedCount;
}
]]>
</script>
<description><html:h1>XUL Lists</html:h1></description>
<vbox flex="1" style="overflow: auto">
<hbox>
<groupbox flex="1">
<caption label="states" />
<listbox rows="5">
<listitem label="Normal" />
<listitem label="Selected" selected="true" />
<listitem label="Disabled" disabled="true" />
<listitem label="Checkbox" type="checkbox" />
<listitem label="Checked" type="checkbox" checked="true" />
</listbox>
</groupbox>
<groupbox flex="1">
<caption label="with single selection" />
<listbox id="single-box" rows="5" flex="1"
onselect="setText('single-box','single-text');">
<listitem label="Pearl" />
<listitem label="Aramis" />
<listitem label="Yakima" />
<listitem label="Tribble" />
<listitem label="Cosmo" />
</listbox>
<hbox pack="center">
<description id="single-text" value="(no input yet)" />
</hbox>
</groupbox>
<groupbox flex="1">
<caption label="with multiple selection" />
<listbox id="multi-box" rows="5" flex="1" seltype="multiple"
onselect="setCount('multi-box', 'multi-text');">
<listitem label="Gray" />
<listitem label="Black" />
<listitem label="Holstein" />
<listitem label="Orange" />
<listitem label="White" />
</listbox>
<hbox align="center">
<button label="Select All" oncommand="selectAll('multi-box');" />
<button label="Clear All" oncommand="clearAll('multi-box');" />
<spacer flex="1" />
<description value="#" />
<description id="multi-text" value="0" />
</hbox>
</groupbox>
</hbox>
<groupbox>
<caption label="with multiple columns and a scrollbar" />
<listbox rows="5">
<listcols>
<listcol flex="1" />
<splitter class="tree-splitter" />
<listcol flex="1" />
<splitter class="tree-splitter" />
<listcol flex="1" />
</listcols>
<listhead>
<listheader label="Name" />
<listheader label="Sex" />
<listheader label="Color" />
</listhead>
<listitem>
<label value="Pearl" />
<label value="Female" />
<label value="Gray" />
</listitem>
<listitem>
<label value="Aramis" />
<label value="Male" />
<label value="Black" />
</listitem>
<listitem>
<label value="Yakima" />
<label value="Male" />
<label value="Holstein" />
</listitem>
<listitem>
<label value="Cosmo" />
<label value="Female" />
<label value="White" />
</listitem>
<listitem>
<label value="Fergus" />
<label value="Male" />
<label value="Black" />
</listitem>
<listitem>
<label value="Clint" />
<label value="Male" />
<label value="Black" />
</listitem>
<listitem>
<label value="Tribble" />
<label value="Female" />
<label value="Orange" />
</listitem>
<listitem>
<label value="Zippy" />
<label value="Male" />
<label value="Orange" />
</listitem>
<listitem>
<label value="Feathers" />
<label value="Male" />
<label value="Tabby" />
</listitem>
<listitem>
<label value="Butter" />
<label value="Male" />
<label value="Orange" />
</listitem>
</listbox>
</groupbox>
</vbox>
</window>