summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TWebControl.php
diff options
context:
space:
mode:
authorxue <>2006-01-01 19:48:02 +0000
committerxue <>2006-01-01 19:48:02 +0000
commitc4ffe5fe2b3556f0fcbf6f7a28ef09ce24d06e74 (patch)
treeb1b0fb1378ffb773ad214f1c4f92d5483f05299c /framework/Web/UI/WebControls/TWebControl.php
parent4254b16b792f88a54734192329c32729ded245bb (diff)
Added TDataSourceControl, TDataSourceView, TRepeatInfo.
Diffstat (limited to 'framework/Web/UI/WebControls/TWebControl.php')
-rw-r--r--framework/Web/UI/WebControls/TWebControl.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php
index 6e2a2c89..e86b9161 100644
--- a/framework/Web/UI/WebControls/TWebControl.php
+++ b/framework/Web/UI/WebControls/TWebControl.php
@@ -40,6 +40,23 @@ Prado::using('System.Web.UI.WebControls.TStyle');
class TWebControl extends TControl
{
/**
+ * Copies basic control attributes from another control.
+ * Properties including AccessKey, ToolTip, TabIndex, Enabled
+ * and Attributes are copied.
+ * @param TWebControl source control
+ */
+ public function copyBaseAttributes(TWebControl $control)
+ {
+ $this->setAccessKey($control->getAccessKey());
+ $this->setToolTip($control->getToolTip());
+ $this->setTabIndex($control->getTabIndex());
+ if(!$control->getEnabled())
+ $this->setEnabled(false);
+ if($control->getHasAttributes())
+ $this->getAttributes()->copyFrom($control->getAttributes());
+ }
+
+ /**
* @return string the access key of the control
*/
public function getAccessKey()