web/lib/Zend/Dojo/Form/Element/NumberSpinner.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Dojo
    16  * @package    Zend_Dojo
    17  * @subpackage Form_Element
    17  * @subpackage Form_Element
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  */
    20  */
    21 
    21 
    22 /** Zend_Dojo_Form_Element_ValidationTextBox */
    22 /** Zend_Dojo_Form_Element_ValidationTextBox */
    23 require_once 'Zend/Dojo/Form/Element/ValidationTextBox.php';
    23 require_once 'Zend/Dojo/Form/Element/ValidationTextBox.php';
    26  * NumberSpinner dijit
    26  * NumberSpinner dijit
    27  *
    27  *
    28  * @uses       Zend_Dojo_Form_Element_ValidationTextBox
    28  * @uses       Zend_Dojo_Form_Element_ValidationTextBox
    29  * @package    Zend_Dojo
    29  * @package    Zend_Dojo
    30  * @subpackage Form_Element
    30  * @subpackage Form_Element
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    31  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  * @version    $Id: NumberSpinner.php 20096 2010-01-06 02:05:09Z bkarwin $
    33  * @version    $Id: NumberSpinner.php 24593 2012-01-05 20:35:02Z matthew $
    34  */
    34  */
    35 class Zend_Dojo_Form_Element_NumberSpinner extends Zend_Dojo_Form_Element_ValidationTextBox
    35 class Zend_Dojo_Form_Element_NumberSpinner extends Zend_Dojo_Form_Element_ValidationTextBox
    36 {
    36 {
    37     /**
    37     /**
    38      * Use NumberSpinner dijit view helper
    38      * Use NumberSpinner dijit view helper
    90      * @param  int $delta
    90      * @param  int $delta
    91      * @return Zend_Dojo_Form_Element_NumberSpinner
    91      * @return Zend_Dojo_Form_Element_NumberSpinner
    92      */
    92      */
    93     public function setLargeDelta($delta)
    93     public function setLargeDelta($delta)
    94     {
    94     {
    95         $this->setDijitParam('largeDelta', (int) $delta);
    95         $this->setDijitParam('largeDelta', (float) $delta);
    96         return $this;
    96         return $this;
    97     }
    97     }
    98 
    98 
    99     /**
    99     /**
   100      * Retrieve largeDelta
   100      * Retrieve largeDelta
   112      * @param  int $delta
   112      * @param  int $delta
   113      * @return Zend_Dojo_Form_Element_NumberSpinner
   113      * @return Zend_Dojo_Form_Element_NumberSpinner
   114      */
   114      */
   115     public function setSmallDelta($delta)
   115     public function setSmallDelta($delta)
   116     {
   116     {
   117         $this->setDijitParam('smallDelta', (int) $delta);
   117         $this->setDijitParam('smallDelta', (float) $delta);
   118         return $this;
   118         return $this;
   119     }
   119     }
   120 
   120 
   121     /**
   121     /**
   122      * Retrieve smallDelta
   122      * Retrieve smallDelta
   185     {
   185     {
   186         $constraints = array();
   186         $constraints = array();
   187         if ($this->hasDijitParam('constraints')) {
   187         if ($this->hasDijitParam('constraints')) {
   188             $constraints = $this->getDijitParam('constraints');
   188             $constraints = $this->getDijitParam('constraints');
   189         }
   189         }
   190         $constraints['min'] = (int) $value;
   190         $constraints['min'] = (float) $value;
   191         $this->setDijitParam('constraints', $constraints);
   191         $this->setDijitParam('constraints', $constraints);
   192         return $this;
   192         return $this;
   193     }
   193     }
   194 
   194 
   195     /**
   195     /**
   219     {
   219     {
   220         $constraints = array();
   220         $constraints = array();
   221         if ($this->hasDijitParam('constraints')) {
   221         if ($this->hasDijitParam('constraints')) {
   222             $constraints = $this->getDijitParam('constraints');
   222             $constraints = $this->getDijitParam('constraints');
   223         }
   223         }
   224         $constraints['max'] = (int) $value;
   224         $constraints['max'] = (float) $value;
   225         $this->setDijitParam('constraints', $constraints);
   225         $this->setDijitParam('constraints', $constraints);
   226         return $this;
   226         return $this;
   227     }
   227     }
   228 
   228 
   229     /**
   229     /**