PHP Class Prado\Web\UI\WebControls\TStyle

TStyle encapsulates the CSS style applied to a control.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TComponent
显示文件 Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
__clone ( ) Need to clone the font object.
__construct ( $style = null ) Constructor.
addAttributesToRender ( $writer ) Adds attributes related to CSS styles to renderer.
clearStyleField ( $name ) Clears a single style field value;
copyFrom ( $style ) Copies the fields in a new style to this style.
getBackColor ( ) : string
getBorderColor ( ) : string
getBorderStyle ( ) : string
getBorderWidth ( ) : string
getCssClass ( ) : string
getCustomStyle ( ) : string
getDisplayStyle ( ) : TDisplayStyle
getFont ( ) : TFont
getForeColor ( ) : string
getHeight ( ) : string
getStyleField ( $name ) : string
getStyleFields ( ) : array
getWidth ( ) : string
hasCssClass ( ) : boolean
hasFont ( ) : boolean
hasStyleField ( $name ) : boolean
mergeWith ( $style ) Merges the style with a new one.
reset ( ) Resets the style to the original empty state.
setBackColor ( $value )
setBorderColor ( $value )
setBorderStyle ( $value ) Sets the border style of the control.
setBorderWidth ( $value )
setCssClass ( $value )
setCustomStyle ( $value ) Sets custom style fields from a string.
setDisplayStyle ( $value )
setForeColor ( $value )
setHeight ( $value )
setStyleField ( $name, $value ) Sets a single style field value.
setWidth ( $value )

Protected Methods

Method Description
_getZappableSleepProps ( &$exprops ) Returns an array with the names of all variables of this object that should NOT be serialized because their value is the default one or useless to be cached for the next page loads.

Method Details

__clone() public method

Need to clone the font object.
public __clone ( )

__construct() public method

Constructor.
public __construct ( $style = null )

_getZappableSleepProps() protected method

Reimplement in derived classes to add new variables, but remember to also to call the parent implementation first.
protected _getZappableSleepProps ( &$exprops )

addAttributesToRender() public method

Adds attributes related to CSS styles to renderer.
public addAttributesToRender ( $writer )

clearStyleField() public method

Clears a single style field value;
public clearStyleField ( $name )

copyFrom() public method

If a style field is set in the new style, the corresponding field in this style will be overwritten.
public copyFrom ( $style )

getBackColor() public method

public getBackColor ( ) : string
return string the background color of the control

getBorderColor() public method

public getBorderColor ( ) : string
return string the border color of the control

getBorderStyle() public method

public getBorderStyle ( ) : string
return string the border style of the control

getBorderWidth() public method

public getBorderWidth ( ) : string
return string the border width of the control

getCssClass() public method

public getCssClass ( ) : string
return string the CSS class of the control

getCustomStyle() public method

public getCustomStyle ( ) : string
return string the custom style of the control

getDisplayStyle() public method

public getDisplayStyle ( ) : TDisplayStyle
return TDisplayStyle display style

getFont() public method

public getFont ( ) : TFont
return TFont the font of the control

getForeColor() public method

public getForeColor ( ) : string
return string the foreground color of the control

getHeight() public method

public getHeight ( ) : string
return string the height of the control

getStyleField() public method

public getStyleField ( $name ) : string
return string a single style field value set via {@link setStyleField}. Defaults to empty string.

getStyleFields() public method

public getStyleFields ( ) : array
return array list of style fields.

getWidth() public method

public getWidth ( ) : string
return string the width of the control

hasCssClass() public method

public hasCssClass ( ) : boolean
return boolean true if CSS is set or empty.

hasFont() public method

public hasFont ( ) : boolean
return boolean true if font is set.

hasStyleField() public method

public hasStyleField ( $name ) : boolean
return boolean whether a style field has been defined by {@link setStyleField}

mergeWith() public method

If a style field is not set in this style, it will be overwritten by the new one.
public mergeWith ( $style )

reset() public method

Resets the style to the original empty state.
public reset ( )

setBackColor() public method

public setBackColor ( $value )

setBorderColor() public method

public setBorderColor ( $value )

setBorderStyle() public method

Sets the border style of the control.
public setBorderStyle ( $value )

setBorderWidth() public method

public setBorderWidth ( $value )

setCssClass() public method

public setCssClass ( $value )

setCustomStyle() public method

Custom style fields will be overwritten by style fields explicitly defined.
public setCustomStyle ( $value )

setDisplayStyle() public method

public setDisplayStyle ( $value )

setForeColor() public method

public setForeColor ( $value )

setHeight() public method

public setHeight ( $value )

setStyleField() public method

Style fields set by this method will overwrite those set by {@link setCustomStyle}.
public setStyleField ( $name, $value )

setWidth() public method

public setWidth ( $value )