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() {
15 var origin = xwt.origin;
16 if (origin.substring(0, 21) == "http://launch.xwt.org") {
17 origin = origin.substring(22);
18 origin = "http://" + origin.substring(origin.indexOf('/') + 1);
20 xwt.println("origin is " + origin);
22 xwt.loadArchive(origin, function(num, den) {
23 $left.flex = 50 * (num / den);
24 $right.flex = 50 + 50 * (1.0 - num /den);
25 var pct = xwt.math.ceil(num * 100 / den);
27 num = "" + num + " bytes";
28 } else if (1024 * 1024 > num) {
29 num = "" + xwt.math.ceil(num / 1024) + "kb";
31 num = "" + xwt.math.ceil(num / (1024 * 1024)) + "Mb";
33 $status.text = "Downloading: " + pct + "% [" + num + "]";
36 xwt.newBox("main", function(num, den) {
37 $left.flex = 50 + 50 * (num / den);
38 $right.flex = 50 * (1.0 - num / den);
39 if ($right.flex == 0) $right.width = 0;
40 $status.text = "Initializing: " + xwt.math.ceil(num * 100 / den) + "%";
46 <box absolute="true" sizetoimage="true" id="inner" image="org.xwt.builtin.lithium"/>
49 <box text="Downloading user interface..." vshrink="true" hpad="4" vpad="3" id="status" textcolor="white"/>
50 <box hpad="4" height="10">
51 <box flex="0.0" image="org.xwt.builtin.progress" tile="true" id="left"/>
52 <box flex="100.0" id="right"/>