Revision: 1895
          http://svn.sourceforge.net/vexi/?rev=1895&view=rev
Author:   clrg
Date:     2007-06-28 14:29:03 -0700 (Thu, 28 Jun 2007)

Log Message:
-----------
Now the menu widgets parse without error (though probably do not work)

Modified Paths:
--------------
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/submenu.t
    widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/submenu.t

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/submenu.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/submenu.t    
2007-06-28 21:21:54 UTC (rev 1894)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/submenu.t    
2007-06-28 21:29:03 UTC (rev 1895)
@@ -16,10 +16,27 @@
         thisbox.th_content = null;
         thisbox.th_list = null;
         
-        /** set up content */
+        var lockChildren = false;
+        
+        /** th_content write trap */
         th_content ++= function(v)
         {
-            v.ChildAdded ++= function(c) { th_list[th_list.numchildren] = c; }
+            v.Children ++= function(c)
+            {
+                // if locked, spoof put from th_list is in action
+                if (lockChildren) return;
+                // otherwise redirect child put to th_list
+                lockChildren = true;
+                th_list[th_list.numchildren] = c;
+                lockChildren = false;
+                // never complete the put
+                return;
+            }
+            
+            v.Children ++= function()
+            {
+                return th_list[arguments.index];
+            }
         }
         
         /** popdown menu when a menu item is fired */
@@ -28,12 +45,19 @@
         /** set up submenu item list */
         th_list ++= function(v)
         {
-            v.ChildAdded ++= function(c)
+            v.Children ++= function(c)
             {
+                cascade = c;
                 if (itemgroup) c.group = itemgroup;
                 else itemgroup = c.group;
                 c.level = level+1;
                 c.action ++= childActionFunc;
+                // if locked, put has been redirected here from th_content
+                if (lockChildren) return;
+                // otherwise spoof the put back to th_content
+                lockChildren = true;
+                th_content[arguments.index] = c;
+                lockChildren = false;
             }
         }
         

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/submenu.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/submenu.t   
2007-06-28 21:21:54 UTC (rev 1894)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/submenu.t   
2007-06-28 21:29:03 UTC (rev 1895)
@@ -13,7 +13,7 @@
         <ui:box id="name" />
         <ui:box id="arrow" fill=".image.arrowright" shrink="true" />
         <bevel id="popbox" form="above" shrink="true">
-            <ui:box id="content" cols="1" fill="#d4d0c8" />
+            <ui:box id="content" orient="vertical" fill="#d4d0c8" />
         </bevel>
         
         thisbox.th_arrow  = $arrow;


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
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to