Revision: 4657
          http://sourceforge.net/p/vexi/code/4657
Author:   mkpg2
Date:     2014-02-07 03:08:20 +0000 (Fri, 07 Feb 2014)
Log Message:
-----------
Timefield feature - 'minsIncrement' property. 
- more/less increments/decrements by this amount
- rounds down to closest multiple of the increment (for invalid typed input)

Modified Paths:
--------------
    
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/timefield.t
    branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/timefield.t

Modified: 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/timefield.t
===================================================================
--- 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/timefield.t
    2014-02-07 01:53:37 UTC (rev 4656)
+++ 
branches/vexi3/org.vexi-vexi.widgets/src_main/org/vexi/theme/classic/timefield.t
    2014-02-07 03:08:20 UTC (rev 4657)
@@ -117,6 +117,7 @@
             }
         }; 
         
+        thisbox.minsIncrement = 1;
         
         $more.action ++= function(v) {
             if (hours==null or mins==null) {
@@ -130,8 +131,8 @@
                     hours = hours+1;
                 }
             } else if (selected == $mins) {
-                if(loop!=false || (59>mins || 23>hours)){
-                    mins = mins+1;
+                if(loop!=false || ((60-minsIncrement)>mins || 23>hours)){
+                    mins = mins+minsIncrement;
                 }
             }
             value = value;
@@ -150,8 +151,8 @@
                     hours = hours-1;
                 }
             } else if (selected == $mins) {
-                if(loop!=false || hours>0 || mins>0){
-                    mins = mins-1;
+                if(loop!=false || hours>0 || mins>=minsIncrement){
+                    mins = mins-minsIncrement;
                 }
             }
             value = value;
@@ -409,6 +410,10 @@
                 trapee.mins = m;
                 //trapee.secs = s;
             }
+            
+            while(trapee.mins % trapee.minsIncrement){
+                trapee.mins -=1;            
+            }
         } catch (e) { throw "unsupported text value for timefield: '"+v+"'"; }
         return;
     }

Modified: branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/timefield.t
===================================================================
--- branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/timefield.t      
2014-02-07 01:53:37 UTC (rev 4656)
+++ branches/vexi3/org.vexi-vexi.widgets/src_poke/poke/widgets/timefield.t      
2014-02-07 03:08:20 UTC (rev 4657)
@@ -6,6 +6,7 @@
         <w:timefield id="time1" />
         <w:timefield id="time2" default="00:00" loop="false"/>
         <w:timefield id="time3" default="23:59" loop="false"/>
+        <w:timefield id="time4" default="02:00" minsIncrement="15" />
         
         vexi.ui.frame = thisbox;
         

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


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to