summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TWebControl.php
diff options
context:
space:
mode:
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));
}