From 56fee292c37e162c03fab9eeadd6a8b9ab85c251 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 4 Sep 2006 19:15:47 +0000 Subject: merge from 3.0 branch till 1387 --- framework/Web/UI/WebControls/TCheckBox.php | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'framework/Web/UI/WebControls/TCheckBox.php') diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index c938950d..84138ffe 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -147,19 +147,19 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl } /** - * @return string the alignment (Left or Right) of the text caption, defaults to Right. + * @return TTextAlign the alignment (Left or Right) of the text caption, defaults to TTextAlign::Right. */ public function getTextAlign() { - return $this->getViewState('TextAlign','Right'); + return $this->getViewState('TextAlign',TTextAlign::Right); } /** - * @param string the alignment of the text caption. Valid values include Left and Right. + * @param TTextAlign the alignment of the text caption. Valid values include Left and Right. */ public function setTextAlign($value) { - $this->setViewState('TextAlign',TPropertyValue::ensureEnum($value,array('Left','Right')),'Right'); + $this->setViewState('TextAlign',TPropertyValue::ensureEnum($value,'TTextAlign'),TTextAlign::Right); } /** @@ -270,7 +270,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl $clientID=$this->getClientID(); if(($text=$this->getText())!=='') { - if($this->getTextAlign()==='Left') + if($this->getTextAlign()===TTextAlign::Left) { $this->renderLabel($writer,$clientID,$text); $this->renderInputTag($writer,$clientID,$onclick); @@ -422,4 +422,23 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl } +/** + * TTextAlign class. + * TTextAlign defines the enumerable type for the possible text alignments + * + * The following enumerable values are defined: + * - Left: left aligned + * - Right: right aligned + * + * @author Qiang Xue + * @version $Revision: $ $Date: $ + * @package System.Web.UI.WebControls + * @since 3.0.4 + */ +class TTextAlign extends TEnumerable +{ + const Left='Left'; + const Right='Right'; +} + ?> -- cgit v1.2.3