Revision: 1940
          http://svn.sourceforge.net/vexi/?rev=1940&view=rev
Author:   clrg
Date:     2007-07-07 09:33:41 -0700 (Sat, 07 Jul 2007)

Log Message:
-----------
More text widget modifications
- fix textfield and label
- drop $text box from edit (use thisbox)
- some clean up of lib.text.word

Modified Paths:
--------------
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/default.t
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/edit.t
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/word.t
    widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/label.t
    widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/textfield.t
    widgets/trunk/org.vexi.widgets/src/vexi/widget/label.t

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/default.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/default.t      
2007-07-07 16:02:56 UTC (rev 1939)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/default.t      
2007-07-07 16:33:41 UTC (rev 1940)
@@ -88,6 +88,8 @@
             $cursor.repeat = v;
         }
         
+        $edit.height ++= function(v) { cascade = v; minheight = v; }
+        
         thisbox.cursorcolor ++= function(v) { $cursor.fill = v; }
         
         vexi..vexi.util.redirect..addRedirect(thisbox, $edit, "multiline");

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/edit.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2007-07-07 
16:02:56 UTC (rev 1939)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/edit.t 2007-07-07 
16:33:41 UTC (rev 1940)
@@ -86,8 +86,7 @@
         </details>
     </meta:doc>
         
-    <ui:box layout="absolute">
-        <ui:box id="text" align="topleft" orient="vertical" vshrink="true" />
+    <ui:box orient="vertical" vshrink="true">
 
         // use vars for encapsulation and efficiency
         
@@ -172,7 +171,7 @@
         }
         
         /** assign relevant traps/functions to new blocks */
-        $text.Children ++= function(c)
+        thisbox.Children ++= function(c)
         {
             if (c != null)
             {
@@ -210,9 +209,9 @@
             select = true;
             
             // calculate block indice
-            var abi = $text.indexof(aBlock);
-            var cbi = $text.indexof(cBlock);
-            var sbi = $text.indexof(sBlock);
+            var abi = thisbox.indexof(aBlock);
+            var cbi = thisbox.indexof(cBlock);
+            var sbi = thisbox.indexof(sBlock);
             
             // calculate word indice
             var awi = aWord==null?0:aBlock.indexof(aWord);
@@ -238,7 +237,7 @@
                     if (s2a)
                     {
                         if (sWord!=null and aWord==sWord) 
sWord.partialHighlight(sPos, aPos);
-                        else static.highlightForwards($text, cbi, cwi, 
(cWord==sWord)?sPos:null, abi, awi, aPos, s2a); 
+                        else static.highlightForwards(thisbox, cbi, cwi, 
(cWord==sWord)?sPos:null, abi, awi, aPos, s2a); 
                     }
                     // - s2a==false, deselect
                     else
@@ -246,7 +245,7 @@
                         if (sWord!=null and cWord==sWord) 
sWord.partialHighlight(aPos, sPos);
                         else
                         {
-                            static.highlightForwards($text, cbi, cwi, null, 
abi, awi, aPos, s2a);
+                            static.highlightForwards(thisbox, cbi, cwi, null, 
abi, awi, aPos, s2a);
                             if (sWord!=null and aWord==sWord) 
sWord.partialHighlight(aPos, sPos);
                         }
                     }
@@ -260,7 +259,7 @@
                         if (sWord!=null and cWord==sWord) 
sWord.partialHighlight(sPos, aPos);
                         else
                         {
-                            static.highlightBackwards($text, cbi, cwi, null, 
abi, awi, (aWord==sWord)?sPos:aPos, !s2a);
+                            static.highlightBackwards(thisbox, cbi, cwi, null, 
abi, awi, (aWord==sWord)?sPos:aPos, !s2a);
                             if (sWord!=null and aWord==sWord) 
sWord.partialHighlight(sPos, aPos);
                         }
                     }
