PHP Class Prado\Web\UI\WebControls\TColorPicker

TColorPicker displays a text box for color input purpose. Next to the textbox there's a button filled with the current chosen color. Users can write a color name directly in the text box as an hex triplet (also known as HTML notation, eg: #FF00FF). Alternatively, if the ShowColorPicker property is enabled (it is by default), users can click the button to have a color picker UI appear. A color chan be chosen directly by clicking on the color picker. TColorPicker has three different color picker UI Modes: # Simple - Grid with 12 simple colors. # Basic - Grid with the most common 70 colors. This is the default mode. # Full - Full-featured color picker. The CssClass property can be used to override the CSS class name for the color picker panel. The ColorStyle property sets the packages styles available. E.g. default. If the Mode property is set to Full, the color picker panel will display an "Ok" and "Cancel" buttons. You can customize the button labels setting the OKButtonText and CancelButtonText properties.
Since: 3.0
Inheritance: extends TTextBox
Mostrar archivo Open project: pradosoft/prado

Public Methods

Method Description
getCancelButtonText ( ) : string
getClientSide ( ) : TColorPickerClientSide
getColorPickerStyle ( ) : string
getMode ( ) : TColorPickerMode
getOKButtonText ( ) : string
getShowColorPicker ( ) : boolean
onPreRender ( $param ) Publish the color picker Css asset files.
renderEndTag ( $writer ) Renders additional body content.
setCancelButtonText ( $value )
setColorPickerStyle ( $value )
setMode ( $value )
setOKButtonText ( $value )
setShowColorPicker ( $value ) Sets whether to pop up the color picker when the button is clicked.

Protected Methods

Method Description
createClientSide ( ) : TColorPickerClientSide
getAssetUrl ( $file = '' ) : string
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getPostBackOptions ( ) : array Get javascript color picker options.
publishColorPickerAssets ( ) Publish the color picker assets.

Method Details

createClientSide() protected method

protected createClientSide ( ) : TColorPickerClientSide
return TColorPickerClientSide javascript validator event options.

getAssetUrl() protected method

protected getAssetUrl ( $file = '' ) : string
return string asset file url.

getCancelButtonText() public method

public getCancelButtonText ( ) : string
return string text for the color picker Cancel button. Default is "Cancel".

getClientClassName() protected method

This method overrides the parent implementation.
protected getClientClassName ( ) : string
return string the javascript class name

getClientSide() public method

public getClientSide ( ) : TColorPickerClientSide
return TColorPickerClientSide javascript event options.

getColorPickerStyle() public method

public getColorPickerStyle ( ) : string
return string current color picker style

getMode() public method

public getMode ( ) : TColorPickerMode
return TColorPickerMode current color picker UI mode. Defaults to TColorPickerMode::Basic.

getOKButtonText() public method

public getOKButtonText ( ) : string
return string text for the color picker OK button. Default is "OK".

getPostBackOptions() protected method

Get javascript color picker options.
protected getPostBackOptions ( ) : array
return array color picker client-side options

getShowColorPicker() public method

public getShowColorPicker ( ) : boolean
return boolean whether the color picker should pop up when the button is clicked.

onPreRender() public method

Publish the color picker Css asset files.
public onPreRender ( $param )

publishColorPickerAssets() protected method

Publish the color picker assets.
protected publishColorPickerAssets ( )

renderEndTag() public method

This method overrides parent implementation by adding additional color picker button.
public renderEndTag ( $writer )

setCancelButtonText() public method

public setCancelButtonText ( $value )

setColorPickerStyle() public method

public setColorPickerStyle ( $value )

setMode() public method

public setMode ( $value )

setOKButtonText() public method

public setOKButtonText ( $value )

setShowColorPicker() public method

Sets whether to pop up the color picker when the button is clicked.
public setShowColorPicker ( $value )