Revision: 1913
          http://svn.sourceforge.net/vexi/?rev=1913&view=rev
Author:   clrg
Date:     2007-07-03 10:37:32 -0700 (Tue, 03 Jul 2007)

Log Message:
-----------
Create lib.role.draggable
- restore draggable slider functionality
- add hand cursor

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

Added Paths:
-----------
    widgets/trunk/org.vexi.widgets/src/org/vexi/lib/role/draggable.t

Added: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/role/draggable.t
===================================================================
(Binary files differ)


Property changes on: 
widgets/trunk/org.vexi.widgets/src/org/vexi/lib/role/draggable.t
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/slider.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/slider.t     
2007-07-03 16:20:25 UTC (rev 1912)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/lib/widget/slider.t     
2007-07-03 17:37:32 UTC (rev 1913)
@@ -4,7 +4,8 @@
     <meta:doc>
         <author>Charles Goodwin</author>
     </meta:doc>
-
+    
+    <draggable />
     <polarizable />
     <ui:box enabled="true">
         
@@ -23,9 +24,20 @@
         thisbox.numsteps = 10;      // the number of steps
         thisbox.traplock = false;   // lock for firing traps
         
+        var syncStep = function()
+        {
+            step = vexi.math.round(numsteps *
+                (surface.mouse[pos] -
+                    vexi.math.abs(surface.distanceto(th_track)[pos]) -
+                        th_handle[dim]/2) / (th_track[dim] - th_handle[dim]));
+        }
+        
+        // draggable integration
+        thisbox.moveFunc = function(v) { cascade = v; syncStep(); }
+        thisbox.Press1 ++= thisbox.moveFunc;
+        
         // assign static trap functions
         KeyPressed ++= static.keypressFunc;
-        Press1     ++= static.pressFunc;
         interval   ++= static.syncLimits;
         min        ++= static.syncLimits;
         max        ++= static.syncLimits;
@@ -34,18 +46,6 @@
         value      ++= static.valueWriteFunc;
         width      ++= static.widthFunc;
         
-        /** set step based on mouse position */
-        thisbox.moveFunc = function(v)
-        {
-            step = vexi.math.round(numsteps *
-                (surface.mouse[pos] -
-                    vexi.math.abs(surface.distanceto(th_track)[pos]) -
-                        th_handle[dim]/2) / (th_track[dim] - th_handle[dim]));
-        }
-        
-        // assign local trap function
-        Press1 ++= moveFunc;
-        
     </ui:box>
     
     /** adjust step on keypress */
@@ -56,20 +56,6 @@
         cascade = v;
     }
     
-    /** invoke handle dragging */
-    static.pressFunc = function(v)
-    {
-        trapee.surface.addMoveTrap(trapee.moveFunc);
-        var mf = trapee.moveFunc;
-        var ts = trapee.surface;
-        trapee.surface.Release1 ++= function(v)
-        {
-            ts.delMoveTrap(mf);
-            ts.Release1 --= callee;
-        }
-        cascade = v;
-    }
-    
     /** move handle based on new step value */
     static.stepFunc = function(v)
     {

Modified: widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/slider.t
===================================================================
--- widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/slider.t    
2007-07-03 16:20:25 UTC (rev 1912)
+++ widgets/trunk/org.vexi.widgets/src/org/vexi/theme/win2k/slider.t    
2007-07-03 17:37:32 UTC (rev 1913)
@@ -7,8 +7,8 @@
     
     <lib:slider orient="horizontal">
         <ui:box id="track" layout="absolute">
-            <focusborder id="focus">
-                <bevel id="bevel" form="down" vshrink="true" />
+            <focusborder id="focus" cursor="hand">
+                <bevel id="bevel" form="down" vshrink="true" align="center" />
             </focusborder>
             <ui:box id="handle" align="topleft" shrink="true" />
         </ui:box>


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
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to