@@ -268,7 +267,7 @@
                     else
                     {
                         if (sWord!=null and aWord==sWord) 
sWord.partialHighlight(aPos, sPos);
-                        else static.highlightBackwards($text, cbi, cwi, 
(cWord==sWord)?sPos:null, abi, awi, aPos, !s2a);
+                        else static.highlightBackwards(thisbox, cbi, cwi, 
(cWord==sWord)?sPos:null, abi, awi, aPos, !s2a);
                     }
                 }
             }
@@ -278,14 +277,14 @@
                 // forwards
                 if (c2a)
                 {
-                    if (sWord!=null and cWord!=sWord) 
static.highlightForwards($text, cbi, cwi, null, sbi, swi-1, null, false);
-                    static.highlightForwards($text, sbi, swi, sPos, abi, awi, 
aPos, true);
+                    if (sWord!=null and cWord!=sWord) 
static.highlightForwards(thisbox, cbi, cwi, null, sbi, swi-1, null, false);
+                    static.highlightForwards(thisbox, sbi, swi, sPos, abi, 
awi, aPos, true);
                 }
                 // backwards
                 else
                 {
-                    if (sWord!=null and cWord!=sWord) 
static.highlightBackwards($text, cbi, cwi, null, sbi, swi+1, null, false);
-                    static.highlightBackwards($text, sbi, swi, sPos, abi, awi, 
aPos, true);
+                    if (sWord!=null and cWord!=sWord) 
static.highlightBackwards(thisbox, cbi, cwi, null, sbi, swi+1, null, false);
+                    static.highlightBackwards(thisbox, sbi, swi, sPos, abi, 
awi, aPos, true);
                 }
             }
             // update c* now highlighting is complete
@@ -309,8 +308,8 @@
             cursorLock = true;
             
             // block indice
-            var cbi = $text.indexof(cBlock);
-            var sbi = $text.indexof(sBlock);
+            var cbi = thisbox.indexof(cBlock);
+            var sbi = thisbox.indexof(sBlock);
             
             // word indice
             var cwi = cWord==null?0:cBlock.indexof(cWord);
