summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TStyle.php
diff options
context:
space:
mode:
authorxue <>2006-02-03 06:11:57 +0000
committerxue <>2006-02-03 06:11:57 +0000
commit0efe2d3e9e02ada6fe297af823b90fa967de85df (patch)
treec286c9af063072bf9f9aa6dd0edd6031fb12eef4 /framework/Web/UI/WebControls/TStyle.php
parent13b32e41bbda0a22bc0d886841a210dbf7c13b3a (diff)
Added TCheckBoxColumn.
Diffstat (limited to 'framework/Web/UI/WebControls/TStyle.php')
-rw-r--r--framework/Web/UI/WebControls/TStyle.php28
1 files changed, 21 insertions, 7 deletions
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index fd92df8a..fa3bcb28 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -45,6 +45,15 @@ class TStyle extends TComponent
private $_customStyle=null;
/**
+ * Constructor.
+ * @param TStyle style to copy from
+ */
+ public function __construct($style=null)
+ {
+ $this->copyFrom($style);
+ }
+
+ /**
* @return string the background color of the control
*/
public function getBackColor()
@@ -260,7 +269,6 @@ class TStyle extends TComponent
*/
public function reset()
{
- parent::reset();
$this->_fields=array();
$this->_font=null;
$this->_class=null;
@@ -274,9 +282,9 @@ class TStyle extends TComponent
*/
public function copyFrom($style)
{
- if($style!==null)
+ $this->reset();
+ if($style instanceof TStyle)
{
- $this->reset();
$this->_fields=$style->_fields;
$this->_class=$style->_class;
$this->_customStyle=$style->_customStyle;
@@ -295,9 +303,12 @@ class TStyle extends TComponent
{
if($style!==null)
{
+ //$this->_fields=array_merge($this->_fields,$style->_fields);
$this->_fields=array_merge($style->_fields,$this->_fields);
if($this->_class===null)
$this->_class=$style->_class;
+ if($this->_customStyle===null)
+ $this->_customStyle=$style->_customStyle;
if($this->_font===null && $style->_font!==null)
$this->getFont()->mergeWith($style->_font);
}
@@ -309,7 +320,7 @@ class TStyle extends TComponent
*/
public function addAttributesToRender($writer)
{
- if($this->_customStyle!=='')
+ if($this->_customStyle!==null)
{
foreach(explode(';',$this->_customStyle) as $style)
{
@@ -594,9 +605,12 @@ class TTableItemStyle extends TStyle
public function copyFrom($style)
{
parent::copyFrom($style);
- $this->_verticalAlign=$style->_verticalAlign;
- $this->_horizontalAlign=$style->_horizontalAlign;
- $this->_wrap=$style->_wrap;
+ if($style instanceof TTableItemStyle)
+ {
+ $this->_verticalAlign=$style->_verticalAlign;
+ $this->_horizontalAlign=$style->_horizontalAlign;
+ $this->_wrap=$style->_wrap;
+ }
}
/**