From e83edc3f20163ac25e2307f9c854e7bc9384970c Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 4 Sep 2006 18:12:17 +0000 Subject: Finished updating code related with enumerable data types. --- framework/Web/UI/WebControls/TButtonColumn.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'framework/Web/UI/WebControls/TButtonColumn.php') diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php index fdcf58d3..5f2c228d 100644 --- a/framework/Web/UI/WebControls/TButtonColumn.php +++ b/framework/Web/UI/WebControls/TButtonColumn.php @@ -152,19 +152,19 @@ class TButtonColumn extends TDataGridColumn } /** - * @return string the type of command button. Defaults to LinkButton. + * @return TButtonColumnType the type of command button. Defaults to TButtonColumnType::LinkButton. */ public function getButtonType() { - return $this->getViewState('ButtonType','LinkButton'); + return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); } /** - * @param string the type of command button, LinkButton, PushButton or ImageButton + * @param TButtonColumnType the type of command button */ public function setButtonType($value) { - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'LinkButton','PushButton','ImageButton'),'LinkButton'); + $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonColumnType'),TButtonColumnType::LinkButton); } /** @@ -230,9 +230,9 @@ class TButtonColumn extends TDataGridColumn if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM || $itemType===TDataGrid::IT_EDITITEM) { $buttonType=$this->getButtonType(); - if($buttonType==='LinkButton') + if($buttonType===TButtonColumnType::LinkButton) $button=new TLinkButton; - else if($buttonType==='PushButton') + else if($buttonType===TButtonColumnType::PushButton) $button=new TButton; else // image button { @@ -243,7 +243,7 @@ class TButtonColumn extends TDataGridColumn $button->setCommandName($this->getCommandName()); $button->setCausesValidation($this->getCausesValidation()); $button->setValidationGroup($this->getValidationGroup()); - if($this->getDataTextField()!=='' || ($buttonType==='ImageButton' && $this->getDataImageUrlField()!=='')) + if($this->getDataTextField()!=='' || ($buttonType===TButtonColumnType::ImageButton && $this->getDataImageUrlField()!=='')) $button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); $cell->getControls()->add($button); $cell->registerObject('Button',$button); -- cgit v1.2.3