[qooxdoo-commit] SF.net SVN: qooxdoo:[17497] trunk/qooxdoo
Brought to you by:
ecker,
martinwittemann
From: <fj...@us...> - 2009-01-30 14:12:09
|
Revision: 17497 http://qooxdoo.svn.sourceforge.net/qooxdoo/?rev=17497&view=rev Author: fjakobs Date: 2009-01-30 14:11:54 +0000 (Fri, 30 Jan 2009) Log Message: ----------- [BUG #1845 NEW]: Create infrastructure for virtual widgets http://bugzilla.qooxdoo.org/show_bug.cgi?id=1845 fix demos Modified Paths: -------------- trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/DemoLayer.js trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/List.js trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/Table.js trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/Test.js trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/TestRelative.js Modified: trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/DemoLayer.js =================================================================== --- trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/DemoLayer.js 2009-01-30 14:03:55 UTC (rev 17496) +++ trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/DemoLayer.js 2009-01-30 14:11:54 UTC (rev 17497) @@ -31,11 +31,11 @@ qx.Class.define("demobrowser.demo.virtual.DemoLayer", { - extend : qx.ui.virtual.layer.AbstractWidget, + extend : qx.ui.virtual.layer.WidgetCell, construct : function() { - this.base(arguments); + this.base(arguments, this); this._pool = { atom : [], checkbox : [] @@ -71,8 +71,8 @@ }, - _getWidget : function(row, column) - { + getCellWidget : function(row, column) + { var widget; if (column % 2 == 0) @@ -87,6 +87,7 @@ this.__rowData[row][column].icon = icon; }, this); } + widget.set(this.getCellData(row, column)); } else { @@ -96,14 +97,22 @@ widget = new qx.ui.form.CheckBox(); widget.addListener("changeChecked", function(){ this.setLabel(this.getLabel() == "foobar!" ? widget.getUserData("row") + " / " + widget.getUserData("column") : "foobar!"); - }, widget) + }, widget); } + widget.set({ + checked : row % 2 == 0, + label : row + " / " + column + }); } + widget.setUserData("row", row); + widget.setUserData("column", column); + return widget; }, - _poolWidget: function(widget) { + + poolCellWidget: function(widget) { if (widget.classname == "qx.ui.basic.Atom") { this._pool.atom.push(widget) } else { @@ -111,22 +120,6 @@ } }, - _configureWidget : function(widget, row, column) - { - if (column % 2 == 0) - { - widget.set(this.getCellData(row, column)); - } - else - { - widget.set({ - checked : row % 2 == 0, - label : row + " / " + column - }); - } - widget.setUserData("row", row); - widget.setUserData("column", column); - }, __generateName : function() { Modified: trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/List.js =================================================================== --- trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/List.js 2009-01-30 14:03:55 UTC (rev 17496) +++ trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/List.js 2009-01-30 14:11:54 UTC (rev 17497) @@ -230,7 +230,7 @@ - + /* //////////////////////////////////////////////////////////////// // Horizontal list var configureLabel = new qx.ui.basic.Label("Horizontal, Icons only"); @@ -262,8 +262,8 @@ this.getRoot().add(l4, {left: 20, top: 370}); //////////////////////////////////////////////////////////////// + */ - } } }); Modified: trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/Table.js =================================================================== --- trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/Table.js 2009-01-30 14:03:55 UTC (rev 17496) +++ trunk/qooxdoo/application/demobrowser/source/class/demobrowser/demo/virtual/Table.js 2009-01-30 14:11:54 UTC (rev 17497) @@ -57,7 +57,24 @@ scroller.pane.addLayer(new qx.ui.virtual.layer.Row("white", "#EEE")); scroller.pane.addLayer(new qx.ui.virtual.layer.GridLines("horizontal")); scroller.pane.addLayer(new qx.ui.virtual.layer.GridLines("vertical")); - scroller.pane.addLayer(new qx.ui.virtual.layer.Test()); - } + scroller.pane.addLayer(new qx.ui.virtual.layer.HtmlCell(this)); + }, + + + getCellHtml : function(row, col, left, top, width, height) + { + var html = [ + "<div style='", + "float: left;", + "text-align: center;", + this._fontCss, + "width:", width, "px;", + "height:", height, "px;", + "'>", + col + "x" + row, + "</div>" + ]; + return html.join(""); + } } }); Modified: trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/Test.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/Test.js 2009-01-30 14:03:55 UTC (rev 17496) +++ trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/Test.js 2009-01-30 14:11:54 UTC (rev 17497) @@ -40,12 +40,12 @@ var html = []; var left = 0; var top = 0; - var row = visibleCells.firstRow; - var col = visibleCells.firstColumn; + var row = firstRow; + var col = firstColumn; for (var x=0; x<rowSizes.length; x++) { var left = 0; - var col = visibleCells.firstColumn; + var col = firstColumn; for(var y=0; y<columnSizes.length; y++) { var color = (row+col) % 2 == 0 ? "blue" : "yellow"; Modified: trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/TestRelative.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/TestRelative.js 2009-01-30 14:03:55 UTC (rev 17496) +++ trunk/qooxdoo/framework/source/class/qx/ui/virtual/layer/TestRelative.js 2009-01-30 14:11:54 UTC (rev 17497) @@ -40,12 +40,12 @@ var html = []; var left = 0; var top = 0; - var row = visibleCells.firstRow; - var col = visibleCells.firstColumn; + var row = firstRow; + var col = firstColumn; for (var x=0; x<rowSizes.length; x++) { var left = 0; - var col = visibleCells.firstColumn; + var col = firstColumn; for(var y=0; y<columnSizes.length; y++) { var color = (row+col) % 2 == 0 ? "blue" : "yellow"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |