From b92c81407133d14a92e9587dbcdd3db50ade6434 Mon Sep 17 00:00:00 2001 From: "chanial%noos.fr" Date: Sun, 17 Aug 2003 11:12:36 +0000 Subject: [PATCH] bug 213228: new toolkit independence bug, part 7: update and use the new toolkit widgetry. tree.xml: bug 178604, 156454, 194876, 195393, 202391 by neil, 192346 by kyle yuan, bug 192885, 156576, 202393 by jan. remove the tree constructor, since the #ifdef can be move the pageUpOrDownMovesSelection property definition. --- toolkit/content/widgets/tree.xml | 112 +++++++++++++++---------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/toolkit/content/widgets/tree.xml b/toolkit/content/widgets/tree.xml index 272de46b491..ba93cde00ce 100644 --- a/toolkit/content/widgets/tree.xml +++ b/toolkit/content/widgets/tree.xml @@ -11,7 +11,7 @@ - + @@ -20,12 +20,6 @@ - - this.addEventListener("DOMMouseScroll", this._handleMouseScroll, true); -#ifdef XP_MAC - this.pageUpOrDownMovesSelection = false; -#endif - @@ -44,17 +38,23 @@ +# contentView is obsolete (see bug 202391) +# builderView is obsolete (see bug 202393) +#ifdef XP_MACOSX + false +#else true +#endif -1 @@ -62,10 +62,6 @@ -1 - - true - - - 0 "" @@ -128,7 +107,7 @@ var i; for (i = 0; i < cols.length; ++i) cols[i].setAttribute("ordinal", (i*2)+1); - + // update the ordinal positions of splitters to even numbers, so that // they are in between columns var splitters = this.getElementsByTagName("splitter"); @@ -212,6 +191,17 @@ + + + @@ -288,7 +278,7 @@ 1000) this._incrementalString = key; - else { - if (this._incrementalString.length != 1 || this._incrementalString.charAt(0) != key.charAt(0)) - this._incrementalString += key; - } + else + this._incrementalString += key; this._lastKeyTime = event.timeStamp; + var length = this._incrementalString.length; + var incrementalString = this._incrementalString; + var charIndex = 1; + while (charIndex < length && incrementalString[charIndex] == incrementalString[charIndex - 1]) + charIndex++; + // If all letters in incremental string are same, just try to match the first one + if (charIndex == length) { + length = 1; + incrementalString = incrementalString.substring(0, length); + } + var primarycol = this.treeBoxObject.getKeyColumnIndex(); var colID = this.treeBoxObject.getColumnID(primarycol); var rowCount = this.treeBoxObject.view.rowCount; var start = 1; - if (this._incrementalString.length > 1) { + if (length > 1) { start = 0; if (c < 0) c = 0; @@ -627,8 +626,8 @@ for (var i = 0; i < rowCount; i++) { var l = (i + start + c) % rowCount; var cellText = this.treeBoxObject.view.getCellText(l, colID); - cellText = cellText.toLowerCase(); - if (cellText.search(this._incrementalString) == 0) { + cellText = cellText.substring(0, length).toLowerCase(); + if (cellText == incrementalString) { this.selectionHead = -1; this.selectionTail = -1; this.treeBoxObject.selection.timedSelect(l, this._selectDelay); @@ -642,10 +641,10 @@ - + - + @@ -659,7 +658,7 @@ - + @@ -682,7 +681,7 @@ - + if ("_ensureColumnOrder" in this.parentNode) @@ -698,8 +697,9 @@ click, so that drags work correctly. --> - + this.parentNode.parentNode._columnsDirty = true; @@ -978,7 +978,7 @@ - + @@ -995,11 +995,11 @@ - + - + @@ -1009,7 +1009,7 @@ + extends="chrome://global/content/widgets/tree.xml#tree-base">