Revision: 4271
          http://vexi.svn.sourceforge.net/vexi/?rev=4271&view=rev
Author:   clrg
Date:     2011-10-06 13:24:22 +0000 (Thu, 06 Oct 2011)
Log Message:
-----------
Grid fix - perform layout when added to an already visible surface

Modified Paths:
--------------
    trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t
    trunk/org.vexi-vexi.widgets/src_main/vexi/layout/grid.t

Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t     
2011-10-06 03:11:50 UTC (rev 4270)
+++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/layout/grid.t     
2011-10-06 13:24:22 UTC (rev 4271)
@@ -1,4 +1,4 @@
-<!-- Copyright 2009 - see COPYING for details [LGPL] -->
+<!-- Copyright 2011 - see COPYING for details [LGPL] -->
 
 <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="vexi.util">
     <meta:doc>
@@ -590,6 +590,13 @@
             pack_children = false;
         }
         
+        var gridLayout = function() {
+            if (pack_children)
+                pack();
+            else if (place_width or place_height)
+                place(place_width, place_height);
+        }
+        
         /**
          * carry out packing/placing in a separate thread to avoid the
          * build up of repeated packing/placing when adding multiple
@@ -602,11 +609,7 @@
             scheduled = true;
             vexi.thread = function() {
                 scheduled = false;
-                if (pack_children) {
-                    pack();
-                } else if (place_width or place_height) {
-                    place(place_width, place_height);
-                }
+                gridLayout();
             }
         }
         
@@ -791,19 +794,15 @@
         thisbox.cols ++= function() { return numcols; }
         thisbox.rows ++= function() { return numrows; }
         
-        thisbox.forcepack = function() {
-            pack();
-            pack_children = false;
+        thisbox.reflow ++= function() {
+            var normalReflow = cascade;
+            return function() { normalReflow(); gridLayout(); };
         }
         
         thisbox.visible ++= function(v) {
             cascade = v;
             activegrid = v;
-            if (v) {
-                place_width = true;
-                place_height = true;
-                schedule();
-            }
+            gridLayout();
         }
         
     </ui:box>

Modified: trunk/org.vexi-vexi.widgets/src_main/vexi/layout/grid.t
===================================================================
--- trunk/org.vexi-vexi.widgets/src_main/vexi/layout/grid.t     2011-10-06 
03:11:50 UTC (rev 4270)
+++ trunk/org.vexi-vexi.widgets/src_main/vexi/layout/grid.t     2011-10-06 
13:24:22 UTC (rev 4271)
@@ -1,4 +1,4 @@
-<!-- Copyright 2009 - see COPYING for details [LGPL] -->
+<!-- Copyright 2011 - see COPYING for details [LGPL] -->
 
 <vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" 
xmlns="org.vexi.lib.layout">
     <meta:doc>

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to