initial checkin
[org.ibex.widgets.git] / src / ibex / lib / surface.t
1 <!-- Copyleft 2004 - see COPYING for details [LGPL] -->
2
3 <ibex>
4     <meta:doc>
5         Surface:
6             Applied to every new surface (frame/window)
7     </meta:doc>
8
9     <ibex.lib.redirect />
10     <ui:box>
11
12         var s = {};
13
14         // proxy to the surface object
15         thisbox.surface ++= function() { return s; };
16
17         // root.distanceTo proxy function
18         s.distanceto = function(v) { return distanceto(v); }
19
20         // access to the surface mouse object
21         s.mouse ++= function() { return thisbox.mouse; }
22
23         // redirect events to the surface object for access
24         redirectTo(surface,
25             "Click1", "Click2", "Click3",
26             "DoubleClick1", "DoubleClick2", "DoubleClick3",
27             "KeyPressed", "KeyReleased",
28             "Move", "PosChange", "SizeChange",
29             "Press1", "Press2", "Press3",
30             "Release1", "Release2", "Release3");
31
32     </ui:box>
33 </ibex>