## Class TStyle

Description

TStyle class

TStyle encapsulates the CSS style applied to a control.

- since: 3.0
- version: $Id: TStyle.php 1398 2006-09-08 19:31:03Z xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TStyle.php (line 28)

    TComponent
       |
       --TStyle

Direct descendents

Class | Description
--- | ---
TPanelStyle | TPanelStyle class.
TTableStyle | TTableStyle class.
TTableItemStyle | TTableItemStyle class.
TWizardNavigationButtonStyle | TWizardNavigationButtonStyle class.

Method Summary
TStyle __construct ([TStyle $style = null])
void addAttributesToRender (THtmlWriter $writer)
void clearStyleField (string $name)
void copyFrom (TStyle $style)
string getBackColor ()
string getBorderColor ()
string getBorderStyle ()
string getBorderWidth ()
string getCssClass ()
string getCustomStyle ()
TFont getFont ()
string getForeColor ()
string getHeight ()
string getStyleField (mixed $name)
array getStyleFields ()
string getWidth ()
boolean hasCssClass ()
boolean hasFont ()
boolean hasStyleField (mixed $name)
void mergeWith (TStyle $style)
void reset ()
void setBackColor (string $value)
void setBorderColor (string $value)
void setBorderStyle (string $value)
void setBorderWidth (string $value)
void setCssClass (string $value)
void setCustomStyle (string $value)
void setForeColor (string $value)
void setHeight (string $value)
void setStyleField (string $name, string $value)
void setWidth (string $value)
void __clone ()
Methods
Constructor __construct (line 51)

Constructor.

- access: public

TStyle __construct ([TStyle $style = null])

- TStyle $style: style to copy from

addAttributesToRender (line 348)

Adds attributes related to CSS styles to renderer.

- access: public

void addAttributesToRender (THtmlWriter $writer)

- THtmlWriter $writer: the writer used for the rendering purpose

Redefined in descendants as:

- TPanelStyle::addAttributesToRender() : Adds attributes related to CSS styles to renderer.
- TTableStyle::addAttributesToRender() : Adds attributes related to CSS styles to renderer.
- TTableItemStyle::addAttributesToRender() : Adds attributes related to CSS styles to renderer.

clearStyleField (line 264)

Clears a single style field value;

- access: public

void clearStyleField (string $name)

- string $name: style field name

copyFrom (line 310)

Copies the fields in a new style to this style.

If a style field is set in the new style, the corresponding field in this style will be overwritten.

- access: public

void copyFrom (TStyle $style)

- TStyle $style: the new style

Redefined in descendants as:

- TPanelStyle::copyFrom() : Copies the fields in a new style to this style.
- TDataGridPagerStyle::copyFrom() : Copies the fields in a new style to this style.
- TTableStyle::copyFrom() : Copies the fields in a new style to this style.
- TTableItemStyle::copyFrom() : Copies the fields in a new style to this style.
- TWizardNavigationButtonStyle::copyFrom() : Copies the fields in a new style to this style.

getBackColor (line 69)

- return: the background color of the control
- access: public

string getBackColor ()
getBorderColor (line 88)

- return: the border color of the control
- access: public

string getBorderColor ()
getBorderStyle (line 107)

- return: the border style of the control
- access: public

string getBorderStyle ()
getBorderWidth (line 127)

- return: the border width of the control
- access: public

string getBorderWidth ()
getCssClass (line 146)

- return: the CSS class of the control
- access: public

string getCssClass ()
getCustomStyle (line 226)

- return: the custom style of the control
- access: public

string getCustomStyle ()
getFont (line 170)

- return: the font of the control
- access: public

TFont getFont ()
getForeColor (line 188)

- return: the foreground color of the control
- access: public

string getForeColor ()
getHeight (line 207)

- return: the height of the control
- access: public

string getHeight ()
getStyleField (line 244)

- return: a single style field value set via setStyleField. Defaults to empty string.
- access: public

string getStyleField (mixed $name)
getStyleFields (line 369)

- return: list of style fields.
- access: public

array getStyleFields ()
getWidth (line 280)

- return: the width of the control
- access: public

string getWidth ()
hasCssClass (line 154)

- return: true if CSS is set or empty.
- access: public

boolean hasCssClass ()
hasFont (line 180)

- return: true if font is set.
- access: public

boolean hasFont ()
hasStyleField (line 272)

- return: whether a style field has been defined by setStyleField
- access: public

boolean hasStyleField (mixed $name)
mergeWith (line 330)

Merges the style with a new one.

If a style field is not set in this style, it will be overwritten by the new one.

- access: public

void mergeWith (TStyle $style)

- TStyle $style: the new style

Redefined in descendants as:

- TPanelStyle::mergeWith() : Merges the style with a new one.
- TDataGridPagerStyle::mergeWith() : Merges the style with a new one.
- TTableStyle::mergeWith() : Merges the style with a new one.
- TTableItemStyle::mergeWith() : Merges the style with a new one.
- TWizardNavigationButtonStyle::mergeWith() : Merges the style with a new one.

reset (line 296)

Resets the style to the original empty state.

- access: public

void reset ()

Redefined in descendants as:

- TPanelStyle::reset() : Sets the style attributes to default values.
- TDataGridPagerStyle::reset() : Resets the style to the original empty state.
- TTableStyle::reset() : Sets the style attributes to default values.
- TTableItemStyle::reset() : Sets the style attributes to default values.
- TWizardNavigationButtonStyle::reset() : Sets the style attributes to default values.

setBackColor (line 77)

- access: public

void setBackColor (string $value)

- string $value: the background color of the control

setBorderColor (line 96)

- access: public

void setBorderColor (string $value)

- string $value: the border color of the control

setBorderStyle (line 116)

Sets the border style of the control.

- access: public

void setBorderStyle (string $value)

- string $value: the border style of the control

setBorderWidth (line 135)

- access: public

void setBorderWidth (string $value)

- string $value: the border width of the control

setCssClass (line 162)

- access: public

void setCssClass (string $value)

- string $value: the name of the CSS class of the control

setCustomStyle (line 236)

Sets custom style fields from a string.

Custom style fields will be overwritten by style fields explicitly defined.

- access: public

void setCustomStyle (string $value)

- string $value: the custom style of the control

setForeColor (line 196)

- access: public

void setForeColor (string $value)

- string $value: the foreground color of the control

setHeight (line 215)

- access: public

void setHeight (string $value)

- string $value: the height of the control

setStyleField (line 255)

Sets a single style field value.

Style fields set by this method will overwrite those set by setCustomStyle.

- access: public

void setStyleField (string $name, string $value)

- string $name: style field name
- string $value: style field value

setWidth (line 288)

- access: public

void setWidth (string $value)

- string $value: the width of the control

__clone (line 60)

Need to clone the font object.

- access: public

void __clone ()

#### Inherited Methods

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 14 Jan 2007 21:44:30 -0500 by phpDocumentor 1.3.0RC4