Revision: 2129
          http://vexi.svn.sourceforge.net/vexi/?rev=2129&view=rev
Author:   clrg
Date:     2007-09-06 07:48:10 -0700 (Thu, 06 Sep 2007)

Log Message:
-----------
Fix a few heinous splitpane issues (infinite loops, dividers not added)

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

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/splitpane.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/splitpane.t  
2007-09-06 00:37:16 UTC (rev 2128)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/splitpane.t  
2007-09-06 14:48:10 UTC (rev 2129)
@@ -156,27 +156,15 @@
         /** update dividers when orient changes */
         orient ++= function(v)
         {
-            if (v == "h" or v == "horizontal")
+            var addFunc = v == "horizontal" ? xPressFunc : yPressFunc;
+            var remFunc = v == "horizontal" ? yPressFunc : xPressFunc;
+            th_holding.orient = v;
+            for (var i=1; th_holding.numchildren > i; i+=2)
             {
-                th_holding.orient = "horizontal";
-                for (var i=1; th_holding.numchildren > i; i+2)
-                {
-                    th_holding[i].orient = "vertical";
-                    th_holding[i].Press1 ++= xPressFunc;
-                    th_holding[i].Press1 --= yPressFunc;
-                }
+                th_holding[i].orient = flip(v);
+                th_holding[i].Press1 ++= addFunc;
+                th_holding[i].Press1 --= remFunc;
             }
-            else
-            {
-                th_holding.orient = "vertical";
-                for (var i=1; th_holding.numchildren > i; i+2)
-                {
-                    th_holding[i].orient = "horizontal";
-                    th_holding[i].Press1 --= xPressFunc;
-                    th_holding[i].Press1 ++= yPressFunc;
-                }
-            }
-            
             cascade = v;
         }
         
@@ -196,10 +184,11 @@
                 if (c != null)
                 {
                     // set up divider
-                    if (th_content.numchildren>0)
+                    var d = null;
+                    if (th_holding.numchildren>0)
                     {
-                        var d = newdiv(vexi.box);
-                        if (orient == "h" or orient == "horizontal")
+                        d = newdiv(vexi.box);
+                        if (orient == "horizontal")
                         {
                             d.orient = "vertical";
                             d.Press1 ++= xPressFunc;
@@ -215,6 +204,7 @@
                     th_holding[i*2] = c;
                     if (d and i == 0) th_holding[1] = d;
                     if (!master) master = c;
+                    cascade = vexi.box;
                     return;
                 }
                 
@@ -231,7 +221,7 @@
                 if (i == 0) th_holding[1] = null;
                 th_holding[i*2] = null;
                 if (i != 0) th_holding[i*2-1] = null;
-                return;
+                cascade = null;
             }
             
             cascade = v;

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/divider.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/divider.t   
2007-09-06 00:37:16 UTC (rev 2128)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/divider.t   
2007-09-06 14:48:10 UTC (rev 2129)
@@ -5,14 +5,14 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <divider vshrink="true">
+    <divider type="divider">
         <ui:box align="center" width="6" height="6">
             <ui:box fill="rivets" />
         </ui:box>
         
         orient ++= function(v)
         {
-            if (v == "vertical" or v == "v")
+            if (v == "vertical")
             {
                 hshrink = true;
                 vshrink = false;
@@ -27,7 +27,7 @@
         
         active ++= function(v) { cascade = v; fill = v ? "#e4e0d8" : 
"#d4d0c8"; }
         Enter  ++= function(v) { cascade = v; fill = "#e4e0d8"; }
-        Leave  ++= function(v) { cascade = v; if (!active) fill = "#d4d0c8"; }
+        Leave  ++= function(v) { cascade = v; if (!active) fill = "#d4d0c8"; }s
         
     </divider>
 </vexi>

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/splitpane.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/splitpane.t 
2007-09-06 00:37:16 UTC (rev 2128)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/splitpane.t 
2007-09-06 14:48:10 UTC (rev 2129)
@@ -5,7 +5,7 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <splitpane redirect="$content" layout="place">
+    <splitpane redirect="$content" layout="place" type="splitpane">
         <ui:box id="content" display="false" />
         <ui:box id="holding" />
         <ui:box id="marker" display="false" fill="black" minwidth="2" 
minheight="2" />

Modified: trunk/widgets/org.vexi.widgets/src/vexi/widget/splitpane.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/vexi/widget/splitpane.t  2007-09-06 
00:37:16 UTC (rev 2128)
+++ trunk/widgets/org.vexi.widgets/src/vexi/widget/splitpane.t  2007-09-06 
14:48:10 UTC (rev 2129)
@@ -11,18 +11,5 @@
         </usage>
     </meta:doc>
     
-    <ui:box redirect="$widget" orient="horizontal" type="splitpane">
-        <lay:margin id="margin">
-            <splitpane id="widget" />
-        </lay:margin>
-        
-        // glue code
-        
-        rdrt..addRedirect(thisbox, $margin, "margin", "marginleft", 
"marginright", "margintop", "marginbottom");
-        rdrt..addRedirect(thisbox, $widget, "fill", "liveresize", "master", 
"orient");
-        
-        if ($widget.margin) $margin.margin = $widget.margin;
-        if ($widget.padding) $pad.padding = $widget.padding;
-        
-    </ui:box>
+    <splitpane id="widget" />
 </vexi>


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to