Revision: 2286
          http://vexi.svn.sourceforge.net/vexi/?rev=2286&view=rev
Author:   clrg
Date:     2007-09-20 11:44:32 -0700 (Thu, 20 Sep 2007)

Log Message:
-----------
Fix trees some more

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/tree.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/tree.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/tree.t       
2007-09-20 18:42:09 UTC (rev 2285)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/tree.t       
2007-09-20 18:44:32 UTC (rev 2286)
@@ -5,9 +5,8 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <clickable />
     <selectable />
-    <ui:box enabled="true">
+    <ui:box>
         
         thisbox.th_content = null;
         thisbox.th_expand = null;
@@ -20,33 +19,25 @@
         
         var flipDisplayFunc = function(v) { th_expand.display = 
!th_expand.display; cascade = v; }
         
-        thisbox.th_content ++= function(v)
-        {
+        thisbox.th_content ++= function(v) {
             cascade = v;
-            th_content.Children ++= function(c)
-            {
-                if (c and c.v_istree)
-                {
+            th_content.Children ++= function(c) {
+                if (c and c.v_istree) {
                     c.v_isroot = false;
-                    if (groupref)
-                    {
+                    if (groupref) {
                         var prevtree = th_content[arguments.trapname];
                         // easy case 1: insert into a group of nodes
                         if (prevtree) prevtree = 
groupref.members.before(prevtree);
                         // easy case 2: no nodes in this tree
                         else if (!th_content.numchildren) prevtree = thisbox;
                         // need to find last node (nodes may be trees)
-                        else
-                        {
+                        else {
                             var node = thisbox;
                             prevtree = thisbox;
-                            for (var i=thisbox.numchildren-1; i>=0; i--)
-                            {
-                               if (node[i].v_istree)
-                               {
+                            for (var i=thisbox.numchildren-1; i>=0; i--) {
+                               if (node[i].v_istree) {
                                    prevtree = node[i].v_self;
-                                   if (node[i].numchildren)
-                                   {
+                                   if (node[i].numchildren) {
                                        node = node[i];
                                        // reset i, no -1 due to for loop i--
                                        i = node.numchildren;
@@ -58,25 +49,19 @@
                         if (c.v_self.groupref)
                             groupref.merge(c.v_self.groupref, prevtree);
                         // c has no group - insert it
-                        else
-                        {
+                        else {
                             c.v_self.groupref = groupref;
                             groupref.members.insert(c.v_self, prevtree);
                         }
-                    }
-                    else
-                    {
-                        if (c.v_self.groupref)
-                        {
+                    } else {
+                        if (c.v_self.groupref) {
                             groupref = c.v_self.groupref;
                             groupref.members.unshift(thisbox);
-                        }
-                        else c.group = group;
+                        } else c.group = group;
                     }
                 }
                 var _c = trapee[arguments.trapname];
-                if (c == null and _c != null)
-                {
+                if (c == null and _c != null) {
                     _c.v_isroot = true;
                     if (_c.v_istree) _c.group = null;
                 }
@@ -89,17 +74,16 @@
         
         thisbox.th_title ++= function(v) { cascade = v; v.DoubleClick1 ++= 
flipDisplayFunc; }
         
-        thisbox.KeyPressed ++= function(v)
-        {
+        thisbox.KeyPressed ++= function(v) {
             if (v == "left") th_expand.display = false;
             else if (v == "right") { if (th_content.numchildren) 
th_expand.display = true; }
             else cascade = v;
         }
         
         /** override action write trap in selectable */
-        thisbox.action ++= function(v)
-        {
-            if (th_node.mouse.inside) cascade = v; else return;
+        thisbox.th_node ++= function(n) {
+            cascade = n;
+            n.Press1 ++= function(v) { selected = true; cascade = v; }
         }
         
         thisbox.focused ++= function(v) { if (v) selected = true; cascade = v; 
}


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to