Class TStyle

Description

TStyle class

TStyle encapsulates the CSS style applied to a control.

  • since: 3.0
  • version: $Id: TStyle.php 1653 2007-01-25 05:49:22Z wei $
  • 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 clearStyleField (string $name)
void copyFrom (TStyle $style)
string getBackColor ()
string getBorderColor ()
string getBorderStyle ()
string getBorderWidth ()
string getCssClass ()
string getCustomStyle ()
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 55)

Constructor.

  • access: public
TStyle __construct ([TStyle $style = null])
  • TStyle $style: style to copy from
addAttributesToRender (line 383)

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:
clearStyleField (line 299)

Clears a single style field value;

  • access: public
void clearStyleField (string $name)
  • string $name: style field name
copyFrom (line 345)

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:
getBackColor (line 73)
  • return: the background color of the control
  • access: public
string getBackColor ()
getBorderColor (line 92)
  • return: the border color of the control
  • access: public
string getBorderColor ()
getBorderStyle (line 111)
  • return: the border style of the control
  • access: public
string getBorderStyle ()
getBorderWidth (line 131)
  • return: the border width of the control
  • access: public
string getBorderWidth ()
getCssClass (line 150)
  • return: the CSS class of the control
  • access: public
string getCssClass ()
getCustomStyle (line 261)
  • return: the custom style of the control
  • access: public
string getCustomStyle ()
getDisplayStyle (line 215)
  • return: display style
  • access: public
TDisplayStyle getDisplayStyle ()
getFont (line 174)
  • return: the font of the control
  • access: public
TFont getFont ()
getForeColor (line 223)
  • return: the foreground color of the control
  • access: public
string getForeColor ()
getHeight (line 242)
  • return: the height of the control
  • access: public
string getHeight ()
getStyleField (line 279)
  • return: a single style field value set via setStyleField. Defaults to empty string.
  • access: public
string getStyleField (mixed $name)
getStyleFields (line 404)
  • return: list of style fields.
  • access: public
array getStyleFields ()
getWidth (line 315)
  • return: the width of the control
  • access: public
string getWidth ()
hasCssClass (line 158)
  • return: true if CSS is set or empty.
  • access: public
boolean hasCssClass ()
hasFont (line 184)
  • return: true if font is set.
  • access: public
boolean hasFont ()
hasStyleField (line 307)
  • return: whether a style field has been defined by setStyleField
  • access: public
boolean hasStyleField (mixed $name)
mergeWith (line 365)

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:
reset (line 331)

Resets the style to the original empty state.

  • access: public
void reset ()

Redefined in descendants as:
setBackColor (line 81)
  • access: public
void setBackColor (string $value)
  • string $value: the background color of the control
setBorderColor (line 100)
  • access: public
void setBorderColor (string $value)
  • string $value: the border color of the control
setBorderStyle (line 120)

Sets the border style of the control.

  • access: public
void setBorderStyle (string $value)
  • string $value: the border style of the control
setBorderWidth (line 139)
  • access: public
void setBorderWidth (string $value)
  • string $value: the border width of the control
setCssClass (line 166)
  • access: public
void setCssClass (string $value)
  • string $value: the name of the CSS class of the control
setCustomStyle (line 271)

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
setDisplayStyle (line 192)
  • access: public
void setDisplayStyle (TDisplayStyle $value)
  • TDisplayStyle $value: control display style, default is TDisplayStyle::Fixed
setForeColor (line 231)
  • access: public
void setForeColor (string $value)
  • string $value: the foreground color of the control
setHeight (line 250)
  • access: public
void setHeight (string $value)
  • string $value: the height of the control
setStyleField (line 290)

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 323)
  • access: public
void setWidth (string $value)
  • string $value: the width of the control
__clone (line 64)

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 Mon, 21 Apr 2008 11:36:21 -0400 by phpDocumentor 1.3.0RC4