3 <template thisbox="window" orient="vertical">
5 minwidth = maxwidth = $inner.width;
6 minheight = maxheight = $inner.height;
7 x = (xwt.screenWidth - width) / 2;
8 y = (xwt.screenHeight - height) / 2;
10 _KeyPressed = function(k) {
11 if (k == "escape") thisbox = null;
14 xwt.thread = function() {
16 var origin = xwt.origin;
17 if (origin.substring(0, 21) == "http://launch.xwt.org") {
18 origin = origin.substring(22);
19 origin = "http://" + origin.substring(origin.indexOf('/') + 1);
21 xwt.println("origin is " + origin);
23 xwt.loadArchive(origin, function(num, den) {
24 $left.flex = 50 * (num / den);
25 $right.flex = 50 + 50 * (1.0 - num /den);
26 var pct = xwt.math.ceil(num * 100 / den);
28 num = "" + num + " bytes";
29 } else if (1024 * 1024 > num) {
30 num = "" + xwt.math.ceil(num / 1024) + "kb";
32 num = "" + xwt.math.ceil(num / (1024 * 1024)) + "Mb";
34 $status.text = "Downloading: " + pct + "% [" + num + "]";
37 xwt.newBox().apply("main", function(num, den) {
38 $left.flex = 50 + 50 * (num / den);
39 $right.flex = 50 * (1.0 - num / den);
40 if ($right.flex == 0) $right.width = 0;
41 $status.text = "Initializing: " + xwt.math.ceil(num * 100 / den) + "%";
46 $status.text = "Error: " + e;
47 if ($status.text.substring(0, 13) == "Error: Error:") $status.text = $status.text.substring(7);
52 <box absolute="true" sizetoimage="true" id="inner" image="org.xwt.builtin.lithium"/>
55 <box text="Downloading user interface..." vshrink="true" hpad="4" vpad="3" id="status" textcolor="white"/>
56 <box hpad="4" height="10">
57 <box flex="0.0" image="org.xwt.builtin.progress" tile="true" id="left"/>
58 <box flex="100.0" id="right"/>