PageRenderTime 37ms CodeModel.GetById 16ms RepoModel.GetById 1ms 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
Possible License(s): LGPL-2.1, Apache-2.0
  1. __ui_UIObject.prototype.__class__ = "ui_UIObject";
  2. function ui_UIObject() {
  3. return new __ui_UIObject();
  4. }
  5. function __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. };
  16. pyjs_extend(__ui_Widget, __ui_UIObject);
  17. __ui_Widget.prototype.__class__ = "ui_Widget";
  18. function ui_Widget() {
  19. return new __ui_Widget();
  20. }
  21. function __ui_Widget() {
  22. __ui_UIObject.call(this);
  23. }
  24. __ui_Widget.prototype.setParent = function(parent) {
  25. this.parent = parent;
  26. };
  27. pyjs_extend(__ui_Panel, __ui_Widget);
  28. __ui_Panel.prototype.__class__ = "ui_Panel";
  29. function ui_Panel() {
  30. return new __ui_Panel();
  31. }
  32. function __ui_Panel() {
  33. __ui_Widget.call(this);
  34. }
  35. pyjs_extend(__ui_ComplexPanel, __ui_Panel);
  36. __ui_ComplexPanel.prototype.__class__ = "ui_ComplexPanel";
  37. function ui_ComplexPanel() {
  38. return new __ui_ComplexPanel();
  39. }
  40. function __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. };
  48. pyjs_extend(__ui_AbsolutePanel, __ui_ComplexPanel);
  49. __ui_AbsolutePanel.prototype.__class__ = "ui_AbsolutePanel";
  50. function ui_AbsolutePanel() {
  51. return new __ui_AbsolutePanel();
  52. }
  53. function __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. };