PageRenderTime 567ms CodeModel.GetById 164ms app.highlight 6ms RepoModel.GetById 271ms app.codeStats 0ms

/pyjs/tests/test008.js

http://pyjamas.googlecode.com/
JavaScript | 62 lines | 62 code | 0 blank | 0 comment | 0 complexity | 3c6797773a8eaecc4cf24a8e1a7c429c MD5 | raw file
 1__ui_UIObject.prototype.__class__ = "ui_UIObject";
 2function ui_UIObject() {
 3    return new __ui_UIObject();
 4}
 5function __ui_UIObject() {
 6}
 7__ui_UIObject.prototype.getElement = function() {
 8    return this.element;
 9};
10__ui_UIObject.prototype.setElement = function(element) {
11    this.element = element;
12};
13__ui_UIObject.prototype.setStyleName = function(style) {
14    DOM_setAttribute(this.element, "className", style);
15};
16pyjs_extend(__ui_Widget, __ui_UIObject);
17__ui_Widget.prototype.__class__ = "ui_Widget";
18function ui_Widget() {
19    return new __ui_Widget();
20}
21function __ui_Widget() {
22    __ui_UIObject.call(this);
23}
24__ui_Widget.prototype.setParent = function(parent) {
25    this.parent = parent;
26};
27pyjs_extend(__ui_Panel, __ui_Widget);
28__ui_Panel.prototype.__class__ = "ui_Panel";
29function ui_Panel() {
30    return new __ui_Panel();
31}
32function __ui_Panel() {
33    __ui_Widget.call(this);
34}
35pyjs_extend(__ui_ComplexPanel, __ui_Panel);
36__ui_ComplexPanel.prototype.__class__ = "ui_ComplexPanel";
37function ui_ComplexPanel() {
38    return new __ui_ComplexPanel();
39}
40function __ui_ComplexPanel() {
41    this.children = new pyjslib_List([]);
42}
43__ui_ComplexPanel.prototype.add = function(widget) {
44    this.children.append(widget);
45    widget.setParent(this);
46    return true;
47};
48pyjs_extend(__ui_AbsolutePanel, __ui_ComplexPanel);
49__ui_AbsolutePanel.prototype.__class__ = "ui_AbsolutePanel";
50function ui_AbsolutePanel() {
51    return new __ui_AbsolutePanel();
52}
53function __ui_AbsolutePanel() {
54    __ui_ComplexPanel.call(this);
55    this.setElement(DOM_createDiv());
56    DOM_setStyleAttribute(this.getElement(), "overflow", "hidden");
57}
58__ui_AbsolutePanel.prototype.add = function(widget) {
59    __ui_ComplexPanel.prototype.add.call(this, widget);
60    DOM_appendChild(this.getElement(), widget.getElement());
61    return true;
62};