Class TColorPicker

Description

TColorPicker class.

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.

  • author: Wei Zhuo <weizhuo[at]gmail[dot]com>
  • version: $Id: TColorPicker.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
  • since: 3.0

Located in /Web/UI/WebControls/TColorPicker.php (line 40)

TComponent
   |
   --TApplicationComponent
      |
      --TControl
         |
         --TWebControl
            |
            --TTextBox
               |
               --TColorPicker
Class Constant Summary
 SCRIPT_PATH = 'prado/colorpicker'
Method Summary
string getAssetUrl ([string $file = ''])
string getClientClassName ()
string getOKButtonText ()
boolean getShowColorPicker ()
void onPreRender ( $param)
void renderEndTag (THtmlWriter $writer)
void setCancelButtonText (string $value)
void setColorPickerStyle (string $value)
void setMode (TColorPickerMode $value)
void setOKButtonText (string $value)
void setShowColorPicker (boolean $value)
Variables

Inherited Variables

Inherited from TWebControl

TWebControl::$_decorator
Methods
createClientSide (line 140)
  • return: javascript validator event options.
  • access: protected
TColorPickerClientSide createClientSide ()
getAssetUrl (line 170)
  • return: asset file url.
  • access: protected
string getAssetUrl ([string $file = ''])
  • string $file: asset file in the self::SCRIPT_PATH directory.
getCancelButtonText (line 114)
  • return: text for the color picker Cancel button. Default is "Cancel".
  • access: public
string getCancelButtonText ()
getClientClassName (line 234)

Gets the name of the javascript class responsible for performing postback for this control.

This method overrides the parent implementation.

  • return: the javascript class name
  • access: protected
string getClientClassName ()

Redefinition of:
TTextBox::getClientClassName()
Gets the name of the javascript class responsible for performing postback for this control.
getClientSide (line 130)
  • return: javascript event options.
  • access: public
TColorPickerClientSide getClientSide ()
getColorPickerStyle (line 90)
  • return: current color picker style
  • access: public
string getColorPickerStyle ()
getMode (line 74)
  • return: current color picker UI mode. Defaults to TColorPickerMode::Basic.
  • access: public
TColorPickerMode getMode ()
getOKButtonText (line 98)
  • return: text for the color picker OK button. Default is "OK".
  • access: public
string getOKButtonText ()
getPostBackOptions (line 149)

Get javascript color picker options.

  • return: color picker client-side options
  • access: protected
array getPostBackOptions ()

Redefinition of:
TTextBox::getPostBackOptions()
Gets the post back options for this textbox.
getShowColorPicker (line 49)
  • return: whether the color picker should pop up when the button is clicked.
  • access: public
boolean getShowColorPicker ()
onPreRender (line 179)

Publish the color picker Css asset files.

  • access: public
void onPreRender ( $param)
  • $param

Redefinition of:
TWebControl::onPreRender()
If your subclass overrides the onPreRender method be sure to call this method through parent::onPreRender($param); so your sub-class can be decorated, among other things.
publishColorPickerAssets (line 188)

Publish the color picker assets.

  • access: protected
void publishColorPickerAssets ()
renderEndTag (line 209)

Renders additional body content.

This method overrides parent implementation by adding additional color picker button.

  • access: public
void renderEndTag (THtmlWriter $writer)

Redefinition of:
TWebControl::renderEndTag()
Renders the closing tag for the control
setCancelButtonText (line 122)
  • access: public
void setCancelButtonText (string $value)
  • string $value: text for the color picker Cancel button
setColorPickerStyle (line 82)
  • access: public
void setColorPickerStyle (string $value)
  • string $value: set the color picker style
setMode (line 66)
  • access: public
void setMode (TColorPickerMode $value)
setOKButtonText (line 106)
  • access: public
void setOKButtonText (string $value)
  • string $value: text for the color picker OK button
setShowColorPicker (line 58)

Sets whether to pop up the color picker when the button is clicked.

  • access: public
void setShowColorPicker (boolean $value)
  • boolean $value: whether to show the color picker popup

Inherited Methods

Inherited From TTextBox

TTextBox::addAttributesToRender()
TTextBox::getAutoCompleteType()
TTextBox::getAutoPostBack()
TTextBox::getAutoTrim()
TTextBox::getCausesValidation()
TTextBox::getClientClassName()
TTextBox::getColumns()
TTextBox::getData()
TTextBox::getDataChanged()
TTextBox::getEnableClientScript()
TTextBox::getIsValid()
TTextBox::getMaxLength()
TTextBox::getPersistPassword()
TTextBox::getPostBackOptions()
TTextBox::getReadOnly()
TTextBox::getRows()
TTextBox::getSafeText()
TTextBox::getSafeTextParser()
TTextBox::getTagName()
TTextBox::getText()
TTextBox::getTextMode()
TTextBox::getValidationGroup()
TTextBox::getValidationPropertyValue()
TTextBox::getWrap()
TTextBox::loadPostData()
TTextBox::onTextChanged()
TTextBox::raisePostDataChangedEvent()
TTextBox::renderBeginTag()
TTextBox::renderClientControlScript()
TTextBox::renderContents()
TTextBox::setAutoCompleteType()
TTextBox::setAutoPostBack()
TTextBox::setAutoTrim()
TTextBox::setCausesValidation()
TTextBox::setColumns()
TTextBox::setData()
TTextBox::setEnableClientScript()
TTextBox::setIsValid()
TTextBox::setMaxLength()
TTextBox::setPersistPassword()
TTextBox::setReadOnly()
TTextBox::setRows()
TTextBox::setText()
TTextBox::setTextMode()
TTextBox::setValidationGroup()
TTextBox::setWrap()

