2002/07/16 00:39:23
[org.ibex.core.git] / src / org / xwt / builtin / splash.xwt
1 <xwt>
2
3     <template thisbox="window" orient="vertical">
4
5         width = $inner.width;
6         height = $inner.height;
7         x = (xwt.screenWidth - width) / 2;
8         y = (xwt.screenHeight - height) / 2;
9
10         xwt.thread = function() {
11             var origin = xwt.origin;
12             if (origin.substring(0, 21) == "http://launch.xwt.org")
13                 origin = origin.substring(22);
14
15             xwt.loadArchive(origin, function(num, den) {
16                     $left.flex = 50 * (num / den);
17                     $right.flex = 50 + 50 * (1.0 - num /den);
18                     $status.text = "Downloading: " + xwt.math.ceil(num * 100 / den) + "% [" + num + " bytes]";
19                 });
20
21             xwt.newBox("main", function(num, den) {
22                     $left.flex = 50 + 50 * (num / den);
23                     $right.flex = 50 * (1.0 - num / den);
24                     $status.text = "Initializing: " + xwt.math.ceil(num * 100 / den) + "%";
25                     xwt.yield();
26                 });
27
28             thisbox = null;
29         }
30
31         <box absolute="true" sizetoimage="true" id="inner" image="org.xwt.builtin.lithium"/>
32
33         <box/>
34         <box text="Downloading user interface..." vshrink="true" hpad="20" vpad="3" id="status" textcolor="white"/>
35
36         <box vpad="5" hpad="30" height="20">
37             <box color="red" flex="0.0" id="left"/>
38             <box flex="100.0" id="right" color="blue"/>
39         </box>
40
41     </template>
42