1 <!-- Copyleft 2004 see COPYING for details [LGPL] -->
5 Author: Charles Goodwin
8 - ? differentiate between pt and px
9 - ? proper child and property redirection
12 <ui:box redirect="$content">
15 thisbox["margin-top"] = 0;
16 thisbox["margin-right"] = 0;
17 thisbox["margin-bottom"] = 0;
18 thisbox["margin-left"] = 0;
20 margin ++= function(v) {
24 thisbox["margin-top"] = v;
25 thisbox["margin-right"] = v;
26 thisbox["margin-bottom"] = v;
27 thisbox["margin-left"] = v;
29 else if (p.length == 2) {
30 thisbox["margin-top"] = p[0];
31 thisbox["margin-right"] = p[1];
32 thisbox["margin-bottom"] = p[0];
33 thisbox["margin-left"] = p[1];
35 else if (p.length == 4) {
36 thisbox["margin-top"] = p[0];
37 thisbox["margin-right"] = p[1];
38 thisbox["margin-bottom"] = p[2];
39 thisbox["margin-left"] = p[3];
41 else ibex.log.warn("Invalid number of values for margin: " + p.length);
44 thisbox["margin-top"] ++= function(v) { $top.height = v; }
45 thisbox["margin-right"] ++= function(v) { $right.width = v; }
46 thisbox["margin-bottom"] ++= function(v) { $bottom.height = v; }
47 thisbox["margin-left"] ++= function(v) { $left.width = v; }
49 <ui:box id="left" width="0" />
51 <ui:box id="top" height="0" />
52 <ui:box id="content" />
53 <ui:box id="bottom" height="0" />
55 <ui:box id="right" width="0" />