Inherited From TWebControl

TWebControl::addAttributesToRender()
TWebControl::clearStyle()
TWebControl::copyBaseAttributes()
TWebControl::createStyle()
TWebControl::getAccessKey()
TWebControl::getBackColor()
TWebControl::getBorderColor()
TWebControl::getBorderStyle()
TWebControl::getBorderWidth()
TWebControl::getCssClass()
TWebControl::getDecorator()
TWebControl::getDisplay()
TWebControl::getEnsureId()
TWebControl::getFont()
TWebControl::getForeColor()
TWebControl::getHasStyle()
TWebControl::getHeight()
TWebControl::getStyle()
TWebControl::getTabIndex()
TWebControl::getTagName()
TWebControl::getToolTip()
TWebControl::getWidth()
TWebControl::onPreRender()
TWebControl::render()
TWebControl::renderBeginTag()
TWebControl::renderContents()
TWebControl::renderEndTag()
TWebControl::setAccessKey()
TWebControl::setBackColor()
TWebControl::setBorderColor()
TWebControl::setBorderStyle()
TWebControl::setBorderWidth()
TWebControl::setCssClass()
TWebControl::setDisplay()
TWebControl::setEnsureId()
TWebControl::setForeColor()
TWebControl::setHeight()
TWebControl::setStyle()
TWebControl::setTabIndex()
TWebControl::setToolTip()
TWebControl::setWidth()

Inherited From TControl

TControl::__construct()
TControl::addedControl()
TControl::addParsedObject()
TControl::addToPostDataLoader()
TControl::applyStyleSheetSkin()
TControl::autoBindProperty()
TControl::autoDataBindProperties()
TControl::bindProperty()
TControl::broadcastEvent()
TControl::bubbleEvent()
TControl::clearChildState()
TControl::clearControlState()
TControl::clearNamingContainer()
TControl::clearViewState()
TControl::convertUniqueIdToClientId()
TControl::createChildControls()
TControl::createControlCollection()
TControl::dataBind()
TControl::dataBindChildren()
TControl::dataBindProperties()
TControl::ensureChildControls()
TControl::findControl()
TControl::findControlsByID()
TControl::findControlsByType()
TControl::focus()
TControl::getAdapter()
TControl::getAllowChildControls()
TControl::getAttribute()
TControl::getAttributes()
TControl::getChildControlsCreated()
TControl::getClientID()
TControl::getControls()
TControl::getControlStage()
TControl::getControlState()
TControl::getCustomData()
TControl::getEnabled()
TControl::getEnableTheming()
TControl::getEnableViewState()
TControl::getHasAdapter()
TControl::getHasAttributes()
TControl::getHasChildInitialized()
TControl::getHasControls()
TControl::getHasInitialized()
TControl::getHasLoaded()
TControl::getHasLoadedPostData()
TControl::getHasPreRendered()
TControl::getID()
TControl::getIsSkinApplied()
TControl::getNamingContainer()
TControl::getPage()
TControl::getParent()
TControl::getRegisteredObject()
TControl::getSkinID()
TControl::getSourceTemplateControl()
TControl::getTemplateControl()
TControl::getUniqueID()
TControl::getViewState()
TControl::getVisible()
TControl::hasAttribute()
TControl::initRecursive()
TControl::isDescendentOf()
TControl::isObjectRegistered()
TControl::loadRecursive()
TControl::loadState()
TControl::loadStateRecursive()
TControl::onDataBinding()
TControl::onInit()
TControl::onLoad()
TControl::onPreRender()
TControl::onUnload()
TControl::preRenderRecursive()
TControl::raiseBubbleEvent()
TControl::registerObject()
TControl::removeAttribute()
TControl::removedControl()
TControl::render()
TControl::renderChildren()
TControl::renderControl()
TControl::saveState()
TControl::saveStateRecursive()
TControl::setAdapter()
TControl::setAttribute()
TControl::setChildControlsCreated()
TControl::setControlStage()
TControl::setControlState()
TControl::setCustomData()
TControl::setEnabled()
TControl::setEnableTheming()
TControl::setEnableViewState()
TControl::setID()
TControl::setPage()
TControl::setSkinID()
TControl::setTemplateControl()
TControl::setViewState()
TControl::setVisible()
TControl::trackViewState()
TControl::traverseChildControls()
TControl::unbindProperty()
TControl::unloadRecursive()
TControl::unregisterObject()
TControl::__get()

Inherited From TApplicationComponent

TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()

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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()
Class Constants

Documentation generated on Mon, 25 Jun 2012 14:37:34 +0200 by phpDocumentor 1.4.3