summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TWebControl.php
diff options
context:
space:
mode:
authorxue <>2005-12-31 15:23:57 +0000
committerxue <>2005-12-31 15:23:57 +0000
commit5479507cbdcbc14685a443b1096171b5134f82bf (patch)
tree9c8d3028407e7c54c813ea76b048a6a4ec680319 /framework/Web/UI/WebControls/TWebControl.php
parent16c588209ce9197f13f343c83145446c4d92822a (diff)
Refactored TPanel by adding TPanelStyle.
Added TPanel samples.
Diffstat (limited to 'framework/Web/UI/WebControls/TWebControl.php')
-rw-r--r--framework/Web/UI/WebControls/TWebControl.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php
index 4f20b227..6e2a2c89 100644
--- a/framework/Web/UI/WebControls/TWebControl.php
+++ b/framework/Web/UI/WebControls/TWebControl.php
@@ -211,6 +211,15 @@ class TWebControl extends TControl
}
/**
+ * Creates a style object to be used by the control.
+ * This method may be overriden by controls to provide customized style.
+ */
+ protected function createStyle()
+ {
+ return new TStyle;
+ }
+
+ /**
* @return TStyle the object representing the css style of the control
*/
public function getStyle()
@@ -219,7 +228,7 @@ class TWebControl extends TControl
return $style;
else
{
- $style=new TStyle;
+ $style=$this->createStyle();
$this->setViewState('Style',$style,null);
return $style;
}
@@ -234,7 +243,7 @@ class TWebControl extends TControl
public function setStyle($value)
{
if(is_string($value))
- $this->getStyle()->setStyle($value);
+ $this->getStyle()->setCustomStyle($value);
else
throw new TInvalidDataValueException('webcontrol_style_invalid',get_class($this));
}