@@ -334,18 +333,18 @@
             if (cbi>sbi)
             {
                 // sbi
-                while ($text[sbi][swi+1]) $text[sbi][swi+1] = null;
+                while (thisbox[sbi][swi+1]) thisbox[sbi][swi+1] = null;
                 
                 // intervening blocks
                 while (cbi>sbi+1)
                 {
-                    $text[sbi+1] = null;
+                    thisbox[sbi+1] = null;
                     cbi--;
                 }
                 // cbi
                 while (cwi>0)
                 {
-                    $text[cbi][0] = null;
+                    thisbox[cbi][0] = null;
                     cwi--;
                 }
                 // combine cBlock/sBlock
@@ -432,8 +431,8 @@
         var getSelectedText = function()
         {
             // block indice
-            var cbi = $text.indexof(cBlock);
-            var sbi = $text.indexof(sBlock);
+            var cbi = thisbox.indexof(cBlock);
+            var sbi = thisbox.indexof(sBlock);
             
             // word indice
             var cwi = cWord==null?0:cBlock.indexof(cWord);
@@ -481,11 +480,11 @@
                     str = str + _sw.text.substring(_sp);
                     str = str + static.getTextFromWord(_sb, _sb.indexof(_sw)) 
+ '\n';
                 }
-                if ($text.indexof(_cb) > $text.indexof(_sb)+1)
+                if (thisbox.indexof(_cb) > thisbox.indexof(_sb)+1)
                 {
-                    var b2 = $text.indexof(_cb);
-                    for (var b = $text.indexof(_sb)+1; b2 > b; b++)
-                        str = str + $text[b].text + '\n';
+                    var b2 = thisbox.indexof(_cb);
+                    for (var b = thisbox.indexof(_sb)+1; b2 > b; b++)
+                        str = str + thisbox[b].text + '\n';
                 }
                 if (_cw)
                 {
@@ -518,7 +517,7 @@
             
             var cwi = cWord ? cBlock.indexof(cWord) : 0;
             var cwt = cWord ? cWord.text : "";
-            var cbi = $text.indexof(cBlock);
+            var cbi = thisbox.indexof(cBlock);
             var cps = cPos;
             var head = "";
             var tail = "";
@@ -569,7 +568,7 @@
                 {
                     tmpb = newblock;
                     tmpb.text = blocks[i];
-                    $text[cbi+i] = tmpb;
+                    thisbox[cbi+i] = tmpb;
                 }
                 // second part of cBlock
                 tmpb = newblock;
@@ -577,7 +576,7 @@
                 cwi = tmpb.numchildren ? tmpb.numchildren-1 : 0;
                 cwt = tmpb[cwi] ? tmpb[cwi].text : "";
                 tmpb.text = blocks[blocks.length-1] + tail;
-                $text[cbi+i] = tmpb;
+                thisbox[cbi+i] = tmpb;
                 cBlock = tmpb;
                 cWord = tmpb[cwi];
                 cPos = cWord ? cWord.text.length : 0;
@@ -589,7 +588,7 @@
         {
             if (select)
             {
-                var sbInd = $text.indexof(sBlock);
+                var sbInd = thisbox.indexof(sBlock);
                 var swInd = sWord ? sBlock.indexof(sWord) : 0;
                 unselectAll();
                 if (cbInd > sbInd)
@@ -615,7 +614,7 @@
         {
             if (select)
             {
-                var sbInd = $text.indexof(sBlock);
+                var sbInd = thisbox.indexof(sBlock);
                 var swInd = sWord ? sBlock.indexof(sWord) : 0;
                 unselectAll();
                 if (sbInd > cbInd)
@@ -679,10 +678,10 @@
                     // mouse is above aBlock
                     if (dY > aY)
                     {
-                        var i = $text.indexof(aBlock);
+                        var i = thisbox.indexof(aBlock);
                         for (i--; i >= 0; i--)
                         {
-                            aBlock = $text[i];
+                            aBlock = thisbox[i];
                             dY -= aBlock.height;
                             if (aY > dY) break;
                         }
@@ -696,16 +695,16 @@
                     // mouse is below aBlock
                     else if (aY > dY+aBlock.height)
                     {
-                        var n = $text.numchildren;
+                        var n = thisbox.numchildren;
                         dY += aBlock.height;
-                        var i = $text.indexof(aBlock);
+                        var i = thisbox.indexof(aBlock);
                         for (i++; n > i; i++)
                         {
-                            aBlock = $text[i];
+                            aBlock = thisbox[i];
                             dY += aBlock.height;
                             if (dY > aY) break;
                         }
-                        if (i == $text.numchildren)
+                        if (i == thisbox.numchildren)
                         {
                             aWord = aBlock.numchildren ? 
aBlock[aBlock.numchildren-1] : null;
                             aPos = aWord ? aWord.text.length : 0;
@@ -949,8 +948,8 @@
             // actions
             else
             {
-                // the index of cBlock in $text
-                cbInd = $text.indexof(cBlock);
+                // the index of cBlock in thisbox
+                cbInd = thisbox.indexof(cBlock);
                 
                 switch(v)
                 {
@@ -999,17 +998,17 @@
                     if (vexi.ui.key.control)
                     {
                         if (cWord and cWord.text.length>cPos) cwInd--;
-                        OUT:while ($text[cbInd])
+                        OUT:while (thisbox[cbInd])
                         {
-                            while ($text[cbInd][++cwInd])
+                            while (thisbox[cbInd][++cwInd])
                             {
-                                if ($text[cbInd][cwInd].whitespace) continue;
+                                if (thisbox[cbInd][cwInd].whitespace) continue;
                                 else break OUT;
                             }
                             cbInd++;
-                            cwInd = $text.numchildren>cbInd ? -1 : 
$text[cbInd-1].numchildren-1;
+                            cwInd = thisbox.numchildren>cbInd ? -1 : 
thisbox[cbInd-1].numchildren-1;
                         }
-                        aBlock = $text.numchildren>cbInd ? $text[cbInd] : 
$text[$text.numchildren-1];
+                        aBlock = thisbox.numchildren>cbInd ? thisbox[cbInd] : 
thisbox[thisbox.numchildren-1];
                         if (aBlock.numchildren-1 > cwInd)
                         {
                             aWord = aBlock[cwInd+1];
@@ -1038,7 +1037,7 @@
                                     aWord = aBlock[cwInd+1];
                                 }
                             }
-                            else if ($text.numchildren-1 > cbInd)
+                            else if (thisbox.numchildren-1 > cbInd)
                                 aWord = null;
                             else aPos--;
                         }
@@ -1046,9 +1045,9 @@
                         // find the next available legal position
                         if (!aWord)
                         {
-                            if ($text.indexof(aBlock) != $text.numchildren-1)
+                            if (thisbox.indexof(aBlock) != 
thisbox.numchildren-1)
                             {
-                                aBlock = $text[$text.indexof(aBlock)+1];
+                                aBlock = thisbox[thisbox.indexof(aBlock)+1];
                                 aPos = 0;
                                 aWord = aBlock.numchildren ? aBlock[0] : null;
                             }
@@ -1077,18 +1076,18 @@
                     {
                         // force skipping to start of cWord if cursor is 
mid-word
                         if (cWord and cPos>0) cwInd++;
-                        OUT:while ($text[cbInd])
+                        OUT:while (thisbox[cbInd])
                         {
-                            while ($text[cbInd][--cwInd])
+                            while (thisbox[cbInd][--cwInd])
                             {
-                                if ($text[cbInd][cwInd].whitespace) continue;
+                                if (thisbox[cbInd][cwInd].whitespace) continue;
                                 else break OUT;
                             }
                             cbInd--;
-                            cwInd = (cbInd>=0) ? $text[cbInd].numchildren : 0;
+                            cwInd = (cbInd>=0) ? thisbox[cbInd].numchildren : 
0;
                         }
                         if (0>cbInd) return;
-                        aBlock = $text[cbInd];
+                        aBlock = thisbox[cbInd];
                         aWord = aBlock[cwInd];
                         aPos = 0;
                     }
@@ -1105,7 +1104,7 @@
                             {
                                 if (cbInd > 0)
                                 {
-                                    aBlock = $text[cbInd-1];
+                                    aBlock = thisbox[cbInd-1];
                                     aWord = aBlock.numchildren ? 
aBlock[aBlock.numchildren-1] : null;
                                     aPos = aWord ? aWord.text.length : 0;
                                 }
@@ -1121,7 +1120,7 @@
                                 }
                                 else if (cbInd>0)
                                 {
-                                    aBlock = $text[cbInd-1];
+                                    aBlock = thisbox[cbInd-1];
                                     aWord = aBlock.numchildren ? 
aBlock[aBlock.numchildren-1] : null;
                                     aPos = aWord ? aWord.text.length : 0;
                                 }
@@ -1153,7 +1152,7 @@
                         {
                             if (!cWord or (cwInd == 0 and cPos == 0)) cbInd--;
                             if (0 > cbInd) cbInd = 0;
-                            aBlock = $text[cbInd];
+                            aBlock = thisbox[cbInd];
                             aWord = aBlock[0];
                             aPos = 0;
                         }
@@ -1174,9 +1173,9 @@
                         // next line upwards is in previous block
                         else if (cbInd > 0)
                         {
-                            if ($text[cbInd-1].numchildren)
+                            if (thisbox[cbInd-1].numchildren)
                             {
-                                var nblock = $text[cbInd-1];
+                                var nblock = thisbox[cbInd-1];
                                 var i = nblock.numchildren-1;
                                 var ly = nblock[i].y;
                                 while (i>0 and nblock[i-1].y == ly and 
nblock[i].x > cOffset) i--;
@@ -1187,7 +1186,7 @@
                             // no words in next block
                             else
                             {
-                                aBlock = $text[cbInd-1];
+                                aBlock = thisbox[cbInd-1];
                                 aWord = null;
                                 aPos = 0;
                             }
@@ -1218,8 +1217,8 @@
                         if (vexi.ui.key.control)
                         {
                             if (!cWord or (cBlock.numchildren-1 == cwInd and 
(cWord?cWord.text.length:0) == cPos)) cbInd++;
-                            if (cbInd >= $text.numchildren) cbInd = 
$text.numchildren-1;
-                            aBlock = $text[cbInd];
+                            if (cbInd >= thisbox.numchildren) cbInd = 
thisbox.numchildren-1;
+                            aBlock = thisbox[cbInd];
                             aWord = aBlock[aBlock.numchildren-1];
                             aPos = aWord?aWord.text.length:0;
                         }
@@ -1243,11 +1242,11 @@
                             }
                         }
                         // next line is in next block
-                        else if ($text.numchildren-1 > cbInd)
+                        else if (thisbox.numchildren-1 > cbInd)
                         {
-                            if ($text[cbInd+1].numchildren)
+                            if (thisbox[cbInd+1].numchildren)
                             {
-                                var nblock = $text[cbInd+1];
+                                var nblock = thisbox[cbInd+1];
                                 var i = 0;
                                 while (nblock[i] and nblock[i].y == 0 and 
(cOffset > nblock[i].x+nblock[i].width)) i++;
                                 if (!nblock[i] or (cOffset > 
nblock[i].x+nblock[i].width))
@@ -1266,7 +1265,7 @@
                             // no words in next block
                             else
                             {
-                                aBlock = $text[cbInd+1];
+                                aBlock = thisbox[cbInd+1];
                                 aWord = null;
                                 aPos = 0;
                             }
@@ -1377,7 +1376,7 @@
                                 cWord.text = cWord.text.substring(0, cPos);
                             }
                         }
-                        $text[cbInd+1] = nblock;
+                        thisbox[cbInd+1] = nblock;
                         cBlock.reflow();
                         nblock.reflow();
                         cBlock = nblock;
@@ -1402,25 +1401,25 @@
                         // at the end of a block
                         if (cPos == cWord.text.length)
                         {
-                            if ($text.numchildren-1 > cbInd)
+                            if (thisbox.numchildren-1 > cbInd)
                             {
                                 // increment cbInd as we're interested in the 
next block
                                 cbInd++;
                                 
-                                // combine blocks by taking words from 
$text[cbInd]
-                                if (cBlock.numchildren > 
$text[cbInd].numchildren)
+                                // combine blocks by taking words from 
thisbox[cbInd]
+                                if (cBlock.numchildren > 
thisbox[cbInd].numchildren)
                                 {
-                                    while ($text[cbInd].numchildren)
-                                        cBlock[cBlock.numchildren] = 
$text[cbInd][0];
-                                    $text[cbInd].thisbox = null;
+                                    while (thisbox[cbInd].numchildren)
+                                        cBlock[cBlock.numchildren] = 
thisbox[cbInd][0];
+                                    thisbox[cbInd].thisbox = null;
                                 }
                                 // combine blocks by taking words from cBlock
                                 else
                                 {
                                     while (cBlock.numchildren)
-                                        $text[cbInd][0] = 
cBlock[cBlock.numchildren-1];
+                                        thisbox[cbInd][0] = 
cBlock[cBlock.numchildren-1];
                                     cBlock.thisbox = null;
-                                    cBlock = $text[cbInd-1];    // -1 as 
cBlock was just deleted
+                                    cBlock = thisbox[cbInd-1];    // -1 as 
cBlock was just deleted
                                     cwInd = cBlock.indexof(cWord);
                                 }
                                 // combine same-type words if together
@@ -1466,10 +1465,10 @@
                         }
                     }
                     // no word in this block, try and remove it
-                    else if ($text.numchildren-1 > cbInd)
+                    else if (thisbox.numchildren-1 > cbInd)
                     {
                         cBlock.thisbox = null;
-                        cBlock = $text[cbInd];
+                        cBlock = thisbox[cbInd];
                         cPos = 0;
                         cWord = cBlock.numchildren ? cBlock[0] : null;
                     }
@@ -1494,20 +1493,20 @@
                                     // decrement cbInd as we're interested in 
the prior block
                                     --cbInd;
                                     
-                                    // combine blocks by taking words from 
$text[cbInd]
-                                    if (cBlock.numchildren > 
$text[cbInd].numchildren)
+                                    // combine blocks by taking words from 
thisbox[cbInd]
+                                    if (cBlock.numchildren > 
thisbox[cbInd].numchildren)
                                     {
-                                        while ($text[cbInd].numchildren)
-                                            cBlock[0] = 
$text[cbInd][$text[cbInd].numchildren-1];
-                                        $text[cbInd].thisbox = null;
+                                        while (thisbox[cbInd].numchildren)
+                                            cBlock[0] = 
thisbox[cbInd][thisbox[cbInd].numchildren-1];
+                                        thisbox[cbInd].thisbox = null;
                                     }
                                     // combine blocks by taking words from 
cBlock
                                     else
                                     {
                                         while (cBlock.numchildren)
-                                            
$text[cbInd][$text[cbInd].numchildren] = cBlock[0];
+                                            
thisbox[cbInd][thisbox[cbInd].numchildren] = cBlock[0];
                                         cBlock.thisbox = null;
-                                        cBlock = $text[cbInd];
+                                        cBlock = thisbox[cbInd];
                                     }
                                     
                                     // combine same-type words if together
@@ -1576,7 +1575,7 @@
                         if (cbInd > 0)
                         {
                             cBlock.thisbox = null;
-                            cBlock = $text[cbInd-1];
+                            cBlock = thisbox[cbInd-1];
                             cWord = cBlock.numchildren ? 
cBlock[cBlock.numchildren-1] : null;
                             cPos = cWord ? cWord.text.length : 0;
                         }
@@ -1652,13 +1651,13 @@
         {
             abortTip = true;
             select = true;
-            sBlock = $text[0];
+            sBlock = thisbox[0];
             sWord = sBlock[0];
             sPos = 0;
-            cBlock = $text[$text.numchildren-1];
+            cBlock = thisbox[thisbox.numchildren-1];
             cWord = cBlock[cBlock.numchildren-1];
             cPos = cWord==null?0:cWord.text.length;
-            static.highlightForwards($text, 0, 0, 0, $text.numchildren-1, 
cBlock.numchildren-1, null, true);
+            static.highlightForwards(thisbox, 0, 0, 0, thisbox.numchildren-1, 
cBlock.numchildren-1, null, true);
         }
         
         /** unselects all selected words */
@@ -1671,8 +1670,8 @@
             cursorLock = true;
             
             // block indice
-            var cbi = $text.indexof(cBlock);
-            var sbi = $text.indexof(sBlock);
+            var cbi = thisbox.indexof(cBlock);
+            var sbi = thisbox.indexof(sBlock);
             // FIXME: should not happen - occurs with empty edits
             if (sbi == -1) return;
             
@@ -1682,8 +1681,8 @@
             
             // fire highlight funcs
             if ((cbi==sbi and cwi>swi) or cbi>sbi)
-                static.highlightForwards($text, sbi, swi, null, cbi, cwi, 
null, false);
-            else static.highlightBackwards($text, sbi, swi, null, cbi, cwi, 
null, false);
+                static.highlightForwards(thisbox, sbi, swi, null, cbi, cwi, 
null, false);
+            else static.highlightBackwards(thisbox, sbi, swi, null, cbi, cwi, 
null, false);
             
             // reset select
             select = false;
@@ -1708,7 +1707,7 @@
             if (v)
             {
                 // find block to place cursor in
-                if (!cBlock) if (numchildren) cBlock = $text[0];
+                if (!cBlock) if (numchildren) cBlock = thisbox[0];
                 // reset cursor if not already placed
                 if (cBlock) if (!cWord) cPos = 0;
             }
@@ -1719,8 +1718,8 @@
         thisbox.multiline ++= function(v)
         {
             if (v)
-                               for (var i=0; $text.numchildren>i; i++)
-                                   $text[i].multiline = true;
+                               for (var i=0; thisbox.numchildren>i; i++)
+                                   thisbox[i].multiline = true;
                        // FEATURE: support single-multi-single switching
             if (!v) cascade = multiline;
             else cascade = v;
@@ -1732,17 +1731,17 @@
             var ret = "";
             
             // special case for first line
-            for (var j=0; $text[0][j] != null; j++)
-                ret += $text[0][j].text;
+            for (var j=0; thisbox[0][j] != null; j++)
+                ret += thisbox[0][j].text;
             
             // build up with newlines for multiline
             if (multiline)
             {
-                for (var i=1; $text[i] != null; i++)
+                for (var i=1; thisbox[i] != null; i++)
                 {
                     ret += "\n";
-                    for (var j=0; $text[i][j] != null; j++)
-                        ret += $text[i][j].text;
+                    for (var j=0; thisbox[i][j] != null; j++)
+                        ret += thisbox[i][j].text;
                 }
             }
             
@@ -1760,8 +1759,8 @@
             else if (t == null or t == "")
             {
                 cascade = null;
-                while ($text[0]) $text[0] = null;
-                $text[0] = newblock;
+                while (thisbox[0]) thisbox[0] = null;
+                thisbox[0] = newblock;
             }
             // normal text put
             else
@@ -1777,8 +1776,8 @@
                     var numblocks = blocks.length;
                     for (var i=0; numblocks>i; i++)
                     {
-                        if (!$text[i]) $text[i] = newblock;
-                        var b = $text[i];
+                        if (!thisbox[i]) thisbox[i] = newblock;
+                        var b = thisbox[i];
                         b.text = blocks[i];
                         b.wrapwidth = wrapwidth;
                         if (b.font != font)           b.font = font;
@@ -1787,14 +1786,14 @@
                         if (b.textcolor != textcolor) b.textcolor = textcolor;
                     }
                     // clean up left-over blocks
-                    while ($text[numblocks]) $text[numblocks] = null;
+                    while (thisbox[numblocks]) thisbox[numblocks] = null;
                 }
                 // singleline
-                else $text[0].text = t;
+                else thisbox[0].text = t;
             }
             
             // reset the cursor
-            cBlock = $text[0];
+            cBlock = thisbox[0];
             cWord = cBlock[0];
             cPos = 0;
             syncCursorAndOffset(true);
@@ -1804,8 +1803,8 @@
         var propagateToBlocks = function(v)
         {
             cascade = v;
-            for (var i=0; $text.numchildren > i; i++)
-                if ($text[i][trapname] != v) $text[i][trapname] = v;
+            for (var i=0; thisbox.numchildren > i; i++)
+                if (thisbox[i][trapname] != v) thisbox[i][trapname] = v;
         }
         
         // assign trap functions
@@ -1816,8 +1815,8 @@
         thisbox.wrapwidth ++= propagateToBlocks;
         
         // initialize the empty edit widget
-        $text[0] = newblock;
-        cBlock = $text[0];
+        thisbox[0] = newblock;
+        cBlock = thisbox[0];
         mBlock = cBlock;
         
     </ui:box>

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/word.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/word.t 2007-07-07 
16:02:56 UTC (rev 1939)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/text/word.t 2007-07-07 
16:33:41 UTC (rev 1940)
@@ -24,15 +24,14 @@
         thisbox.parent = null;      // parent block containing this word
         
         // assign static functions to properties
-        align       ++= static.alignFunc;
-        valign      ++= static.valignFunc;
-        highlight   ++= static.highlightFunc;
-        font        ++= static.fontFunc;
-        fontsize    ++= static.fontFunc;
-        textcolor   ++= static.textcolorFunc;
-        text        ++= static.textReadFunc;
-        text        ++= static.textWriteFunc;
-        parent      ++= static.parentFunc;
+        align     ++= static.alignFunc;
+        valign    ++= static.valignFunc;
+        highlight ++= static.highlightFunc;
+        font      ++= static.fontFunc;
+        fontsize  ++= static.fontFunc;
+        textcolor ++= static.textcolorFunc;
+        text      ++= static.textReadFunc;
+        text      ++= static.textWriteFunc;
         
         /** do a partial highlight
          *  - c1 - start character
@@ -46,20 +45,20 @@
                 highlight = true;
                 return;
             }
-            else
-            {
-                $o.textcolor = parent.highlightcolor;
-                $o.fill = parent.highlightfill;
-                $t.textcolor = textcolor;
-                $t.fill = null;
-            }
             
             // more specific highlight required
             if (c1 == null) c1 = 0;
             if (c2 == null) c2 = $t.text.length;
+            // no highlight required
             if (c1 == c2) { $o.display = false; return; }
+            
+            $o.textcolor = parent.highlightcolor;
+            $o.fill = parent.highlightfill;
+            $t.textcolor = textcolor;
+            $t.fill = null;
+            
             $o.text = $t.text.substring(c1, c2);
-            $o.x = c1==0?0:vexi.ui.font.width(font, fontsize, 
$t.text.substring(0, c1));
+            $o.x = vexi.ui.font.width(font, fontsize, $t.text.substring(0, 
c1));
             
             // foreground the background so it can contain text
             $o.display = true;
@@ -108,14 +107,6 @@
         trapee[0][trapname] = v; trapee[0][0][trapname] = v;
     }
     
-    /** change certain things when moved to a new edit */
-    static.parentFunc = function(v)
-    {
-        cascade = v;
-        trapee[0][0].fill = v.highlightfill;
-        trapee[0][0].color = v.highlightcolor;
-    }
-    
     /** return textual content from internal text-box */
     static.textReadFunc = function() { return trapee[0].text; }
     

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/label.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/label.t     
2007-07-07 16:02:56 UTC (rev 1939)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/label.t     
2007-07-07 16:33:41 UTC (rev 1940)
@@ -5,13 +5,11 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <default />
-    <ui:box enabled="false">
+    <default enabled="false" multiline="true">
         
-        th_edit.multiline = true;
         th_edit.syncCursor = static.syncCursor;
         
-    </ui:box>
+    </default>
     
     static.syncCursor = function() { return true; }
     

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/textfield.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/textfield.t 
2007-07-07 16:02:56 UTC (rev 1939)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/textfield.t 
2007-07-07 16:33:41 UTC (rev 1940)
@@ -23,7 +23,7 @@
         thisbox.enabled ++= static.enabledFunc;
         
         /** keep viewport right height */
-        $edit.height ++= function(v) { vexi.log.info("??" + v); 
th_viewport.height = v; cascade = v; }
+        $pad.height ++= function(v) { th_viewport.height = v; cascade = v; }
         
     </bevel>
     

Modified: widgets/trunk/org.vexi.widgets/src/vexi/widget/label.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/vexi/widget/label.t      2007-07-07 
16:02:56 UTC (rev 1939)
+++ widgets/trunk/org.vexi.widgets/src/vexi/widget/label.t      2007-07-07 
16:33:41 UTC (rev 1940)
@@ -5,14 +5,14 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <ui:box text-align="left" vshrink="true">
+    <ui:box vshrink="true">
         <pad id="margin">
             <pad id="pad">
                 <label id="widget" />
             </pad>
         </pad>
         
-        rdrt..addRedirect(thisbox, $widget, "orient", "layout", "font", 
"fontsize", "text", "textcolor", "enabled", "focused", "KeyPressed");
+        rdrt..addRedirect(thisbox, $widget.th_edit, "font", "fontsize", 
"text", "textcolor", "enabled", "focused", "KeyPressed");
         rdrt..addRedirect(thisbox, $margin, "margin", "marginleft", 
"marginright", "margintop", "marginbottom");
         rdrt..addRedirect(thisbox, $pad, "fill", "padding", "paddingleft", 
"paddingright", "paddingtop", "paddingbottom");
         


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to