From 6228873cf9d6471463d2413e7dfd7447f759baf2 Mon Sep 17 00:00:00 2001 From: "christophe.boulain" <> Date: Wed, 3 Dec 2008 14:22:03 +0000 Subject: Merge from trunk --- framework/Web/UI/WebControls/TDatePicker.php | 46 +++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/WebControls/TDatePicker.php') diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 84455fee..770099eb 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -4,7 +4,7 @@ * * @author Wei Zhuo * @link http://www.pradosoft.com/ - * @copyright Copyright © 2005-2008 PradoSoft + * @copyright Copyright © 2005-2008 PradoSoft * @license http://www.pradosoft.com/license/ * @version $Id$ * @package System.Web.UI.WebControls @@ -59,7 +59,12 @@ Prado::using('System.Web.UI.WebControls.TTextBox'); * In DropDownList mode, in addition to the popup date picker, three * drop down list (day, month and year) are presented to select the date . * + * The PositionMode property can be set to "Top" or "Bottom" with default + * as "Bottom". It specifies the position of the calendar popup, relative to the + * input field. + * * @author Wei Zhuo + * @author Carl G. Mathisen * @version $Id$ * @package System.Web.UI.WebControls * @since 3.0 @@ -263,6 +268,22 @@ class TDatePicker extends TTextBox { return $this->getViewState('UpToYear', intval(@date('Y'))+10); } + + /** + * @param TDatePickerPositionMode calendar UI position + */ + public function setPositionMode($value) + { + $this->setViewState('PositionMode', TPropertyValue::ensureEnum($value, 'TDatePickerPositionMode'), TDatePickerPositionMode::Bottom); + } + + /** + * @return TDatePickerPositionMode current calendar UI position. + */ + public function getPositionMode() + { + return $this->getViewState('PositionMode', TDatePickerPositionMode::Bottom); + } /** * @return integer current selected date from the date picker as timestamp, NULL if timestamp is not set previously. @@ -505,6 +526,7 @@ class TDatePicker extends TTextBox $options['UpToYear'] = $this->getUpToYear(); if($this->getMode()!==TDatePickerMode::Basic) $options['Trigger'] = $this->getDatePickerButtonID(); + $options['PositionMode'] = $this->getPositionMode(); $options = array_merge($options, $this->getCulturalOptions()); if(!is_null($this->_clientScript)) @@ -853,8 +875,8 @@ class TDatePicker extends TTextBox * * The OnDateChanged event is raise when the date picker's date * is changed. - * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent - * as parameter to this event + * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent + * as parameter to this event * * @author Wei Zhuo * @version $Id$ @@ -923,4 +945,20 @@ class TDatePickerMode extends TEnumerable const ImageButton='ImageButton'; } -?> +/** + * TDatePickerPositionMode class. + * TDatePickerPositionMode defines the positions available for the calendar popup, relative to the corresponding input. + * + * The following enumerable values are defined: + * - Top: the date picker is placed above the input field + * - Bottom: the date picker is placed below the input field + * + * @author Carl G. Mathisen + * @package System.Web.UI.WebControls + * @since 3.1.4 + */ +class TDatePickerPositionMode extends TEnumerable +{ + const Top='Top'; + const Bottom='Bottom'; +} \ No newline at end of file -- cgit v1.2.3