Source for file stdctrls.inc.php
Documentation is available at stdctrls.inc.php
* This file is part of the VCL for PHP project
* Copyright (c) 2004-2007 qadram software <support@qadram.com>
* Checkout AUTHORS file for more information on the developers
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* Base class for DynAPI widgets
echo "<script type=\"text/javascript\" src=\""
. "<script type=\"text/javascript\">\n"
. " dynapi.library.setPath('" . VCL_HTTP_PATH . "/dynapi/src/');\n"
. " dynapi.library.include('dynapi.api');\n"
echo "<script type=\"text/javascript\">\n"
. " dynapi.library.include('" . $this->DWidgetClassName . "');\n"
echo "<script type=\"text/javascript\">\n"
. " dynapi.document.insertChild(" . $this->Name . ");\n"
//Calls inherited constructor
$this->ControlStyle= "csSlowRedraw=1";
* Init qooxdoo library, only once
echo "<script type=\"text/javascript\" src=\"" . VCL_HTTP_PATH . "/qooxdoo/framework/script/qx.js\"></script>\n"
. "<script type=\"text/javascript\">\n"
. " qx.log.Logger.ROOT_LOGGER.setMinLevel(qx.log.Logger.LEVEL_FATAL);\n"
. " qx.manager.object.AliasManager.getInstance().add(\"static\", \"" . VCL_HTTP_PATH . "/qooxdoo/framework/resource/static/\");\n"
. " qx.manager.object.AliasManager.getInstance().add(\"widget\", \"" . VCL_HTTP_PATH . "/qooxdoo/framework/resource/widget/windows/\");\n"
. " qx.manager.object.AliasManager.getInstance().add(\"icon\", \"" . VCL_HTTP_PATH . "/qooxdoo/framework/resource/icon/VistaInspirate/\");\n"
* @param string $Name Component Name
* @param string $Cursor Cursor to be set
case "crPointer": $cursor= "pointer"; break;
case "crHand": $cursor= "pointer"; break;
case "crCrossHair": $cursor= "crosshair"; break;
case "crHelp": $cursor= "help"; break;
case "crText": $cursor= "text"; break;
case "crWait": $cursor= "wait"; break;
case "crE-Resize": $cursor= "e-resize"; break;
case "crNE-Resize": $cursor= "ne-resize"; break;
case "crN-Resize": $cursor= "n-resize"; break;
case "crNW-Resize": $cursor= "nw-resize"; break;
case "crW-Resize": $cursor= "w-resize"; break;
case "crSW-Resize": $cursor= "sw-resize"; break;
case "crS-Resize": $cursor= "s-resize"; break;
case "crSE-Resize": $cursor= "se-resize"; break;
case "crAuto": $cursor= "move"; break;
default: $cursor= "default"; break;
echo " $Name.setCursor(\"$cursor\");\n";
* Base class for qooxdoo widgets
if ($this->Enabled) { $enabled= "true"; }
else { $enabled= "false"; }
echo " $Name.setEnabled($enabled);\n";
echo " $Name.setFont(\"{$this->Font->Size} '{ $this->Font->Family}' { $this->Font->Weight}\");\n ";
if ($this->Font->Color != "")
{ echo " $Name.setColor(new qx.renderer.color.Color('{$this->Font->Color}'));\n "; }
echo " $Name.setVisibility($visible);\n";
echo " $Name.addEventListener('$eventname', function(e) { $event(e); });\n";
//$this->PrepareQWJSEvent($Name, $this->readjsOnShow, "appear");
//$this->PrepareQWJSEvent($Name, $this->jsOnHide, "disappear");
if (($this->jsOnContextMenu != null) || ($this->PopupMenu != null))
echo " $Name.addEventListener('contextmenu', function(e) {";
if ($this->jsOnContextMenu != null) echo " $this->jsOnContextMenu(e);";
if ($this->PopupMenu != null) echo " Show" . $this->PopupMenu->Name . "(e, 1);";
if ($this->jsOnChange != null)
switch ($UseOnChangeEvent)
echo " $Name.addEventListener('$event', function(e) { $this->jsOnChange(e); });\n";
{ echo "<html>\n<head>\n"; }
* Dump the common qooxdoo initialization code
//In design mode, this component needs a body
echo '<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" >';
echo "<input type=\"hidden\" id=\"$this->Name". "_state\" name=\"$this->Name". "_state\" value=\"\" />\n";
if ((($this->ControlState & csDesigning)== csDesigning) || (($this->Parent!= null) && (!$this->Parent->inheritsFrom("QWidget"))))
echo "<div id=\"$this->Name\"></div>\n"
. "<script type=\"text/javascript\">\n"
. " var d = qx.ui.core.ClientDocument.getInstance();\n"
. " var inline_div = new qx.ui.basic.Inline(\"$this->Name\");\n"
. " inline_div.setHeight(\"auto\");\n"
. " inline_div.setWidth(\"auto\");\n\n";
// . " d.setOverflow(\"scrollY\");\n"
// . " d.setBackgroundColor(null);\n"
echo "<script type=\"text/javascript\">\n";
* Dump common qooxdoo finalization code
if ((($this->ControlState & csDesigning)== csDesigning) || (($this->Parent!= null) && (!$this->Parent->inheritsFrom("QWidget"))))
echo " d.add(inline_div);\n"
. " inline_div.add($this->Name);\n"
* Code to dump when the Widget accepts children controls.
if ($ownername!= "") $aowner= $ownername;
if ($v->inheritsFrom("QWidget"))
echo "<script type=\"text/javascript\">\n";
echo " $v->Name.setLeft(". ($v->Left+ $leftoffset). ");\n";
echo " $v->Name.setTop(". ($v->Top+ $topoffset). ");\n";
echo " $aowner.add($v->Name);\n";
echo " var container = new qx.ui.basic.Atom(\"";
echo " container.setLeft(". ($v->Left+ $leftoffset). ");\n";
echo " container.setTop(". ($v->Top+ $topoffset). ");\n";
echo " container.setWidth($v->Width);\n";
echo " container.setHeight($v->Height);\n";
echo " $aowner.add(container);\n";
//Calls inherited constructor
$this->ControlStyle= "csTopOffset=1";
$this->ControlStyle= "csLeftOffset=1";
$this->ControlStyle= "csSlowRedraw=1";
* CustomLabel is the base class for controls that display text on a form.
* The Caption of the CustomLabel may contain HTML formatted text.
//Calls inherited constructor
parent::__construct($aowner);
$this->ControlStyle= "csRenderOwner=1";
$this->ControlStyle= "csRenderAlso=StyleSheet";
$submitEventValue = $this->input->{$this->getJSWrapperHiddenFieldName()};
if (is_object($submitEventValue))
// check if the a click event has been fired
// check if the a double-click event has been fired
// call writeDataSource() since setDataSource() might not be implemented by the sub-class
// get the string for the JS Events
$events = $this->readJsEvents();
// add or replace the JS events with the wrappers if necessary
// get the Font attributes
$style = $this->Font->FontString;
$style .= "background-color: " . $color . ";";
// add the cursor to the style
$style .= "cursor: $cr;";
// set height and width to the style attribute
$style .= "height:" . $this->Height . "px;width:" . $this->Width . "px;";
$style .= "height:100%;width:100%;";
$style .= "white-space: nowrap; ";
if ($style != "") $style = "style=\"$style\"";
// get the alignment of the Caption inside the <div>
$alignment = " align=\"Left\" ";
$alignment = " align=\"Center\" ";
$alignment = " align=\"Right\" ";
// get the hint attribute; returns: title="[HintText]"
$hint = $this->getHintAttribute();
if (trim($this->LinkTarget)!= "") $target= "target=\"$this->LinkTarget\"";
$class = ($this->Style != "") ? "class=\"$this->StyleClass\"" : "";
echo "<div id=\"$this->_name\" $style $alignment $hint $class";
if ($this->_link== "") echo "$events";
if ($this->_link != "") echo "<A HREF=\"$this->_link\" $target $events>";
//The value to show on the field is the one from the table
$this->Caption = $this->readDataFieldValue();
// dump no hidden fields since the label is read-only
// If a link is defined strip all other links defined in the caption
// Reason: Nested links are illegal
if ($this->_link != "") echo "</A>";
// add a hidden field so we can determine which event for the label was fired
$hiddenwrapperfield = $this->getJSWrapperHiddenFieldName();
echo "<input type=\"hidden\" id=\"$hiddenwrapperfield\" name=\"$hiddenwrapperfield\" value=\"\" />";
parent::dumpJavascript();
// only output the same function once;
// otherwise if for example two labels use the same
// OnClick event handler it would be outputted twice.
// output the wrapper function
// output the wrapper function
* Helper function to strip selected tags.
* This function will also replace self-closing tags (XHTML <br /> <hr />)
* and will work if the text contains line breaks.
* @autor Bermi Ferrer @ http://www.php.net/manual/en/function.strip-tags.php
* @param string $text Text that may contain the tags to strip.
* @param array $tags All tags that should be stripped from $text.
* @return string Returns $text without the defined $tags.
if( preg_match_all( '/<'. $tag. '[^>]*>([^<]*)<\/'. $tag. '>/iu', $text, $found) ){
* Occurs when the user clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
* Occurs when the user clicks the control.
* @param mixed $value Event handler or null to unset.
function writeOnClick($value)
function defaultOnClick()
* Occurs when the user double clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
function readOnDblClick()
* Occurs when the user double clicks the control.
* @param mixed $value Event handler or null to unset.
function writeOnDblClick($value)
function defaultOnDblClick()
* DataField indicates which field of the DataSource is used to fill in
* @return string Returns the data field.
* DataField indicates which field of the DataSource is used to fill in
* @param string $value Data field
function writeDataField($value)
function defaultDataField()
* DataSource indicates the source where the Caption is read from.
* The label is read-only meaning it does not update any data in the data source.
* @return mixed Data source object or null if not used.
function readDataSource()
* DataSource indicates the source where the Caption is read from.
* The label is read-only meaning it does not update any data in the data source.
* @param mixed $value Data source object or null if not used.
function writeDataSource($value)
function defaultDataSource()
* If Link is set the Caption is rendered as a link.
* @return string Link, if empty string the link is not used.
* If Link is set the Caption is rendered as a link.
* @value string $value Link, if empty string the link is not used.
function writeLink($value)
* Target attribute when the label acts as a link.
* @link http://www.w3.org/TR/html4/present/frames.html#adef-target
* @return string The link target as defined by the HTML specs.
function readLinkTarget() { return $this->_linktarget; }
* Target attribute when the label acts as a link.
* @link http://www.w3.org/TR/html4/present/frames.html#adef-target
* @param string $value The link target as defined by the HTML specs.
function writeLinkTarget($value) { $this->_linktarget= $value; }
function defaultLinkTarget() { return ""; }
* Specifies whether the label text wraps when it is too long
* for the width of the label.
* @return bool True if word wrap is enabled, false otherwise.
* Specifies whether the label text wraps when it is too long
* for the width of the label.
* Note: white-space: nowrap; is applied to the <div> of the label.
* @param bool $value True if word wrap is enabled, false otherwise.
function writeWordWrap($value)
function defaultWordWrap()
* Label class derived from CustomLabel.
* Publish the events for the Label component
function getOnClick () { return $this->readOnClick(); }
function setOnClick ($value) { $this->writeOnClick($value); }
function getOnDblClick () { return $this->readOnDblClick(); }
function setOnDblClick ($value) { $this->writeOnDblClick($value); }
* Publish the JS events for the Label component
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
* Publish the properties for the Label component
return $this->readAlignment();
function setAlignment($value)
$this->writeAlignment($value);
return $this->readCaption();
function setCaption($value)
$this->writeCaption($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
function getDesignColor()
return $this->readDesignColor();
function setDesignColor($value)
$this->writeDesignColor($value);
return $this->readFont();
$this->writeFont($value);
return $this->readLink();
$this->writeLink($value);
return $this->readLinkTarget();
function setLinkTarget($value)
$this->writeLinkTarget($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
return $this->readWordWrap();
function setWordWrap($value)
$this->writeWordWrap($value);
define('bsSingle', 'bsSingle');
define('ecLowerCase', 'ecLowerCase');
define('ecNormal', 'ecNormal');
define('ecUpperCase', 'ecUpperCase');
* Base class for Edit controls.
* It allows to enter text in a single-line.
* The Edit control only accepts plain text. All HTML tags are stripped.
//Calls inherited constructor
$this->ControlStyle= "csRenderOwner=1";
$this->ControlStyle= "csRenderAlso=StyleSheet";
// use writeDataSource() since setDataSource() might be implemented in the sub-component
//If there is something posted
$submitted = $this->input->{$this->Name};
//Get the value and set the text field
$this->_text = $submitted->asString();
//If there is any valid DataField attached, update it
$submitted = $this->input->{$this->Name};
// Allow the OnSubmit event to be fired because it is not
// a mouse or keyboard event.
$submitEvent = $this->input->{$this->getJSWrapperHiddenFieldName()};
if (is_object($submitEvent) && $this->_enabled == 1)
// check if the a click event has been fired
// check if the a double-click event has been fired
* Get the common HTML tag attributes of a Edit control.
* @return string Returns a string with the attributes.
protected function getCommonAttributes()
// get the string for the JS Events
$events = $this->readJsEvents();
// add the OnSelect JS-Event
$events .= " onselect=\"return $this->_jsonselect(event)\" ";
// add or replace the JS events with the wrappers if necessary
// set enabled/disabled status
$disabled = (!$this->_enabled) ? "disabled" : "";
// set maxlength if bigger than 0
$maxlength = ($this->_maxlength > 0) ? "maxlength=$this->_maxlength" : "";
// set readonly attribute if true
$readonly = ($this->_readonly == 1) ? "readonly" : "";
// set tab order if tab stop set to true
$taborder = ($this->_tabstop == 1) ? "tabindex=\"$this->_taborder\"" : "";
$class = ($this->Style != "") ? "class=\"$this->StyleClass\"" : "";
// get the hint attribute; returns: title="[HintText]"
$hint = $this->getHintAttribute();
return "$disabled $maxlength $readonly $taborder $hint $events $class";
* Get the common styles of a Edit control.
* @return string Returns a string with the common styles. It is not wrapped
* in the style="" attribute.
protected function getCommonStyles()
$style .= $this->Font->FontString;
// set the no border style
$style .= "border-width: 0px; border-style: none;";
$style .= "background-color: " . $this->Color . ";";
// add the cursor to the style
$style .= "cursor: $cr;";
// set the char case if not normal
$style .= "text-transform: lowercase;";
$style .= "text-transform: uppercase;";
$style .= "height:" . $h . "px;width:" . $w . "px;";
// set type depending on $_ispassword
$attributes = $this->getCommonAttributes();
$style = $this->getCommonStyles();
if ($style != "") $style = "style=\"$style\"";
//The value to show on the field is the one from the table
$this->_text = $this->readDataFieldValue();
//Dumps hidden fields to know which is the record to update
// call the OnShow event if assigned so the Text property can be changed
echo "<input type=\"$type\" id=\"$this->_name\" name=\"$this->_name\" value=\"$this->_text\" $style $attributes />";
// add a hidden field so we can determine which event for the edit was fired
$hiddenwrapperfield = $this->getJSWrapperHiddenFieldName();
echo "<input type=\"hidden\" id=\"$hiddenwrapperfield\" name=\"$hiddenwrapperfield\" value=\"\" />";
* Write the Javascript section to the header
parent::dumpJavascript();
// only output the same function once;
// otherwise if for example two edits use the same
// OnClick event handler it would be outputted twice.
// output the wrapper function
// output the wrapper function
* Occurs when the user clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
* Occurs when the user clicks the control.
* @param mixed Event handler or null if no handler is set.
function writeOnClick($value)
function defaultOnClick()
* Occurs when the user double-clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
function readOnDblClick()
* Occurs when the user double-clicks the control.
* @param mixed Event handler or null if no handler is set.
function writeOnDblClick($value)
function defaultOnDblClick()
* Occurs when the form containing the control was submitted.
* @return mixed Returns the event handler or null if no handler is set.
function readOnSubmit() { return $this->_onsubmit; }
* Occurs when the form containing the control was submitted.
* @param mixed Event handler or null if no handler is set.
function writeOnSubmit($value) { $this->_onsubmit= $value; }
function defaultOnSubmit() { return null; }
* JS Event occurs when text in the control was selected.
* @return mixed Returns the event handler or null if no handler is set.
function readjsOnSelect() { return $this->_jsonselect; }
* JS Event occurs when text in the control was selected.
* @param mixed Event handler or null if no handler is set.
function writejsOnSelect($value) { $this->_jsonselect= $value; }
function defaultjsOnSelect() { return null; }
* Determines whether the edit control has a single line border around the client area.
* @return enum (bsNone, bsSingle)
* Determines whether the edit control has a single line border around the client area.
* @param enum $value (bsNone, bsSingle)
function writeBorderStyle($value) { $this->_borderstyle= $value; }
function defaultBorderStyle() { return bsSingle; }
* DataField indicates which field of the DataSource is used to fill in
function readDataField() { return $this->_datafield; }
* DataField indicates which field of the DataSource is used to fill in
function writeDataField($value) { $this->_datafield = $value; }
function defaultDataField() { return ""; }
* DataSource indicates the source where the Text is read from.
function readDataSource() { return $this->_datasource; }
* DataSource indicates the source where the Text is read from.
function writeDataSource($value)
function defaultDataSource() { return null; }
* Determines the case of the text within the edit control.
* Note: When CharCase is set to ecLowerCase or ecUpperCase,
* the case of characters is converted as the user types them
* into the edit control. Changing the CharCase property to
* ecLowerCase or ecUpperCase changes the actual contents
* of the text, not just the appearance. Any case information
* is lost and can’t be recaptured by changing CharCase to ecNormal.
* @return enum (ecLowerCase, ecNormal, ecUpperCase)
function readCharCase() { return $this->_charcase; }
* Determines the case of the text within the edit control.
* Note: When CharCase is set to ecLowerCase or ecUpperCase,
* the case of characters is converted as the user types them
* into the edit control. Changing the CharCase property to
* ecLowerCase or ecUpperCase changes the actual contents
* of the text, not just the appearance. Any case information
* is lost and can’t be recaptured by changing CharCase to ecNormal.
* @value enum $value (ecLowerCase, ecNormal, ecUpperCase)
function writeCharCase($value)
function defaultCharCase() { return ecNormal; }
* If IsPassword is true then all characters are displayed with a password
* character defined by the browser.
* Note: The text is still in readable text in the HTML page!
function readIsPassword() { return $this->_ispassword; }
* If IsPassword is true then all characters are displayed with a password
* character defined by the browser.
* Note: The text is still in readable text in the HTML page!
function writeIsPassword($value) { $this->_ispassword = $value; }
function defaultIsPassword() { return 0; }
* Specifies the maximum number of characters the user can enter into
* the edit control. A value of 0 indicates that there is no
* application-defined limit on the length.
function readMaxLength() { return $this->_maxlength; }
* Specifies the maximum number of characters the user can enter into
* the edit control. A value of 0 indicates that there is no
* application-defined limit on the length.
function writeMaxLength($value) { $this->_maxlength= $value; }
function defaultMaxLength() { return 0; }
* Set the control to read-only mode. That way the user cannot enter
* or change the text of the edit control.
function readReadOnly() { return $this->_readonly; }
* Set the control to read-only mode. That way the user cannot enter
* or change the text of the edit control.
function writeReadOnly($value) { $this->_readonly= $value; }
function defaultReadOnly() { return 0; }
* TabOrder indicates in which order controls are access when using
* The value of the TabOrder can be between 0 and 32767.
function readTabOrder() { return $this->_taborder; }
* TabOrder indicates in which order controls are access when using
* The value of the TabOrder can be between 0 and 32767.
function writeTabOrder($value) { $this->_taborder= $value; }
function defaultTabOrder() { return 0; }
* Enable or disable the TabOrder property. The browser may still assign
* a TabOrder by itself internally. This cannot be controlled by HTML.
function readTabStop() { return $this->_tabstop; }
* Enable or disable the TabOrder property. The browser may still assign
* a TabOrder by itself internally. This cannot be controlled by HTML.
function writeTabStop($value) { $this->_tabstop= $value; }
function defaultTabStop() { return 1; }
* Contains the text string associated with the control.
* Only plain text is accepted, all tags are stripped.
function readText() { return $this->_text; }
* Contains the text string associated with the control.
* Only plain text is accepted, all tags are stripped.
function writeText($value) { $this->_text= $value; }
function defaultText() { return ""; }
* Edit publishes many of the properties inherited from CustomEdit,
* but does not introduce any new behavior. For specialized edit controls,
* use other descendant classes of CustomEdit or derive from it.
* Publish the events for the Edit component
function getOnClick () { return $this->readOnClick(); }
function setOnClick ($value) { $this->writeOnClick($value); }
function getOnDblClick () { return $this->readOnDblClick(); }
function setOnDblClick ($value) { $this->writeOnDblClick($value); }
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
* Publish the JS events for the Edit component
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
function getjsOnSelect () { return $this->readjsOnSelect(); }
function setjsOnSelect ($value) { $this->writejsOnSelect($value); }
* Publish the properties for the component
function getBorderStyle()
return $this->readBorderStyle();
function setBorderStyle($value)
$this->writeBorderStyle($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readCharCase();
function setCharCase($value)
$this->writeCharCase($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
return $this->readIsPassword();
function setIsPassword($value)
$this->writeIsPassword($value);
return $this->readMaxLength();
function setMaxLength($value)
$this->writeMaxLength($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readReadOnly();
function setReadOnly($value)
$this->writeReadOnly($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readText();
$this->writeText($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
* CustomMemo is the base class for memo components, which are multiline edit boxes,
* It is inherited from CustomEdit and introduces following new properties:
* Lines, LineSeparator, Text and WordWrap
// The $_lineseparator variable should always be double quoted!!!
// The richeditor property is here since it is used in the loaded() function.
// loaded() needs to know how to treat the input data.
// Note: Do not publish this variable!
//Calls inherited constructor
//If there is something posted
$submitted = $this->input->{$this->Name};
// Escape the posted string if sent from a richeditor;
// otherwise all tags are stripped and plain text is written to Text
$this->Text = ($this->_richeditor) ? $submitted->asSpecialChars() : $submitted->asString();
//If there is any valid DataField attached, update it
// get the common attributes from the CustomEdit
$attributes = $this->getCommonAttributes();
// add the word wrap attribute if set
$attributes .= ($this->_wordwrap == 1) ? " wrap=\"virtual\"" : " wrap=\"off\"";
// maxlength has to be check with some JS; it's not supported by HTML 4.0
"onkeyup=\"return checkMaxLength(this, event, $this->_jsonkeyup)\"",
$attributes .= " onkeyup=\"return checkMaxLength(this, event, null)\"";
// get the common styles from the CustomEdit
$style = $this->getCommonStyles();
if ($style != "") $style = "style=\"$style\"";
// if a datasource is set then get the data from there
//The value to show on the field is the one from the table
$this->Text = $this->readDataFieldValue();
//Dumps hidden fields to know which is the record to update
// call the OnShow event if assigned so the Lines property can be changed
echo "<textarea id=\"$this->_name\" name=\"$this->_name\" $style $attributes>$lines</textarea>";
// add a hidden field so we can determine which event for the memo was fired
$hiddenwrapperfield = $this->getJSWrapperHiddenFieldName();
echo "<input type=\"hidden\" id=\"$hiddenwrapperfield\" name=\"$hiddenwrapperfield\" value=\"\" />";
// only add this function once
function checkMaxLength(obj, event, onKeyUpFunc){
var maxlength = obj.getAttribute ? parseInt(obj.getAttribute(\"maxlength\")) : \"\";
if (obj.getAttribute && obj.value.length > maxlength)
obj.value = obj.value.substring(0, maxlength);
* Add a new line to the Memo. Calls AddLine().
* @param $line string The content of the new line.
* @return integer Returns the number of lines defined.
* Add a new line to the Memo
* @param $line string The content of the new line.
* @return integer Returns the number of lines defined.
* Deletes all text (lines) from the memo control.
* Converts the text of the Lines property into way which can be used
* Please have a look at the PHP function nl2br.
* @return string Returns the Text property with '<br />'
* inserted before all newlines.
return nl2br($this->Text);
* LineSeparator is used in the Text property to convert a string into
* Note: Escaped character need to be in a double-quoted string.
* See <a href="http://www.php.net/manual/en/language.types.string.php">http://www.php.net/manual/en/language.types.string.php</a>
* @link http://www.php.net/manual/en/language.types.string.php
* LineSeparator is used in the Text property to convert a string into
* Note: Escaped character need to be in a double-quoted string.
* See <a href="http://www.php.net/manual/en/language.types.string.php">http://www.php.net/manual/en/language.types.string.php</a>
* @link http://www.php.net/manual/en/language.types.string.php
function writeLineSeparator($value) { $this->_lineseparator = $value; }
* Contains the individual lines of text in the memo control.
* Lines is an array, so the PHP array manipulation functions may be used.
* Note: Do not manipulate the Lines property like this:
* $this->Memo1->Lines[] = "add new line";
* Various versions of PHP implement the behavior of this differently.
* $lines = $this->Memo1->Lines;
* $lines[] = "new line"; // more lines may be added
* $this->Memo1->Lines = $lines;
function readLines() { return $this->_lines; }
* Contains the individual lines of text in the memo control.
* Lines is an array, so the PHP array manipulation functions may be used.
* Note: Do not manipulate the Lines property like this:
* $this->Memo1->Lines[] = "add new line";
* Various versions of PHP implement the behavior of this differently.
* $lines = $this->Memo1->Lines;
* $lines[] = "new line"; // more lines may be added
* $this->Memo1->Lines = $lines;
function writeLines($value)
$this->_lines = (empty($value)) ? array() : array($value);
function defaultLines() { return array(); }
* Text property allows read and write the contents of Lines in a string
* separated by LineSeparator.
* Text property allows read and write the contents of Lines in a string
* separated by LineSeparator.
function writeText($value)
$this->Lines = array($value);
* Determines whether the edit control inserts soft carriage returns
* so text wraps at the right margin.
* Note: This may work with the browsers Firefox and Internet Explorer only.
function readWordWrap() { return $this->_wordwrap; }
* Determines whether the edit control inserts soft carriage returns
* so text wraps at the right margin.
* Note: This may work with the browsers Firefox and Internet Explorer only.
function writeWordWrap($value) { $this->_wordwrap= $value; }
function defaultWordWrap() { return 1; }
* Memo publishes many of the properties inherited from CustomMemo,
* but does not introduce any new behavior. For specialized memo controls,
* use other descendant classes of CustomMemo (e.g. RichEdit) or derive from it.
* Publish the events for the Memo component
function getOnClick () { return $this->readOnClick(); }
function setOnClick ($value) { $this->writeOnClick($value); }
function getOnDblClick () { return $this->readOnDblClick(); }
function setOnDblClick ($value) { $this->writeOnDblClick($value); }
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
* Publish the JS events for the Memo component
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
function getjsOnSelect () { return $this->readjsOnSelect(); }
function setjsOnSelect ($value) { $this->writejsOnSelect($value); }
* Publish the properties for the Memo component
function getBorderStyle()
return $this->readBorderStyle();
function setBorderStyle($value)
$this->writeBorderStyle($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
return $this->readLines();
function setLines($value)
$this->writeLines($value);
return $this->readMaxLength();
function setMaxLength($value)
$this->writeMaxLength($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readReadOnly();
function setReadOnly($value)
$this->writeReadOnly($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
return $this->readWordWrap();
function setWordWrap($value)
$this->writeWordWrap($value);
* Base class for Listbox controls, such as ListBox and ComboBox.
* ListBox displays a collection of items in a scrollable list.
//Calls inherited constructor
parent::__construct($aowner);
$this->ControlStyle= "csRenderOwner=1";
$this->ControlStyle= "csRenderAlso=StyleSheet";
$submitted = $this->input->{$this->Name};
$this->_selitems = $submitted->asStringArray();
$changed = ($this->_itemindex != $submitted->asString());
// the ItemIndex might be an integer or a string,
// only update the data field if the item index was changed
// following somehow does not work here:
// if (array_key_exists($this->_itemindex, $this->_items)) { $this->updateDataField($this->_items[$this->_itemindex]); }
// so let's do it like this...
foreach ($this->_items as $key => $item)
//If there is any valid DataField attached, update it
$submitted = $this->input->{$this->Name};
// Allow the OnSubmit event to be fired because it is not
// a mouse or keyboard event.
$submitEvent = $this->input->{$this->getJSWrapperHiddenFieldName()};
if (is_object($submitEvent) && $this->_enabled == 1)
// check if the a click event has been fired
// check if the a double-click event has been fired
// check if the a change event has been fired
// get the string for the JS Events
$events = $this->readJsEvents();
// add or replace the JS events with the wrappers if necessary
$style .= $this->Font->FontString;
// set the no border style
$style .= "border-width: 0px; border-style: none;";
$style .= "background-color: " . $this->Color . ";";
// add the cursor to the style
$style .= "cursor: $cr;";
// set enabled/disabled status
$enabled = (!$this->_enabled) ? "disabled=\"disabled\"" : "";
$multiselect = ($this->_multiselect == 1) ? "multiple=\"multiple\"" : "";
// if multi-select then the name needs to have [] to indicate it will send an array
// set tab order if tab stop set to true
$taborder = ($this->_tabstop == 1) ? "tabindex=\"$this->_taborder\"" : "";
// get the hint attribute; returns: title="[HintText]"
$hint = $this->getHintAttribute();
$style .= "height:" . $h . "px;width:" . $w . "px;";
$class = ($this->Style != "") ? "class=\"$this->StyleClass\"" : "";
if ($style != "") $style = "style=\"$style\"";
//check if the value of the current data-field is in the itmes array as value
$val = $this->readDataFieldValue();
// get the corresponding key to the value read from the data source
// if an item was found the overwrite the itemindex
//Dumps hidden fields to know which is the record to update
// call the OnShow event if assigned so the Items property can be changed
echo "<select name=\"$name\" id=\"$name\" size=\"$this->_size\" $style $enabled $multiselect $taborder $hint $events $class>";
foreach ($this->_items as $key => $item)
echo "<option value=\"$key\"$selected>$item</option>";
// add a hidden field so we can determine which listbox fired the event
$hiddenwrapperfield = $this->getJSWrapperHiddenFieldName();
echo "<input type=\"hidden\" id=\"$hiddenwrapperfield\" name=\"$hiddenwrapperfield\" value=\"\" />";
* Write the Javascript section to the header
parent::dumpJavascript();
// only output the same function once;
// otherwise if for example two buttons use the same
// OnClick event handler it would be outputted twice.
// output the wrapper function
// output the wrapper function
// output the wrapper function
* <Implementation of functions from super-class; docu can be found there as well>
// Return the first item of the selitems only if
// the itemindex is -1 and multiselect is enabled and there
// are some values selected.
function writeItemIndex($value)
// if multi-select then also add it to the selected array
function defaultItemIndex()
function AddItem($item, $object = null, $itemkey = null)
throw new Exception('Object functionallity for ListBox is not yet implemented.');
//Set the array to the end
//Adds the item as the last one
$this->_items[$itemkey] = $item;
if ($this->_mulitselect == 1)
* Determines whether the user can select more than one element at a time.
* Note: MultiSelect does not work if a data source is assigned.
function readMultiSelect()
* Determines whether the user can select more than one element at a time.
* Note: MultiSelect does not work if a data source is assigned.
function writeMultiSelect($value)
// unset data source if multi select is enabled
$this->writeDataSource(null);
function defaultMultiSelect()
* </Implementation of functions from super-class>
* Checks if $index is selected.
* @param mixed $index Index to be checked.
* @return bool Returns true if $index is selected.
* Select or unselect a specific item.
* @param mixed $index Key or index of the item to select.
* @param bool $value True if selected, otherwise false.
// add it to the selitems
// if the index does not already exist
// remove the index from the selitems
private function sortItems()
// keep the keys when sorting the array (sort does not keep the keys)
* Occurs when the user changed the item of the control.
* @return mixed Returns the event handler or null if no handler is set.
function readOnChange() { return $this->_onchange; }
* Occurs when the user changed the item of the control.
* @param mixed $value Event handler or null if no handler is set.
function writeOnChange($value) { $this->_onchange = $value; }
function defaultOnChange() { return null; }
* Occurs when the user clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
function readOnClick() { return $this->_onclick; }
* Occurs when the user clicks the control.
* @param mixed Event handler or null if no handler is set.
function writeOnClick($value) { $this->_onclick = $value; }
function defaultOnClick() { return null; }
* Occurs when the user double clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
function readOnDblClick() { return $this->_ondblclick; }
* Occurs when the user double clicks the control.
* @param mixed $value Event handler or null if no handler is set.
function writeOnDblClick($value) { $this->_ondblclick = $value; }
function defaultOnDblClick() { return null; }
* Occurs when the control was submitted.
* @return mixed Returns the event handler or null if no handler is set.
function readOnSubmit() { return $this->_onsubmit; }
* Occurs when the control was submitted.
* @param mixed Event handler or null if no handler is set.
function writeOnSubmit($value) { $this->_onsubmit= $value; }
function defaultOnSubmit() { return null; }
* Determines whether the listbox control has a single line border around the client area.
* @return enum (bsNone, bsSingle)
* Determines whether the listbox control has a single line border around the client area.
* @param enum $value (bsNone, bsSingle)
function writeBorderStyle($value) { $this->_borderstyle= $value; }
function defaultBorderStyle() { return bsSingle; }
function readDataField() { return $this->_datafield; }
function writeDataField($value) { $this->_datafield = $value; }
function defaultDataField() { return ""; }
function readDataSource() { return $this->_datasource; }
* If a data source is assigned multi-select cannot be used.
function writeDataSource($value)
// if a data source is assigned then the list box can not be multi-select
function defaultDataSource() { return null; }
* Contains the strings that appear in the list box.
function readItems() { return $this->_items; }
* Contains the strings that appear in the list box.
function writeItems($value)
$this->_items = (empty($value)) ? array() : array($value);
function defaultItems() { return array(); }
* Size of the listbox. Size defines the number of items that are shown
* without a need of scrolling.
* If bigger than 1 most browsers will use Height instead. If Size equals 1
* the listbox truns into a combobox.
function readSize() { return $this->_size; }
* Size of the listbox. Size defines the number of items that are shown
* without a need of scrolling.
* If bigger than 1 most browsers will use Height instead. If Size equals 1
* the listbox truns into a combobox.
function writeSize($value) { $this->_size= $value; }
function defaultSize() { return 4; }
* Specifies whether the items in a list box are arranged alphabetically.
function readSorted() { return $this->_sorted; }
* Specifies whether the items in a list box are arranged alphabetically.
function writeSorted($value)
function defaultSorted() { return 0; }
* TabOrder indicates in which order controls are access when using
* The value of the TabOrder can be between 0 and 32767.
function readTabOrder() { return $this->_taborder; }
* TabOrder indicates in which order controls are access when using
* The value of the TabOrder can be between 0 and 32767.
function writeTabOrder($value) { $this->_taborder= $value; }
function defaultTabOrder() { return 0; }
* Enable or disable the TabOrder property. The browser may still assign
* a TabOrder by itself internally. This cannot be controlled by HTML.
function readTabStop() { return $this->_tabstop; }
* Enable or disable the TabOrder property. The browser may still assign
* a TabOrder by itself internally. This cannot be controlled by HTML.
function writeTabStop($value) { $this->_tabstop= $value; }
function defaultTabStop() { return 1; }
* A class to encapsulate a listbox control
function getOnClick () { return $this->readOnClick(); }
function setOnClick ($value) { $this->writeOnClick($value); }
function getOnDblClick () { return $this->readOnDblClick(); }
function setOnDblClick ($value) { $this->writeOnDblClick($value); }
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
* Publish the properties for the Label component
function getBorderStyle()
return $this->readBorderStyle();
function setBorderStyle($value)
$this->writeBorderStyle($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
function getMultiSelect()
return $this->readMultiSelect();
function setMultiSelect($value)
$this->writeMultiSelect($value);
return $this->readItems();
function setItems($value)
$this->writeItems($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
return $this->readSize();
$this->writeSize($value);
return $this->readSorted();
function setSorted($value)
$this->writeSorted($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
* A class to encapsulate a combobox control.
* Note: It is directly subclassed from CustomListBox since they are almost
* identical in HTML. The only differentce is that no MultiSelect is
//Calls inherited constructor
// size is always 1 to render a ComboBox in the browser
// no MultiSelect possible
* Override the parent MultiSelect related functions; no MultiSelect possible.
// only one or zero items can be selected
function readMultiSelect()
// always return false since MultiSelect can not be used with a ComboBox
function writeMultiSelect($value)
// do nothing; MultiSelect can not be used with a ComboBox
function getOnChange () { return $this->readOnChange(); }
function setOnChange ($value) { $this->writeOnChange($value); }
function getOnDblClick () { return $this->readOnDblClick(); }
function setOnDblClick ($value) { $this->writeOnDblClick($value); }
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
* Publish the properties for the Label component
function getBorderStyle()
return $this->readBorderStyle();
function setBorderStyle($value)
$this->writeBorderStyle($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
return $this->readItems();
function setItems($value)
$this->writeItems($value);
return $this->readItemIndex();
function setItemIndex($value)
$this->writeItemIndex($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
return $this->readSorted();
function setSorted($value)
$this->writeSorted($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
* ButtonControl is the base class for objects that represent button controls,
* such as Button, CheckBox, RadioButton.
// defines which property is set by the datasource
//Calls inherited constructor
$this->ControlStyle= "csRenderOwner=1";
$this->ControlStyle= "csRenderAlso=StyleSheet";
$submitted = $this->input->{$this->Name};
// Allow the OnSubmit event to be fired because it is not
// a mouse or keyboard event.
$submitEventValue = $this->input->{$this->getJSWrapperHiddenFieldName()};
if (is_object($submitEventValue) && $this->_enabled == 1)
// check if the a click event of the current button
* This function was introduced to be flexible with the sub-classed controls.
* It takes all necessary info to dump the control.
* @param string $inputType Input type such as submit, button, check, radio, etc..
* @param string $name Name of the control
* @param string $additionalAttributes String containing additional attributes that will be included in the <input ..> tag.
* @param string $surroundingTags Tags that surround the <input ..> tag. Use %s to specify were the <input> tag should be placed.
* @param bool $composite If true height and width will not be applied to the styles in this function,
* they must be appied at the location where this fucntion is called.
$additionalAttributes = "", $surroundingTags = "%s", $composite = false)
// get the string for the JS Events
$events = $this->readJsEvents();
// add the OnSelect JS-Event
$events .= " onselect=\"return $this->_jsonselect(event)\" ";
// add or replace the JS events with the wrappers if necessary
$style .= $this->Font->FontString;
$style .= "background-color: " . $this->color . ";";
// add the cursor to the style
$style .= "cursor: $cr;";
$style .= "height:" . $this->Height . "px;width:" . $this->Width . "px;";
$style .= "height:100%;width:100%;";
// get the Caption of the button if it is data-aware
// depending on the sub-class there is another property to be set by the data-source (e.g. Button = Caption; CheckBox = Checked)
//Dumps hidden fields to know which is the record to update
// set the checked status
$checked = ($this->_checked) ? "checked=\"checked\"" : "";
// set enabled/disabled status
$enabled = (!$this->_enabled) ? "disabled=\"disabled\"" : "";
// set tab order if tab stop set to true
$taborder = ($this->_tabstop == 1) ? "tabindex=\"$this->_taborder\"" : "";
// get the hint attribute; returns: title="[HintText]"
$hint = $this->getHintAttribute();
if ($style != "") $style = "style=\"$style\"";
$class = ($this->Style != "") ? "class=\"$this->StyleClass\"" : "";
// call the OnShow event if assigned so the Caption property can be changed
// assemble the input tag
$input = "<input type=\"$inputType\" id=\"$name\" name=\"$name\" value=\"$this->_caption\" $events $style $checked $enabled $taborder $hint $additionalAttributes $class />";
printf($surroundingTags, $input);
// add a hidden field so we can determine which button fired the OnClick event
$hiddenwrapperfield = $this->getJSWrapperHiddenFieldName();
echo "<input type=\"hidden\" id=\"$hiddenwrapperfield\" name=\"$hiddenwrapperfield\" value=\"\" />";
* Write the Javascript section to the header
parent::dumpJavascript();
// only output the same function once;
// otherwise if for example two buttons use the same
// OnClick event handler it would be outputted twice.
// output the wrapper function
* Occurs when the user clicks the control.
* @return mixed Returns the event handler or null if no handler is set.
function readOnClick() { return $this->_onclick; }
* Occurs when the user clicks the control.
* @param mixed $value Event handler or null to unset.
function writeOnClick($value) { $this->_onclick = $value; }
function defaultOnClick() { return ""; }
* JS event when the control gets focus.
* @return mixed Returns the event handler or null if no handler is set.
function readjsOnSelect() { return $this->_jsonselect; }
* JS event when the control gets focus.
* @param mixed $value Event handler or null to unset.
function writejsOnSelect($value) { $this->_jsonselect= $value; }
function defaultjsOnSelect() { return null; }
* Occurs when the form containing the control was submitted.
* @return mixed Returns the event handler or null if no handler is set.
function readOnSubmit() { return $this->_onsubmit; }
* Occurs when the form containing the control was submitted.
* @param mixed Event handler or null if no handler is set.
function writeOnSubmit($value) { $this->_onsubmit= $value; }
function defaultOnSubmit() { return null; }
* Specifies whether the button control is checked.
function readChecked() { return $this->_checked; }
* Specifies whether the button control is checked.
function writeChecked($value) { $this->_checked= $value; }
function defaultChecked() { return 0; }
function readDataField() { return $this->_datafield; }
function writeDataField($value) { $this->_datafield = $value; }
function defaultDataField() { return ""; }
function readDataSource() { return $this->_datasource; }
function writeDataSource($value)
function defaultDataSource() { return null; }
* TabOrder indicates in which order controls are access when using
* The value of the TabOrder can be between 0 and 32767.
function readTabOrder() { return $this->_taborder; }
* TabOrder indicates in which order controls are access when using
* The value of the TabOrder can be between 0 and 32767.
function writeTabOrder($value) { $this->_taborder= $value; }
function defaultTabOrder() { return 0; }
* Enable or disable the TabOrder property. The browser may still assign
* a TabOrder by itself internally. This cannot be controlled by HTML.
function readTabStop() { return $this->_tabstop; }
* Enable or disable the TabOrder property. The browser may still assign
* a TabOrder by itself internally. This cannot be controlled by HTML.
function writeTabStop($value) { $this->_tabstop= $value; }
function defaultTabStop() { return 1; }
define('btSubmit', 'btSubmit');
define('btNormal', 'btNormal');
* This class controls the properties and events of a button control.
//Calls inherited constructor
// define which property is set by the datasource
// Check if an imagesource is defined, if yes then let's make an
// override the buttontype if Default is true
// dump to control with all other parameters
* A standard HTML button can have 3 different types:
* - btSubmit submits the HTML form.
* - btReset resets the HTML form back to the initial values.
* - btNormal is a regular button, the browser does not submit the form if no OnClick event has been assigned.
* Note: If Default is true then ButtonType is always btSubmit.
* @return enum (btSubmit, btReset, btNormal)
function readButtonType() { return $this->_buttontype; }
* A standard HTML button can have 3 different types:
* - btSubmit submits the HTML form.
* - btReset resets the HTML form back to the initial values.
* - btNormal is a regular button, the browser does not submit the form if no OnClick event has been assigned.
* Note: If Default is true then ButtonType is always btSubmit.
* @param enum (btSubmit, btReset, btNormal)
function writeButtonType($value)
// if ButtonType is not submit and default is set then unset default
function defaultButtonType() { return btSubmit; }
* Determines whether the button’s OnClick event handler executes when the Enter key is pressed.
* If Default is true the button type is btSubmit.
* Note: This behavior is controlled by the browser and might vary between
function readDefault() { return $this->_default; }
* Determines whether the button’s OnClick event handler executes when the Enter key is pressed.
* If Default is true the button type is btSubmit.
* Note: This behavior is controlled by the browser and might vary between
function writeDefault($value)
// If set to default the ButtonType has to be submit
function defaultDefault() { return 0; }
* An image can be used as button. This is usually done to have a nice graphical interface.
* To avoid distortion make sure you set the images height and width to button's Height and Width.
* If ImageSource is empty it is not used.
* An image can be used as button. This is usually done to have a nice graphical interface.
* To avoid distortion make sure you set the images height and width to button's Height and Width.
* If ImageSource is empty it is not used.
function writeImageSource($value) { $this->_imagesource = $value; }
function defaultImageSource() { return ""; }
* Publish the events for the Button component
function getOnClick () { return $this->readOnClick(); }
function setOnClick($value) { $this->writeOnClick($value); }
* Publish the JS events for the Button component
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
function getjsOnSelect () { return $this->readjsOnSelect(); }
function setjsOnSelect ($value) { $this->writejsOnSelect($value); }
* Publish the properties for the Button component
return $this->readButtonType();
function setButtonType($value)
$this->writeButtonType($value);
return $this->readCaption();
function setCaption($value)
$this->writeCaption($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readDefault();
function setDefault($value)
$this->writeDefault($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
function getImageSource()
return $this->readImageSource();
function setImageSource($value)
$this->writeImageSource($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
* Base class for Checkbox controls.
* CheckBox represents a check box that can be on (checked) or off (unchecked).
//Calls inherited constructor
// define which property is set by the datasource
// check if the CheckBox is checked (compare against the Caption
// since it is submitted as value)
//If there is any valid DataField attached, update it
//If there is any valid DataField attached, update it
$style .= $this->Font->FontString;
$style .= "background-color: ". $this->color. ";";
// add the cursor to the style
$style .= "cursor: $cr;";
$height = $this->Height - 1;
$style .= "height:". $height. "px;width:". $width. "px;";
if ($style != "") $style = "style=\"$style\"";
// get the hint attribute; returns: title="[HintText]"
$hint = $this->getHintAttribute();
// get the alignment of the Caption
$alignment = "align=\"Left\"";
$alignment = "align=\"Center\"";
$alignment = "align=\"Right\"";
$class = ($this->Style != "") ? "class=\"$this->StyleClass\"" : "";
$surroundingTags = "<table cellpadding=\"0\" cellspacing=\"0\" id=\"{$this->_name}_table\" $style $class>< tr>< td width=\"20\">\n ";
$surroundingTags .= "%s\n";
$surroundingTags .= "</td><td $alignment>\n";
// add some JS to the Caption (OnClick)
$surroundingTags .= ($this->Owner != null) ? "<span id=\"{ $this->_name}_caption\" onclick=\" var c = document. forms[0 ]. $this->_name; c. checked = ! c. checked; return ( typeof( c. onclick) == ' function') ? c. onclick() : false;\" $hint $class> " : "<span>";
$surroundingTags .= "</span>\n";
$surroundingTags .= "</td></tr></table>\n";
"", $surroundingTags, true);
* CheckBox represents a check box that can be on (checked) or off (unchecked).
class CheckBox extends CustomCheckBox
* Publish the events for the CheckBox component
function getOnClick () { return $this->readOnClick(); }
function setOnClick($value) { $this->writeOnClick($value); }
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
* Publish the JS events for the CheckBox component
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
function getjsOnSelect () { return $this->readjsOnSelect(); }
function setjsOnSelect ($value) { $this->writejsOnSelect($value); }
* Publish the properties for the CheckBox component
return $this->readAlignment();
function setAlignment($value)
$this->writeAlignment($value);
return $this->readCaption();
function setCaption($value)
$this->writeCaption($value);
return $this->readChecked();
function setChecked($value)
$this->writeChecked($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
* Use RadioButton to add an indipendent radio button to a form.
* Radio buttons present a set of mutually exclusive options to the user- that is,
* only one radio button in a set can be selected at a time.
class RadioButton extends ButtonControl
function __construct($aowner = null)
//Calls inherited constructor
parent::__construct($aowner);
// define which property is set by the datasource
// get the group-name, if non is set then get the name of the RadioButton
$groupname = ($this->_group != '') ? $this->_group : $this->_name;
$submittedValue = $this->input->{$groupname};
// check if the RadioButton is checked (compare against the Caption
// since it is submitted as value)
if (is_object($submittedValue) && $submittedValue->asString() == $this->_caption)
//If there is any valid DataField attached, update it
else if (($this->ControlState & csDesigning) != csDesigning)
//If there is any valid DataField attached, update it
$style .= $this->Font->FontString;
$style .= "background-color: ".$this->color. ";";
// add the cursor to the style
$cr = strtolower(substr($this->_cursor, 2));
$style .= "cursor: $cr;";
$height = $this->Height - 1;
$style .= "height:". $height. "px;width:". $width. "px;";
if ($style != "") $style = "style=\"$style\"";
// get the hint attribute; returns: title="[HintText]"
$hint = $this->getHintAttribute();
// get the alignment of the Caption
$alignment = "align=\"Left\"";
$alignment = "align=\"Center\"";
$alignment = "align=\"Right\"";
$class = ($this->Style != "") ? "class=\"$this->StyleClass\" " : "";
// get the group-name, if non is set then get the name of the RadioButton
$groupname = ($this->_group != '') ? $this->_group : $this->_name;
$surroundingTags = "<table cellpadding=\"0\" cellspacing=\"0\" id=\"{ $this->_name}_table\" $style $class>< tr>< td width=\"20\">\n ";
$surroundingTags .= "%s\n";
$surroundingTags .= "</td><td $alignment>\n";
// Add some JS to the Caption (OnClick).
$surroundingTags .= ($this->Owner != null) ? "<span id=\"{ $this->_name}_caption\" onclick=\" return RadioButtonClick( document. forms[0 ]. $groupname, ' $this->_caption');\" $hint $class> " : "<span>";
$surroundingTags .= "</span>\n";
$surroundingTags .= "</td></tr></table>\n";
"", $surroundingTags, true);
* Write the Javascript section to the header
function dumpJavascript()
parent::dumpJavascript();
// only output the function once
if (!defined('RadioButtonClick'))
define('RadioButtonClick', 1);
// Since all names are the same for the same group we
// have to check with the value attribute.
function RadioButtonClick(elem, caption)
if (typeof(elem.length) == 'undefined') {
return (typeof(elem.onclick) == 'function') ? elem.onclick() : false;
for(var i = 0; i < elem.length; i++) {
if (elem[i].value == caption) {
return (typeof(elem[i].onclick) == 'function') ? elem[i].onclick() : false;
* Group where the RadioButton belongs to.
* If group is empty the name of the RadioButton is used, but usually that is not the desired behavior.
* Group where the RadioButton belongs to.
* If group is empty the name of the RadioButton is used, but usually that is not the desired behavior.
function writeGroup($value)
function defaultGroup() { return ''; }
* Publish the events for the CheckBox component
function getOnClick () { return $this->readOnClick(); }
function setOnClick($value) { $this->writeOnClick($value); }
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
* Publish the JS events for the CheckBox component
function getjsOnBlur () { return $this->readjsOnBlur(); }
function setjsOnBlur ($value) { $this->writejsOnBlur($value); }
function getjsOnChange () { return $this->readjsOnChange(); }
function setjsOnChange ($value) { $this->writejsOnChange($value); }
function getjsOnClick () { return $this->readjsOnClick(); }
function setjsOnClick ($value) { $this->writejsOnClick($value); }
function getjsOnDblClick () { return $this->readjsOnDblClick(); }
function setjsOnDblClick ($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus () { return $this->readjsOnFocus(); }
function setjsOnFocus ($value) { $this->writejsOnFocus($value); }
function getjsOnMouseDown () { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown ($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp () { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp ($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseOver () { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver ($value) { $this->writejsOnMouseOver($value); }
function getjsOnMouseMove () { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove ($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut () { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut ($value) { $this->writejsOnMouseOut($value); }
function getjsOnKeyPress () { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress ($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyDown () { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown ($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyUp () { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp ($value) { $this->writejsOnKeyUp($value); }
function getjsOnSelect () { return $this->readjsOnSelect(); }
function setjsOnSelect ($value) { $this->writejsOnSelect($value); }
* Publish the properties for the CheckBox component
return $this->readAlignment();
function setAlignment($value)
$this->writeAlignment($value);
return $this->readCaption();
function setCaption($value)
$this->writeCaption($value);
return $this->readChecked();
function setChecked($value)
$this->writeChecked($value);
return $this->readColor();
function setColor($value)
$this->writeColor($value);
return $this->readDataField();
function setDataField($value)
$this->writeDataField($value);
return $this->readDataSource();
function setDataSource($value)
$this->writeDataSource($value);
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readGroup();
function setGroup($value)
$this->writeGroup($value);
return $this->readFont();
$this->writeFont($value);
function getParentColor()
return $this->readParentColor();
function setParentColor($value)
$this->writeParentColor($value);
return $this->readParentFont();
function setParentFont($value)
$this->writeParentFont($value);
function getParentShowHint()
return $this->readParentShowHint();
function setParentShowHint($value)
$this->writeParentShowHint($value);
return $this->readPopupMenu();
function setPopupMenu($value)
$this->writePopupMenu($value);
return $this->readShowHint();
function setShowHint($value)
$this->writeShowHint($value);
function getStyle() { return $this->readstyle(); }
function setStyle($value) { $this->writestyle($value); }
return $this->readTabOrder();
function setTabOrder($value)
$this->writeTabOrder($value);
return $this->readTabStop();
function setTabStop($value)
$this->writeTabStop($value);
return $this->readVisible();
function setVisible($value)
$this->writeVisible($value);
define ('sbHorizontal', 'sbHorizontal');
define ('sbVertical', 'sbVertical');
class ScrollBar extends QWidget
protected $_kind = sbHorizontal;
protected $_smallchange=1;
protected $_largechange=1;
$this->dumpCommonContentsTop();
if ($this->_kind== sbHorizontal) { $horiz = "true"; }
else { $horiz = "false"; }
echo " var " . $this->Name . " = new qx.ui.core.ScrollBar($horiz);\n"
. " $this->Name. setLeft(0);\n "
. " $this->Name. setTop(0);\n "
. " $this->Name. setWidth( $this->Width);\n "
. " $this->Name. setHeight( $this->Height);\n "
. " $this->Name. setMaximum( $this->Max);\n "
. " $this->Name. setValue( $this->Position);\n ";
$this->dumpCommonContentsBottom();
* Specifies whether the scroll bar is horizontal or vertical.
* @return enum (sbHorizontal, sbVertical)
function getKind() { return $this->_kind; }
* Specifies whether the scroll bar is horizontal or vertical.
* @param enum (sbHorizontal, sbVertical)
if ($value != $this->_kind)
if (($value == sbHorizontal) && ($w < $h))
if (($value == sbVertical) && ($w > $h))
function defaultKind() { return sbHorizontal; }
* Specifies the minimum position represented by the scroll bar.
function getMin() { return $this->_min; }
* Specifies the minimum position represented by the scroll bar.
function setMin($value) { $this->_min= $value; }
function defaultMin() { return 0; }
* Specifies the maximum position represented by the scroll bar.
function getMax() { return $this->_max; }
* Specifies the maximum position represented by the scroll bar.
function setMax($value) { $this->_max= $value; }
function defaultMax() { return 500; }
* Determines how much Position changes when the user clicks the arrow buttons
* on the scroll bar or presses the arrow keys on the keyboard.
* Note: Not yet implemented.
function getSmallChange() { return $this->_smallchange; }
* Determines how much Position changes when the user clicks the arrow buttons
* on the scroll bar or presses the arrow keys on the keyboard.
* Note: Not yet implemented.
function setSmallChange($value) { $this->_smallchange= $value; }
function defaultSmallChange() { return 1; }
* Determines how much Position changes when the user clicks the scroll bar
* on either side of the thumb tab or presses PgUp or PgDn.
* Note: Not yet implemented.
function getLargeChange() { return $this->_largechange; }
* Determines how much Position changes when the user clicks the scroll bar
* on either side of the thumb tab or presses PgUp or PgDn.
* Note: Not yet implemented.
function setLargeChange($value) { $this->_largechange= $value; }
function defaultLargeChange() { return 1; }
* Indicates the current position of the scroll bar.
function getPosition() { return $this->_position; }
* Indicates the current position of the scroll bar.
function setPosition($value) { $this->_position= $value; }
function defaultPosition() { return 0; }
* Specifies the size of the thumb tab.
* Note: Not yet implemented.
function getPageSize() { return $this->_pagesize; }
* Specifies the size of the thumb tab.
* Note: Not yet implemented.
function setPageSize($value) { $this->_pagesize= $value; }
function defaultPageSize() { return 0; }
function __construct($aowner = null)
//Calls inherited constructor
parent::__construct($aowner);
|