Revision: 2132
          http://vexi.svn.sourceforge.net/vexi/?rev=2132&view=rev
Author:   clrg
Date:     2007-09-06 14:17:29 -0700 (Thu, 06 Sep 2007)

Log Message:
-----------
Properly fix up splitpane and add handle effect

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

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 16:05:26 UTC (rev 2131)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/splitpane.t  
2007-09-06 21:17:29 UTC (rev 2132)
@@ -40,7 +40,7 @@
             {
                 tmp_a = dim_a + shift;
                 tmp_b = dim_b - shift;
-                th_marker[pos] = cur_a[pos] + tmp_a - markeroffset;
+                th_marker[pos] = cur_a[pos] + tmp_a + markeroffset;
             }
             cascade = v;
         }
@@ -63,16 +63,17 @@
         /** initiate x dragging on Press */
         var pressFunc = function(v)
         {
+            if (!master) master = th_holding[0];
             var cur = th_holding.indexof(trapee);
             cur_d = trapee;
             cur_d.active = true;
             cur_a = th_holding[cur-1];
             cur_b = th_holding[cur+1];
-            dim_a = cur_a.width;
-            dim_b = cur_b.width;
+            dim_a = cur_a[dim];
+            dim_b = cur_b[dim];
             m_pos = surface.mouse[pos];
             th_marker.display = !liveresize;
-            th_marker[pos] = cur_a[pos] + cur_a[dim] - markeroffset;
+            th_marker[pos] = cur_a[pos] + cur_a[dim] + markeroffset;
             surface.addMoveTrap(moveFunc);
             surface._Release1 ++= releaseFunc;
             cascade = v;
@@ -81,12 +82,12 @@
         /** set up master section */
         master ++= function(v)
         {
-            if (master) master[dim] = master[dim];
+            if (master) master[shr] = true;
             if (v)
             {
                 v[maxdim] = vexi.ui.maxdim;
                 v[mindim] = 0;
-                v.shrink = false;
+                v[shr] = false;
             }
             cascade = v;
         }
@@ -94,10 +95,17 @@
         /** update dividers when orient changes */
         orient ++= function(v)
         {
+            cascade = v;
             th_holding.orient = v;
-            for (var i=1; th_holding.numchildren > i; i+=2)
-                th_holding[i].orient = flip(v);
-            cascade = v;
+            for (var i=0; th_holding.numchildren > i; i++)
+            {
+                if (i%2) th_holding[i].orient = flip(v);
+                else if (th_holding[i] != master)
+                {
+                    th_holding[i][shr] = true;
+                    th_holding[i][flip(shr)] = false;
+                }
+            }
         }
         
         /** set up Children trap */
@@ -126,23 +134,15 @@
                     if (d and i != 0) th_holding[i*2-1] = d;
                     th_holding[i*2] = c;
                     if (d and i == 0) th_holding[1] = d;
-                    if (!master) master = c;
+                    // we rely on boxes being shrunk so slack is assigned to 
master
+                    c[shr] = true;
                     // insert placeholder box
                     cascade = vexi.box;
                     return;
                 }
                 
-                // deal with losing master
-                c = th_holding[i];
-                if (c == master)
-                {
-                    for (var i=0; th_holding.numchildren>i; i+=2)
-                    {
-                        if (v[i].display) master = v[i];
-                        break;
-                    }
-                }
-                if (i == 0) th_holding[1] = null;
+                // remove both child and accompanying dividor
+                if (i == 0 and th_content.numchildren>0) th_holding[1] = null;
                 th_holding[i*2] = null;
                 if (i != 0) th_holding[i*2-1] = null;
                 // remove placeholder box

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 16:05:26 UTC (rev 2131)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/divider.t   
2007-09-06 21:17:29 UTC (rev 2132)
@@ -1,13 +1,13 @@
 <!-- Copyright 2006 - see COPYING for details [LGPL] -->
 
-<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" 
xmlns="org.vexi.lib.widget">
+<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" 
xmlns:lib="org.vexi.lib.widget">
     <meta:doc>
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <divider type="divider">
-        <ui:box align="center" width="6" height="6">
-            <ui:box fill="rivets" />
+    <lib:divider cursor="hand">
+        <ui:box align="center" maxwidth="18" minwidth="6" maxheight="18" 
minheight="6">
+            <ui:box fill=".org.vexi.theme.win2k.image.rivets" />
         </ui:box>
         
         orient ++= function(v)
@@ -29,5 +29,5 @@
         Enter  ++= function(v) { cascade = v; fill = "#e4e0d8"; }
         Leave  ++= function(v) { cascade = v; if (!active) fill = "#d4d0c8"; }s
         
-    </divider>
+    </lib: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 16:05:26 UTC (rev 2131)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/theme/win2k/splitpane.t 
2007-09-06 21:17:29 UTC (rev 2132)
@@ -5,7 +5,7 @@
         <author>Charles Goodwin</author>
     </meta:doc>
     
-    <splitpane redirect="$content" layout="place" type="splitpane">
+    <splitpane redirect="$content" layout="place">
         <ui:box id="content" display="false" />
         <ui:box id="holding" />
         <ui:box id="marker" display="false" fill="black" minwidth="2" 
minheight="2" />
@@ -13,7 +13,7 @@
         thisbox.th_holding = $holding;
         thisbox.th_content = $content;
         thisbox.th_marker = $marker;
-        thisbox.markeroffset = 1;
+        thisbox.markeroffset = 2;
         
         thisbox.orient ++= function(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: 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