Revision: 2960
          http://vexi.svn.sourceforge.net/vexi/?rev=2960&view=rev
Author:   clrg
Date:     2008-07-08 19:06:45 -0700 (Tue, 08 Jul 2008)

Log Message:
-----------
Fix frontier not being correctly sorted when packing grids + test stuff

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/layout/grid.t
    trunk/widgets/org.vexi.widgets/src_dev/test/grid/ex1.t

Added Paths:
-----------
    trunk/widgets/org.vexi.widgets/src_dev/test/basic.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/layout/grid.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/layout/grid.t       
2008-07-08 14:39:26 UTC (rev 2959)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/layout/grid.t       
2008-07-09 02:06:45 UTC (rev 2960)
@@ -368,8 +368,9 @@
                             frontier.remove(f);
                             f = f0;
                             continue;
+                        }
                         // frontier not accomdating current child, look further
-                        } else if (nextcol+c0.colspan > f0.v_col and 
f0.v_col+f0.colspan > nextcol) {
+                        if (nextcol+c0.colspan > f0.v_col and 
f0.v_col+f0.colspan > nextcol) {
                             // establish next available col
                             nextcol = f0.v_col+f0.colspan;
                             // establish next available row
@@ -387,7 +388,8 @@
                 // add to frontier if we affect the frontier
                 if (c0.rowspan>1) {
                     f = frontier.before(f);
-                    frontier.insert(c, f);
+                    if (f) frontier.insert(c, f);
+                    else frontier.unshift(c);
                 }
                 // place packed child
                 assignSlot(c, nextcol, nextrow);
@@ -430,8 +432,9 @@
                             frontier.remove(f);
                             f = f0;
                             continue;
+                        }
                         // frontier not accomdating current child, look further
-                        } else if (nextrow+c0.rowspan > f0.v_row and 
f0.v_row+f0.rowspan > nextrow) {
+                        if (nextrow+c0.rowspan > f0.v_row and 
f0.v_row+f0.rowspan > nextrow) {
                             // establish next available row
                             nextrow = f0.v_row+f0.rowspan;
                             // establish next available col
@@ -449,7 +452,8 @@
                 // add to frontier if we affect the frontier
                 if (c0.colspan>1) {
                     f = frontier.before(f);
-                    frontier.insert(c, f);
+                    if (f) frontier.insert(c, f);
+                    else frontier.unshift(c);
                 }
                 // place packed child
                 assignSlot(c, nextcol, nextrow);

Added: trunk/widgets/org.vexi.widgets/src_dev/test/basic.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src_dev/test/basic.t                         
(rev 0)
+++ trunk/widgets/org.vexi.widgets/src_dev/test/basic.t 2008-07-09 02:06:45 UTC 
(rev 2960)
@@ -0,0 +1,27 @@
+<vexi xmlns:ui="vexi://ui" xmlns:w="vexi.widget">
+    <w:surface />
+    <ui:box orient="vertical">
+        <ui:box id="widgets" shrink="true">
+            <w:check text="A" id="asdf" />
+            <w:radio text="B" />
+            <w:radio text="C" />
+        </ui:box>
+        <ui:box id="outputs" shrink="true">
+            <ui:box />
+            <ui:box />
+            <ui:box />
+        </ui:box>
+        <w:button id="check" text="Check" />
+        
+        vexi.ui.frame = thisbox;
+        
+        $check.action ++= function(v) {
+            for (var i=0; $widgets.numchildren>i; i++)
+                $outputs[i].text = $widgets[i].value;
+            return;
+        }
+        
+        $asdf.value = null;
+        
+    </ui:box>
+</vexi>
\ No newline at end of file

Modified: trunk/widgets/org.vexi.widgets/src_dev/test/grid/ex1.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src_dev/test/grid/ex1.t      2008-07-08 
14:39:26 UTC (rev 2959)
+++ trunk/widgets/org.vexi.widgets/src_dev/test/grid/ex1.t      2008-07-09 
02:06:45 UTC (rev 2960)
@@ -1,5 +1,5 @@
 <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta"
-    xmlns:lay="vexi.layout" xmlns="test">
+    xmlns:lay="vexi.layout" xmlns="test.grid">
     <ui:box>
         <lay:grid cols="4">
             <block fill="blue" />


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

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to