[qooxdoo-commit] SF.net SVN: qooxdoo:[15237] trunk/qooxdoo
Brought to you by:
ecker,
martinwittemann
From: <de...@us...> - 2008-08-05 17:22:46
|
Revision: 15237 http://qooxdoo.svn.sourceforge.net/qooxdoo/?rev=15237&view=rev Author: derrell Date: 2008-08-05 17:22:37 +0000 (Tue, 05 Aug 2008) Log Message: ----------- getLayoutChildren needs to return children if not just calculating widths Modified Paths: -------------- trunk/qooxdoo/framework/source/class/qx/ui/progressive/Progressive.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Abstract.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Progress.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/TableHeading.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/Row.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Default.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Icon.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/String.js trunk/qooxdoo/framework/source/class/qx/ui/progressive/structure/Default.js Added Paths: ----------- trunk/qooxdoo/frontend/ trunk/qooxdoo/frontend/framework/ trunk/qooxdoo/frontend/framework/source/ trunk/qooxdoo/frontend/framework/source/class/ trunk/qooxdoo/frontend/framework/source/class/qx/ trunk/qooxdoo/frontend/framework/source/class/qx/ui/ trunk/qooxdoo/frontend/framework/source/class/qx/ui/progressive/ trunk/qooxdoo/frontend/framework/source/class/qx/ui/progressive/headfoot/ trunk/qooxdoo/frontend/framework/source/class/qx/ui/progressive/headfoot/TODO Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/Progressive.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/Progressive.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/Progressive.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -58,6 +58,7 @@ // Prepare to have our pane structure added to us. this.set( { +/* left : 20, top : 20, right : 20, @@ -65,6 +66,7 @@ spacing : 0, border : new qx.ui.decoration.Single(1, "solid", "#dddddd"), overflow : "hidden", +*/ backgroundColor : "white" }); Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Abstract.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Abstract.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Abstract.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -34,7 +34,7 @@ construct : function() { - this.base(arguments, new qx.ui.layout.VBox()); + this.base(arguments, new qx.ui.layout.HBox()); }, members : @@ -52,5 +52,10 @@ { this._progressive = progressive; } + }, + + settings : + { + "qx.tableResizeDebug" : false } }); Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Progress.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Progress.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/Progress.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -131,7 +131,7 @@ */ getLayoutChildren : function() { - return this._columnWidths; + return this._columnWidths.getData(); }, @@ -149,8 +149,8 @@ var width = (! this._progressive.getContainerElement().getDomElement() ? 0 - : this._progressive.getInnerWidth()) - - qx.bom.element.Overflow.getScrollbarSize(); + : this._progressive.getBounds().width) - + qx.bom.element.Overflow.getScrollbarWidth(); // Compute the column widths this._layout.renderLayout(width, 100); @@ -158,11 +158,14 @@ // Sum the column widths var width = 0; + // Get the column data + var columnData = this._columnWidths.getData(); + // Determine the total width that we'll need - for (var i = 0; i < this._columnWidths.length; i++) + for (var i = 0; i < columnData.length; i++) { // Cumulate the width - width += this._columnWidths[i].getComputedWidth(); + width += columnData[i].getComputedWidth(); } // Set the width of the progress bar Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/TableHeading.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/TableHeading.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/headfoot/TableHeading.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -46,31 +46,24 @@ this._columnWidths = columnWidths; + // Set a default height for the progress bar this.setHeight(16); - var border = new qx.ui.decoration.Single(1, "solid", "#eeeeee"); - border.setWidthTop(0); - border.setWidthLeft(0); - border.setWidthBottom(2); - border.setColorBottom("#aaaaaa"); - + // Get the array of column width data + var columnData = columnWidths.getData(); + // Create a place to put labels this._labels = [ ]; // For each label... - for (var i = 0; i < columnWidths.length; i++) + for (var i = 0; i < columnData.length; i++) { // ... create an atom to hold the label label = new qx.ui.basic.Atom(labelArr[i]); - // Use the width of the corresponding column - label.setWidth(columnWidths[i].getWidth()); - - // Set borders for the headings - label.setBorder(border); - // Add the label to this heading. this.add(label); +this.warn("Adding label " + label + " (" + labelArr[i] + ") to parent " + this); // Save this label so we can resize it later this._labels[i] = label; @@ -108,7 +101,14 @@ */ getLayoutChildren : function() { - return this._columnWidths; + if (this.__bCalculateWidths) + { + return this._columnWidths.getData(); + } + else + { + return this.getChildren(); + } }, @@ -126,17 +126,24 @@ var width = (! this._progressive.getContainerElement().getDomElement() ? 0 - : this._progressive.getInnerWidth()) - - qx.bom.element.Overflow.getScrollbarSize(); + : this._progressive.getBounds().width) - + qx.bom.element.Overflow.getScrollbarWidth(); // Compute the column widths + this.__bCalculateWidths = true; +this.warn("rendering into width " + width + " with scrollbar width " + qx.bom.element.Overflow.getScrollbarWidth()); this._layout.renderLayout(width, 100); + this.__bCalculateWidths = false; + // Get the column data + var columnData = this._columnWidths.getData(); + // Get the column width data. For each label... - for (var i = 0; i < data.length; i++) + for (var i = 0; i < columnData.length; i++) { +this.warn("resize column " + i + " to " + columnData[i].getComputedWidth()); // ... reset the width of the corresponding column (label) - this._labels[i].setWidth(this._columnWidths[i].getComputedWidth()); + this._labels[i].setWidth(columnData[i].getComputedWidth()); } } } Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/Row.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/Row.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/Row.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -143,16 +143,18 @@ " width : '100%';" + "}"; tr.__clazz[hash].rowstylesheet = - qx.html.StyleSheet.createElement(stylesheet); + qx.bom.Stylesheet.createElement(stylesheet); - for (var i = 0; i < this._columnWidths.getData().length; i++) + var columnData = this._columnWidths.getData(); + + for (var i = 0; i < columnData.length; i++) { var stylesheet = ".qx-progressive-" + hash + "-cell-" + i + " {" + tr.__tableCellStyleSheet + "}"; tr.__clazz[hash].cellstylesheet[i] = - qx.html.StyleSheet.createElement(stylesheet); + qx.bom.Stylesheet.createElement(stylesheet); } // Save the hash too @@ -180,12 +182,13 @@ */ addRenderer : function(column, renderer) { - if (column < 0 || column >= this._columnWidths.length) + var columnData = this._columnWidths.getData(); + if (column < 0 || column >= columnData.length) { throw new Error("Column " + column + " out of range (max: " + - (this._columnWidths.length - 1) + + (columnData.length - 1) + ")"); } @@ -202,12 +205,13 @@ */ removeRenderer : function(column) { - if (column < 0 || column >= this._columnWidths.length) + var columnData = this._columnWidths.getData(); + if (column < 0 || column >= columnData.length) { throw new Error("Column " + column + " out of range (max: " + - (this._columnWidths.length - 1) + + (columnData.length - 1) + ")"); } @@ -346,7 +350,7 @@ */ getLayoutChildren : function() { - return this._columnWidths; + return this._columnWidths.getData(); }, @@ -365,15 +369,15 @@ var width = (! this._progressive.getContainerElement().getDomElement() ? 0 - : this._progressive.getInnerWidth()) - - qx.bom.element.Overflow.getScrollbarSize(); + : this._progressive.getBounds().width) - + qx.bom.element.Overflow.getScrollbarWidth(); // Get the style sheet rule name for this row var stylesheet = ".qx-progressive-" + this._hash + "-row"; // Remove the style rule for this row var tr = qx.ui.progressive.renderer.table.Row; - qx.html.StyleSheet.removeRule(tr.__clazz[this._hash].rowstylesheet, + qx.bom.Stylesheet.removeRule(tr.__clazz[this._hash].rowstylesheet, stylesheet); @@ -381,17 +385,20 @@ var rule = "width: " + width + ";"; // Apply the new rule - qx.html.StyleSheet.addRule(tr.__clazz[this._hash].rowstylesheet, + qx.bom.Stylesheet.addRule(tr.__clazz[this._hash].rowstylesheet, stylesheet, rule); // Compute the column widths this._layout.renderLayout(width, 100); + // Get the column data + var columnData = this._columnWidths.getData(); + // Reset each of the column style sheets to deal with width changes for (var i = 0, left = 0; - i < this._columnWidths.length; + i < columnData.length; i++, left += width) { @@ -400,11 +407,11 @@ // Remove the style rule for this column var tr = qx.ui.progressive.renderer.table.Row; - qx.html.StyleSheet.removeRule(tr.__clazz[this._hash].cellstylesheet[i], + qx.bom.Stylesheet.removeRule(tr.__clazz[this._hash].cellstylesheet[i], stylesheet); // Get this column width. - width = this._columnWidths[i].getComputedWidth(); + width = columnData[i].getComputedWidth(); if (qx.core.Variant.isSet("qx.debug", "on")) { @@ -421,7 +428,7 @@ "width: " + width + ";"; // Apply the new rule - qx.html.StyleSheet.addRule(tr.__clazz[this._hash].cellstylesheet[i], + qx.bom.Stylesheet.addRule(tr.__clazz[this._hash].cellstylesheet[i], stylesheet, rule); } @@ -454,7 +461,7 @@ // Remove the style rule for this row var tr = qx.ui.progressive.renderer.table.Row; - qx.html.StyleSheet.removeRule(tr.__clazz[this._hash].rowstylesheet, + qx.bom.Stylesheet.removeRule(tr.__clazz[this._hash].rowstylesheet, stylesheet); } @@ -470,7 +477,7 @@ // Remove the style rule for this column var tr = qx.ui.progressive.renderer.table.Row; - qx.html.StyleSheet.removeRule(rule, stylesheet); + qx.bom.Stylesheet.removeRule(rule, stylesheet); } } } Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Default.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Default.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Default.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -44,7 +44,7 @@ // overridden _getContentHtml : function(cellInfo) { - return qx.html.String.escape(this._formatValue(cellInfo.cellData)); + return qx.bom.String.escape(this._formatValue(cellInfo.cellData)); }, Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Icon.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Icon.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/Icon.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -100,7 +100,7 @@ _getContentHtml : function(cellInfo) { - return qx.html.String.escape(this._formatValue(cellInfo.cellData)); + return qx.bom.String.escape(this._formatValue(cellInfo.cellData)); }, Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/String.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/String.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/renderer/table/cell/String.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -44,7 +44,7 @@ // overridden _getContentHtml : function(cellInfo) { - return qx.html.String.escape(cellInfo.cellData); + return qx.bom.String.escape(cellInfo.cellData); } } }); Modified: trunk/qooxdoo/framework/source/class/qx/ui/progressive/structure/Default.js =================================================================== --- trunk/qooxdoo/framework/source/class/qx/ui/progressive/structure/Default.js 2008-08-05 17:20:48 UTC (rev 15236) +++ trunk/qooxdoo/framework/source/class/qx/ui/progressive/structure/Default.js 2008-08-05 17:22:37 UTC (rev 15237) @@ -73,9 +73,12 @@ this._footer.join(progressive); // Add the header, pane, and footer to the Progressive. - progressive.add(this._header); - progressive.add(this._pane, { flex : 1 }); - progressive.add(this._footer); + progressive.add(this._header, { }); +this.warn("Added header " + this._header + " to " + progressive); + progressive.add(this._pane, { flex: 1 }); +this.warn("Added pane " + this._pane + " to " + progressive); + progressive.add(this._footer, { }); +this.warn("Added footer " + this._footer + " to " + progressive); }, getHeader : function() Added: trunk/qooxdoo/frontend/framework/source/class/qx/ui/progressive/headfoot/TODO =================================================================== --- trunk/qooxdoo/frontend/framework/source/class/qx/ui/progressive/headfoot/TODO (rev 0) +++ trunk/qooxdoo/frontend/framework/source/class/qx/ui/progressive/headfoot/TODO 2008-08-05 17:22:37 UTC (rev 15237) @@ -0,0 +1 @@ +dispose VBox used in Composite This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |