summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TCheckBox.php
diff options
context:
space:
mode:
authorxue <>2006-09-04 19:15:47 +0000
committerxue <>2006-09-04 19:15:47 +0000
commit56fee292c37e162c03fab9eeadd6a8b9ab85c251 (patch)
tree923510b93c707868098ae4e5f404eb3766a59553 /framework/Web/UI/WebControls/TCheckBox.php
parentb107cad91733d4a2a80f42cdbaab41a4f7b41c9d (diff)
merge from 3.0 branch till 1387
Diffstat (limited to 'framework/Web/UI/WebControls/TCheckBox.php')
-rw-r--r--framework/Web/UI/WebControls/TCheckBox.php29
1 files changed, 24 insertions, 5 deletions
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 <qiang.xue@gmail.com>
+ * @version $Revision: $ $Date: $
+ * @package System.Web.UI.WebControls
+ * @since 3.0.4
+ */
+class TTextAlign extends TEnumerable
+{
+ const Left='Left';
+ const Right='Right';
+}
+
?>