Source for file comctrls.inc.php
Documentation is available at comctrls.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
* ProgressBar Orientation
define ('pbHorizontal', 'pbHorizontal');
define ('pbVertical', 'pbVertical');
* PageControl Tab position
define ('tpBottom', 'tpBottom');
* EditLabel.LabelPosition
//define('lpLeft', 'lpLeft');
//define('lpRight', 'lpRight');
* Text to be shown on the node
function getCaption() { return $this->_caption; }
function setCaption($value)
$this->owner->updateNodeProperties($this);
* Index in the imagelist to select the image to show
function getImageIndex() { return $this->_imageindex; }
function setImageIndex($value) { $this->_imageindex= $value; }
$columns[] = "\"$title\"";
$columns = array("\"M\"", "\"A\"", "\"Subject\"", "\"From\"", "\"Date\"");
echo " var columnData = [" . implode(",", $columns) . "];\n";
echo " var rowData = [];\n\n";
echo " var now = new Date().getTime();\n";
echo " var dateRange = 400 * 24 * 60 * 60 * 1000; // 400 days\n";
echo " var date = new Date(now + Math.random() * dateRange - dateRange / 2);\n";
echo " rowData.push([true, \"\", \"Subject 0\", \"Tester\", date]);\n";
echo " var date = new Date(now + Math.random() * dateRange - dateRange / 2);\n";
echo " rowData.push([false, \"\", \"Subject 1\", \"Developer\", date]);\n\n";
echo " var tableModel = new qx.ui.table.SimpleTableModel();\n";
echo " tableModel.setColumns(columnData);\n";
echo " var $this->Name = new qx.ui.table.Table(tableModel);\n";
echo " $this->Name.getTableColumnModel().setDataCellRenderer(0, new qx.ui.table.BooleanDataCellRenderer());\n";
// echo " $this->Name.getTableColumnModel().setDataCellRenderer(1, new qx.ui.table.IconDataCellRenderer());\n";
echo " $this->Name.getTableColumnModel().setColumnWidth(0, 20);\n";
echo " $this->Name.getTableColumnModel().setColumnWidth(1, 20);\n";
echo " tableModel.setData(rowData);\n";
echo " $this->Name.setBorder(qx.renderer.border.BorderPresets.getInstance().shadow);\n";
echo " $this->Name.setBackgroundColor(\"white\");\n";
echo " $this->Name.setLeft(0);\n";
echo " $this->Name.setTop(0);\n";
echo " $this->Name.setWidth($this->Width);\n";
echo " $this->Name.setHeight($this->Height);\n";
//Calls inherited constructor
* Describes the properties of the columns in the list view.
* @return array Array holding column settings (Title, Width, Type)
protected function readColumns() { return $this->_columns; }
protected function writeColumns($value) { $this->_columns= $value; }
function defaultColumns() { return null; }
* Contains the list of items displayed by the list view.
* @return array Array of items
protected function readItems() { return $this->_items; }
protected function writeItems($value) { $this->_items= $value; }
function defaultItems() { return null; }
//Publish common properties
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getColumns() { return $this->readColumns(); }
function setColumns($value) { $this->writeColumns($value); }
function getItems() { return $this->readItems(); }
function setItems($value) { $this->writeItems($value); }
//function getColor() { return $this->readColor(); }
//function setColor($value) { $this->writeColor($value); }
//function getFont() { return $this->readFont(); }
//function setFont($value) { $this->writeFont($value); }
//function getParentFont() { return $this->readParentFont(); }
//function setParentFont($value) { $this->writeParentFont($value); }
* This getter is overriden to sync the layers with the tabs
function getActiveLayer()
function setActiveLayer($value)
else { $position= "false"; };
echo " var $this->Name = new qx.ui.pageview.tabview.TabView;\n";
echo " $this->Name.setLeft(0);\n";
echo " $this->Name.setTop(0);\n";
echo " $this->Name.setWidth($this->Width);\n";
echo " $this->Name.setHeight($this->Height);\n";
echo " $this->Name.setPlaceBarOnTop($position);\n";
if ($this->_tabs != null)
//$tabs = split("[\n]", $this->_tabs);
$selectedtab= "tab" . $this->Name . "_1";
if ($name == "") continue;
$tabname = "tab" . $this->Name . "_" . $i;
$pagename = "page" . $this->Name . "_" . $i;
echo " var $tabname = new qx.ui.pageview.tabview.Button(\"$name\");\n";
echo " $tabname.addEventListener('click', function(e) { $this->jsOnChange(e); });\n";
$pageblock .= " var $pagename = new qx.ui.pageview.tabview.Page($tabname);\n";
if ($tablist != "") { $tablist .= ","; };
if ($pagelist != "") { $pagelist .= ","; };
if (($i - 1) == $this->_tabindex) { $selectedtab = $tabname; };
echo " $selectedtab.setChecked(true);\n";
echo " $this->Name.getBar().add($tablist);\n";
echo " $this->Name.getPane().add($pagelist);\n";
while(list ($key, $val)= each($pages))
else { $visible= "false"; };
echo " $this->Name.setVisibility($visible);\n";
//Calls inherited constructor
$this->ControlStyle= "csAcceptsControls=1";
* Contains the list of text strings that label the tabs of the tab control.
* @return string List of Strings
protected function readTabs() { return $this->_tabs; }
protected function writeTabs($value) { $this->_tabs= $value; }
function defaultTabs() { return null; }
* Identifies the selected tab on a tab control.
protected function readTabIndex() { return $this->_tabindex; }
protected function writeTabIndex($value) { $this->_tabindex= $value; }
function defaultTabIndex() { return - 1; }
* Determines whether tabs appear at the top or bottom.
* @return enum (tpTop, tpBottom)
protected function readTabPosition() { return $this->_tabposition; }
protected function writeTabPosition($value) { $this->_tabposition= $value; }
function defaultTabPosition() { return tpTop; }
//Publish Standard Properties
function getEnabled() { return $this->readEnabled(); }
function setEnabled($value) { $this->writeEnabled($value); }
function getPopupMenu() { return $this->readPopupMenu(); }
function setPopupMenu($value) { $this->writePopupMenu($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getjsOnActivate() { return $this->readjsOnActivate(); }
function setjsOnActivate($value) { $this->writejsOnActivate($value); }
function getjsOnDeActivate() { return $this->readjsOnDeActivate(); }
function setjsOnDeActivate($value) { $this->writejsOnDeActivate($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 getjsOnContextMenu() { return $this->readjsOnContextMenu(); }
function setjsOnContextMenu($value) { $this->writejsOnContextMenu($value); }
function getjsOnDblClick() { return $this->readjsOnDblClick(); }
function setjsOnDblClick($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus() { return $this->readjsOnFocus(); }
function setjsOnFocus($value) { $this->writejsOnFocus($value); }
function getjsOnKeyDown() { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyPress() { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyUp() { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp($value) { $this->writejsOnKeyUp($value); }
function getjsOnMouseDown() { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp() { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseMove() { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut() { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut($value) { $this->writejsOnMouseOut($value); }
function getjsOnMouseOver() { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver($value) { $this->writejsOnMouseOver($value); }
function getTabs() { return $this->readTabs(); }
function setTabs($value) { $this->writeTabs($value); }
function getTabIndex() { return $this->readTabIndex(); }
function setTabIndex($value) { $this->writeTabIndex($value); }
function getTabPosition() { return $this->readTabPosition(); }
function setTabPosition($value) { $this->writeTabPosition($value); }
* Dumps the first row for the items
protected function dumpRow($item, $level)
$imageindex= $item['ImageIndex'];
$image = $this->_images->readImageByID($imageindex, 1);
if ($image != "null") $image = ", $image, $image";
echo " trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(\"$caption\"" . $image . ");\n";
protected function dumpItem($item, $parent, $level)
$trsname = $this->dumpRow($item, $level);
echo " var $c = new qx.ui.treefullcontrol.TreeFile(trs);\n";
echo " var $c = new qx.ui.treefullcontrol.TreeFolder(trs);\n";
echo " $parent.add($c);\n\n";
while (list ($k, $child)= each($items))
$this->dumpItem($child, $c, ($level + 1));
echo " var trsroot = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(\"Items\");\n";
echo " var $this->Name = new qx.ui.treefullcontrol.Tree(trsroot);\n\n";
echo " var trs = null;\n";
echo " $this->Name.setUseDoubleClick(true);\n";
if ($this->_showlines == 1) echo " $this->Name.setUseTreeLines(true);\n";
else echo " $this->Name.setUseTreeLines(false);\n";
if ($this->_showroot == 1) echo " $this->Name.setHideNode(false);\n";
else echo " $this->Name.setHideNode(true);\n";
echo " $this->Name.setBorder(qx.renderer.border.BorderPresets.getInstance().inset);\n";
echo " $this->Name.setBackgroundColor(\"white\");\n";
echo " $this->Name.setLeft(0);\n";
echo " $this->Name.setTop(0);\n";
echo " $this->Name.setOpen(1);\n";
echo " $this->Name.setOverflow(\"scroll\");\n";
echo " $this->Name.setWidth($this->Width);\n";
echo " $this->Name.setHeight(" . ($this->Height- 1) . ");\n\n";
echo " $this->Name.getManager().addEventListener(\"changeSelection\", $this->_jsonchangeselected);\n";
//Calls inherited constructor
$this->ControlStyle= "csSlowRedraw=1";
$this->setImageList($this->_images);
* Lists the images that can appear beside individual menu items.
protected function readImageList() { return $this->_images; }
function defaultImageList() { return ""; }
* List of Items associated with the Tree
* @return array Array of Items
protected function readItems() { return $this->_items; }
protected function writeItems($value) { $this->_items= $value; }
* Specifies whether to display the lines that link child nodes to their
* corresponding parent nodes.
protected function readShowLines() { return $this->_showlines; }
protected function writeShowLines($value) { $this->_showlines= $value; }
function defaultShowLines() { return 1; }
* Specifies whether lines connecting top-level nodes are displayed.
protected function readShowRoot() { return $this->_showroot; }
protected function writeShowRoot($value){ $this->_showroot= $value; }
function defaultShowRoot() { return 0; }
* Triggered when Current selected item is changed
protected function readjsOnChangeSelected()
protected function writejsOnChangeSelected($value)
//Publish common properties
function getEnabled() { return $this->readEnabled(); }
function setEnabled($value) { $this->writeEnabled($value); }
function getPopupMenu() { return $this->readPopupMenu(); }
function setPopupMenu($value) { $this->writePopupMenu($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getjsOnActivate() { return $this->readjsOnActivate(); }
function setjsOnActivate($value) { $this->writejsOnActivate($value); }
function getjsOnDeActivate() { return $this->readjsOnDeActivate(); }
function setjsOnDeActivate($value) { $this->writejsOnDeActivate($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 getjsOnContextMenu() { return $this->readjsOnContextMenu(); }
function setjsOnContextMenu($value) { $this->writejsOnContextMenu($value); }
function getjsOnDblClick() { return $this->readjsOnDblClick(); }
function setjsOnDblClick($value) { $this->writejsOnDblClick($value); }
function getjsOnFocus() { return $this->readjsOnFocus(); }
function setjsOnFocus($value) { $this->writejsOnFocus($value); }
function getjsOnKeyDown() { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyPress() { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress($value) { $this->writejsOnKeyPress($value); }
function getjsOnKeyUp() { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp($value) { $this->writejsOnKeyUp($value); }
function getjsOnMouseDown() { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown($value) { $this->writejsOnMouseDown($value); }
function getjsOnMouseUp() { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseMove() { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut() { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut($value) { $this->writejsOnMouseOut($value); }
function getjsOnMouseOver() { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver($value) { $this->writejsOnMouseOver($value); }
function getImageList() { return $this->readImageList(); }
function setImageList($value) { $this->writeImageList($value); }
function getItems() { return $this->readItems(); }
function setItems($value) { $this->writeItems($value); }
function getShowLines() { return $this->readShowLines(); }
function setShowLines($value) { $this->writeShowLines($value); }
function getShowRoot() { return $this->readShowRoot(); }
function setShowRoot($value) { $this->writeShowRoot($value); }
function getjsOnChangeSelected() { return $this->readjsOnChangeSelected(); }
function setjsOnChangeSelected($value) { $this->writejsOnChangeSelected($value); }
* Modify the text depending on the CharCase property
* Nothing here. See LabeledEdit for more info
// Nothing here. See LabeledEdit for more info
* Returns an array with the control dimensions
return array(0, 0, $this->Width, $this->Height);
//Once the component has been loaded
//TODO: Read this from the common POST object
if (!$this->owner->UseAjax)
if ((isset ($_POST[$this->Name. "_state"])) && ($_POST[$this->Name. "_state"]!= ''))
$this->callEvent('onclick',array('tag'=> $_POST[$this->Name. "_state"]));
{ $charcase = "lowercase"; }
{ $charcase = "uppercase"; }
if ($this->ReadOnly) { $readonly= "true"; }
else { $readonly= "false"; }
// call the OnShow event if assigned so the Text property can be changed
{ echo " var $this->Name = new qx.ui.form.PasswordField();\n"; }
{ echo " var $this->Name = new qx.ui.form.TextField();\n"; }
echo " $this->Name.setLeft($left);\n"
. " $this->Name.setTop($top);\n"
. " $this->Name.setWidth($width);\n"
. " $this->Name.setHeight($height);\n"
. " $this->Name.setMaxLength($this->MaxLength);\n"
. " $this->Name.setValue(\"$this->Text\");\n"
. " $this->Name.setReadOnly($readonly);\n"
. " $this->Name.setBorder(new qx.renderer.border.Border(1, '$border'));\n";
{ echo " $this->Name.setBackgroundColor(new qx.renderer.color.Color('$this->Color'));\n"; }
{ echo " $this->Name.setStyleProperty('textTransform', '$charcase');\n"; }
* Determines whether the edit control has a single line border
* around the client area.
* @return enum (bsSingle, bsNone)
protected function readBorderStyle() { return $this->_borderstyle; }
protected function writeBorderStyle($value) { $this->_borderstyle= $value; }
protected function defaultBorderStyle() { return bsSingle; }
* 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 (ecNormal, ecLowerCase, ecUpperCase)
protected function readCharCase() { return $this->_charcase; }
protected function defaultCharCase() { return ecNormal; }
* DataField is the fieldname to be attached to the control
protected function readDataField() { return $this->_datafield; }
protected function writeDataField($value) { $this->_datafield = $value; }
protected function defaultDataField() { return ""; }
* DataSource points to a DataSource component if used.
* @return object Reference to the DataSource
protected function readDataSource() { return $this->_datasource; }
protected function defaultDataSource() { return null; }
* 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!
protected function readIsPassword() { return $this->_ispassword; }
protected function writeIsPassword($value) { $this->_ispassword = $value; }
protected 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.
protected function readMaxLength() { return $this->_maxlength; }
protected function writeMaxLength($value) { $this->_maxlength= $value; }
protected 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.
protected function readReadOnly() { return $this->_readonly; }
protected function writeReadOnly($value) { $this->_readonly= $value; }
protected function defaultReadOnly() { return 0; }
* Text info associated with control.
protected function readText() { return $this->_text; }
protected function writeText($value) { $this->_text = $value; }
protected function defaultText() { return ""; }
protected function readOnClick() { return $this->_onclick; }
protected function writeOnClick($value) { $this->_onclick = $value; }
function defaultOnClick() { return null; }
//Calls inherited constructor
//Publish common properties
function getFont() { return $this->readFont(); }
function setFont($value) { $this->writeFont($value); }
function getColor() { return $this->readColor(); }
function setColor($value) { $this->writeColor($value); }
function getEnabled() { return $this->readEnabled(); }
function setEnabled($value) { $this->writeEnabled($value); }
function getParentColor() { return $this->readParentColor(); }
function setParentColor($value) { $this->writeParentColor($value); }
function getParentFont() { return $this->readParentFont(); }
function setParentFont($value) { $this->writeParentFont($value); }
function getParentShowHint() { return $this->readParentShowHint(); }
function setParentShowHint($value) { $this->writeParentShowHint($value); }
function getPopupMenu() { return $this->readPopupMenu(); }
function setPopupMenu($value) { $this->writePopupMenu($value); }
function getShowHint() { return $this->readShowHint(); }
function setShowHint($value) { $this->writeShowHint($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getjsOnActivate() { return $this->readjsOnActivate(); }
function setjsOnActivate($value){ $this->writejsOnActivate($value); }
function getjsOnDeActivate() { return $this->readjsOnDeActivate(); }
function setjsOnDeActivate($value) { $this->writejsOnDeActivate($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 getjsOnContextMenu() { return $this->readjsOnContextMenu(); }
function setjsOnContextMenu($value) { $this->writejsOnContextMenu($value); }
function getjsOnDblClick() { return $this->readjsOnDblClick(); }
function setjsOnDblClick($value){ $this->writejsOnDblClick($value); }
function getjsOnFocus() { return $this->readjsOnFocus(); }
function setjsOnFocus($value) { $this->writejsOnFocus($value); }
function getjsOnKeyDown() { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyPress() { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress($value){ $this->writejsOnKeyPress($value); }
function getjsOnKeyUp() { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp($value) { $this->writejsOnKeyUp($value); }
function getjsOnMouseDown() { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown($value){ $this->writejsOnMouseDown($value); }
function getjsOnMouseUp() { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseMove() { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut() { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut($value) { $this->writejsOnMouseOut($value); }
function getjsOnMouseOver() { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver($value) { $this->writejsOnMouseOver($value); }
function getBorderStyle() { return $this->readBorderStyle(); }
function setBorderStyle($value) { $this->writeBorderStyle($value); }
function getCharCase() { return $this->readCharCase(); }
function setCharCase($value) { $this->writeCharCase($value); }
function getDataField() { return $this->readDataField(); }
function setDataField($value) { $this->writeDataField($value); }
function getDataSource() { return $this->readDataSource(); }
function setDataSource($value) { $this->writeDataSource($value); }
function getIsPassword() { return $this->readIsPassword(); }
function setIsPassword($value) { $this->writeIsPassword($value); }
function getMaxLength() { return $this->readMaxLength(); }
function setMaxLength($value) { $this->writeMaxLength($value); }
function getReadOnly() { return $this->readReadOnly(); }
function setReadOnly($value) { $this->writeReadOnly($value); }
function getText() { return $this->readText(); }
function setText($value) { $this->writeText($value); }
//function getOnClick() { return $this->readOnClick(); }
//function setOnClick($value) { $this->writeOnClick($value); }
//Calls inherited constructor
echo "<div id=\"". $this->Name. "_container\">\n";
'flat'=> $this->Name. "_container",
// 'flatCallback'=>'dateChanged',
// 'dateStatusFunc'=>'ourDateStatusFunc',
'firstDay' => 1, // show Monday first
'height' => $this->Height,
'ifFormat' => '%d/%m/%Y %H:%i:%s %P',
echo "<script type=\"text/javascript\">\n";
echo " $this->Name.table.width='". ($this->Width- 3). "px';\n";
echo " $this->Name.table.height='". ($this->Height- 3). "px';\n";
//Calls inherited constructor
private $_timezone= "UTC";
* The timezone to be used when generating the time for the control
function getTimeZone() { return $this->_timezone; }
function setTimeZone($value) { $this->_timezone= $value; }
function defaultTimeZone() { return "UTC"; }
$style= $this->Font->FontString;
//TODO: ColorToString and StringToColor
$style.= "background-color: ". $this->color. ";";
$style.= "height:". $h. "px;width:". ($w- 15). "px;";
// calendar options go here; see the documentation and/or calendar-setup.js
array('firstDay' => 1, // show Monday first
'ifFormat' => '%Y-%m-%d %I:%M',
// field attributes go here
function getFont() { return $this->readFont(); }
function setFont($value) { $this->writeFont($value); }
function getParentFont() { return $this->readParentFont(); }
function setParentFont($value) { $this->writeParentFont($value); }
function getCaption() { return $this->readCaption(); }
function setCaption($value) { $this->writeCaption($value); }
//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
//$this->updateDataField($this->_text);
function getText() { return $this->_text; }
function setText($value) { $this->_text= $value; }
function defaultText() { return ""; }
* ProgressBar displays a simple progress bar.
$layout= $this->owner->Layout;
else { $orient= "vert"; };
echo "<script type=\"text/javascript\">\n"
. " var " . $this->Name . "=new ProgressBar('$orient',$left,$top,$this->Width,$this->Height,$this->Position);\n"
. " " . $this->Name . ".setRange($this->Min,$this->Max);\n"
. " " . $this->Name . ".setValue(" . $this->Position . ");\n"
. " dynapi.document.addChild(" . $this->Name . ");\n"
echo " ".$this->Name.".onscroll=function(e){\n";
echo " status=".$this->Name.".getValue()\n";
* Specifies whether the progress bar is oriented vertically or horizontally.
* @return enum (pbHorizontal, pbVertical)
protected function readOrientation() { return $this->_orientation; }
protected function writeOrientation($value)
protected function defaultOrientation() { return pbHorizontal; }
* Specifies the current position of the progress bar.
* You can read Position to determine how far the process tracked by the
* progress bar has advanced from Min toward Max. Set Position to cause
* the progress bar to display a position between Min and Max. For example,
* when the process tracked by the progress bar completes, set Position to
* Max so that it appears completely filled.
* When a progress bar is created, Min and Max represent percentages,
* where Min is 0 (0% complete) and Max is 100 (100% complete). If these
* values are not changed, Position is the percentage of the process that
* has already been completed.
protected function readPosition() { return $this->_position; }
protected function writePosition($value) { $this->_position= $value; }
protected function defaultPosition() { return 50; }
* Specifies the lower limit of the range of possible positions.
* Use Max along with the Min property to establish the range of possible
* positions a progress bar. When the process tracked by the progress bar
* begins, the value of Position should equal Min.
protected function readMin() { return $this->_min; }
protected function writeMin($value) { $this->_min= $value; }
protected function defaultMin() { return 0; }
* Specifies the upper limit of the range of possible positions.
* Use Max along with the Min property to establish the range of possible
* positions a progress bar. When the process tracked by the progress bar
* is complete, the value of Position should equal Max.
protected function readMax() { return $this->_max; }
protected function writeMax($value) { $this->_max= $value; }
protected function defaultMax() { return 100; }
* Specifies the amount that Position increases when the StepIt method is called.
protected function readStep() { return $this->_step; }
protected function writeStep($value) { $this->_step= $value; }
protected function defaultStep() { return 10; }
* Advances the Position of the progress bar by a specified amount.
* @param integer increase the value of Position by the given value.
if ($p > $this->Max) { $p = $this->Max; };
* Advances Position by the amount specified in the Step property.
//Calls inherited constructor
$this->ControlStyle= "csSlowRedraw=1";
$this->writeDWidgetClassName("ProgressBar");
// publish new properties
function getOrientation() { return $this->readOrientation(); }
function setOrientation($value) { $this->writeOrientation($value); }
function getPosition() { return $this->readPosition(); }
function setPosition($value) { $this->writePosition($value); }
function getMin() { return $this->readMin(); }
function setMin($value) { $this->writeMin($value); }
function getMax() { return $this->readMax(); }
function setMax($value) { $this->writeMax($value); }
function getStep() { return $this->readStep(); }
function setStep($value) { $this->writeStep($value); }
* MainMenu with graphic capabilities
private $_submenuoffset= 0;
private $_backcolor= "#F0F0F0";
private $_selectedbackcolor= "#C1D2EE";
private $_borderwidth= "1px";
private $_borderstyle= "solid";
private $_bordercolor= "#CCCCCC";
private $_orientation= moHorizontal;
function getOrientation() { return $this->_orientation; }
function setOrientation($value) { $this->_orientation= $value; }
function readParentFont()
//Calls inherited constructor
$this->ControlStyle= "csSlowRedraw=1";
echo "<script type=\"text/javascript\" src=\"". VCL_HTTP_PATH. "/dynapi/src/dynapi.js\"></script>\n";
echo "<script type=\"text/javascript\">\n";
echo "dynapi.library.setPath('". VCL_HTTP_PATH. "/dynapi/src/');\n";
echo "dynapi.library.include('dynapi.api');\n";
echo "dynapi.library.include('HTMLMenu');\n";
echo "dynapi.library.include('Image');\n";
* Dumps a menu item, recursively
$caption= "'". $item['Caption']. "'";
$itemc= "item". $this->_itemcount;
if (array_key_exists('SelectedImage',$item)) $selectedimage= $item['SelectedImage'];
$modifiers= "{oversrc:'$overimage'}";
$img= "var i1 = dynapi.functions.getImage('$backimage', $w, $this->_menuheight, $modifiers);";
$caption= "{image:i1,text:$caption}";
if ($selectedimage!= 'null')
if (array_key_exists('SelectedCondition',$item)) $cond= $item['SelectedCondition'];
$code= "if ($cond) return(1); else return(0);";
$img= "var i1 = dynapi.functions.getImage('$selectedimage', $w, $this->_menuheight, $modifiers);";
$caption= "{image:i1,text:'". $item['Caption']. "'}";
if (array_key_exists('Link',$item)) $link= "'document.location=\'". $item['Link']. "\';'";
echo "$parent.addItem($css,$caption,'$itemc',$link,$w,null,$backcol);\n";
$subitems= $item['Items'];
echo $itemc. "mbar = ". $this->Name. ".createMenuBar('$itemc',$w);\n";
while (list ($k,$v)= each($subitems))
$style= $this->Font->FontString;
echo "<script type=\"text/javascript\">\n";
echo "// Write Style to browser\n";
// echo "HTMLComponent.writeStyle({\n";
// echo " MNUItm: 'cursor: default;border: ".$this->_borderwidth." ".$this->_borderstyle." ".$this->_bordercolor.";',\n";
// echo " MNUItmText: 'cursor: $cr; $style'\n";
echo "var p ={align:\"top\"}\n";
if ($this->_orientation== moVertical) $orientation= "vert";
echo "var ". $this->Name. " = dynapi.document.addChild(new HTMLMenu('','$orientation'),'". $this->Name. "');\n";
echo $this->Name. ".backCol = \"". $this->_backcolor. "\"\n";
echo $this->Name. ".selBgCol = '". $this->_selectedbackcolor. "';\n";
echo $this->Name. ".cssMenu = 'MNU';\n";
echo $this->Name. ".cssMenuText = 'MNUItmText';\n";
echo $this->Name. ".cssMenuItem = 'MNUItm';\n";
echo "var ". $this->Name. "mbar;\n";
if ((!is_array($items)) || (empty($items)))
echo $this->Name. "mbar = ". $this->Name. ".createMenuBar('". $this->Name. "main',". $this->_menuwidth. ",". $this->_menuheight. ",". $this->_submenuoffset. ",0);\n";
while (list ($k,$v)= each($items))
$this->dumpItem($item,$this->Name. "mbar");
echo "<script type=\"text/javascript\">\n";
echo "dynapi.document.insertChild(". $this->Name. ");\n";
function getFont() { return $this->readFont(); }
function setFont($value) { $this->writeFont($value); }
function getMenuItems() { return $this->_menuitems; }
function setMenuItems($value) { $this->_menuitems= $value; }
function getMenuWidth() { return $this->_menuwidth; }
function setMenuWidth($value) { $this->_menuwidth= $value; }
function getMenuHeight() { return $this->_menuheight; }
function setMenuHeight($value) { $this->_menuheight= $value; }
function getSubmenuOffset() { return $this->_submenuoffset; }
function setSubmenuOffset($value) { $this->_submenuoffset= $value; }
function getBackColor() { return $this->_backcolor; }
function setBackColor($value) { $this->_backcolor= $value; }
function getBorderColor() { return $this->_bordercolor; }
function setBorderColor($value) { $this->_bordercolor= $value; }
function getBorderStyle() { return $this->_borderstyle; }
function setBorderStyle($value) { $this->_borderstyle= $value; }
function getBorderWidth() { return $this->_borderwidth; }
function setBorderWidth($value) { $this->_borderwidth= $value; }
function getSelectedBackColor() { return $this->_selectedbackcolor; }
function setSelectedBackColor($value) { $this->_selectedbackcolor= $value; }
* Base class for RichEdit controls.
* This control uses the Xinha as WYSIWYG HTML editor.
* @see http://xinha.python-hosting.com/
* Note: Be aware that after a webpage with a CustomRichEdit has been submitted
* the Lines and Text properties are strings containing any HTML that are
* allowed by the Xinha editor.
* This time is used for to work around a problem in the Xinha editor. The
* editor JS object is not yet initialized while the page is loading.
* The time must be set each time CustomRichEdit gets shown (not persistent),
* so the place to change its value would be OnBeforeShow();.
* A current problem in Xinha is that it does not save the contents of the editor
* back to the textarea when a form.submit(); has been called via JS. By
* adding a JS mouseout event to the editor we can fix that.
* Default value $loadjstime is set to 3000 milliseconds.
//Calls inherited constructor
* Dumps the code to attach an event to the richedit
* @param string $event Javascript function to be attached
* @param string $eventname Name of the event to attach
$result = " HTMLArea._addEvent(html_editor._htmlArea, \"$eventname\", $event);\n";
$result .= " HTMLArea._addEvent(html_editor._doc, \"$eventname\", $event);\n";
* Code to attach all the richedit javascript events
protected function readRichEditJSEvents()
$style = $this->Font->FontString;
$style .= "background-color: " . $this->color . ";";
<script type="text/javascript">
_editor_lang = "en"; // And the language we need to use in the editor.
<script type="text/javascript" src=" <?php echo VCL_HTTP_PATH; ?>/resources/xinha/htmlarea.js"></script>
<script type="text/javascript">
var <?php echo $this->_name; ?>_previous_load = null;
var <?php echo $this->_name; ?>_html_editor = null;
// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
xinha_plugins = xinha_plugins ? xinha_plugins : [];
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
xinha_editors = xinha_editors ? xinha_editors : [' <?php echo $this->_name; ?>'];
xinha_config = xinha_config ? xinha_config : new HTMLArea.Config();
xinha_config.pageStyle = 'body { <?php echo $style; ?> }';
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
<?php echo $this->_name; ?>_html_editor = xinha_editors[' <?php echo $this->_name; ?>'];
// xinha_editors. <?php echo $this->_name; ?>.config.width = <?php echo $this->_width; ?>;
// xinha_editors. <?php echo $this->_name; ?>.config.height = <?php echo $this->_height; ?>;
HTMLArea.startEditors(xinha_editors);
if ( <?php echo $this->_name; ?>_previous_load!=null) <?php echo $this->_name; ?>_previous_load();
<?php echo $this->_name; ?>_previous_load=window.onload;
window.onload = xinha_init;
function updateEditor_ <?php echo $this->_name; ?>()
var html_editor = <?php echo $this->_name; ?>_html_editor;
//TODO: Find a way to disable the xinha control in JS.
//echo ($this->Enabled) ? "" : "html_editor._doc.body.contentEditable = false;\n";
echo $this->readRichEditJSEvents();
// This is a work around so the data in the rich edit gets saved when another control calls form.submit();
// The function needs to be called by a timer since _textArea is not initialized on load.
HTMLArea._addEvent(html_editor._htmlArea, "mouseout", function () {
html_editor._textArea.value = html_editor.getHTML();
// allow enough time to load the page; see public variable to change the time
setTimeout("updateEditor_ <?php echo $this->_name; ?>()", <?php echo $this->loadjstime; ?>);
* A class to encapsulate a wysiwyg editor
* Publish the events for the component
function getOnSubmit () { return $this->readOnSubmit(); }
function setOnSubmit ($value) { $this->writeOnSubmit($value); }
* Publish the JS events for the 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
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);
//TODO: Find a way to disable the xinha control in JS.
return $this->readEnabled();
function setEnabled($value)
$this->writeEnabled($value);
return $this->readFont();
$this->writeFont($value);
return $this->readLines();
function setLines($value)
$this->writeLines($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);
//TODO: Investigate if tabindex can be set on the xinha control.
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 show a trackbar
echo "<script type=\"text/javascript\" src=\"" . VCL_HTTP_PATH . "/jssliderbar/ds_jssliderbar.js\"></script>\n";
$event = $this->jsOnChange;
echo "<script type=\"text/javascript\">\n";
echo "function " . $this->Name . "_Handler(event)\n";
echo " var event = event || window.event;\n";
echo " dsSliderMouseDown(event, '" . $this->Name . "', $this->_maxposition, $event);\n";
$left = $this->Position * $this->Width / $this->MaxPosition - 4;
if ($left < 0) $left = 0;
if ($left + 9 > $this->Width) $left = $this->Width - 9;
echo " <div id=\"" . $this->Name . "_Container\" style=\"position:absolute;top:0px;left:0px;width:"
. $this->Width . "px;height:30px; background-image: url('"
. VCL_HTTP_PATH . "/jssliderbar/ruller.gif'); background-repeat: repeat\">\n";
echo " <input type=\"hidden\" id=\"" . $this->Name . "_Position\" value=\"0\" />\n";
echo " <div id=\"" . $this->Name . "_Head\" style=\"position:absolute;top:5px;left:" . $left . "px;width:9px;height:17px;cursor:pointer;cursor:hand\""
. " onmousedown=\"return " . $this->Name . "_Handler(event);\"><img src=\""
. VCL_HTTP_PATH . "/jssliderbar/head.gif\" style=\"height:17px;width:9px;border:0\"/></div>\n";
* Specifies the maximum Position of a TTrackBar.
protected function readMaxPosition() { return $this->_maxposition; }
protected function writeMaxPosition($value) { $this->_maxposition = $value; }
function defaultMaxPosition() { return 10; }
* Contains the current position of the slider of a TTrackBar.
protected function readPosition() { return $this->_position; }
protected function writePosition($value) { $this->_position = $value; }
function defaultPosition() { return 0; }
function getMaxPosition() { return $this->readMaxPosition(); }
function setMaxPosition($value) { $this->writeMaxPosition($value); }
function getPosition() { return $this->readPosition(); }
function setPosition($value) { $this->writePosition($value); }
function getjsOnChange() { return $this->readjsOnChange(); }
function setjsOnChange($value) { $this->writejsOnChange($value); }
// call the OnShow event if assigned so the Text property can be changed
echo " var $this->Name = new qx.ui.form.Spinner($this->Min,$this->Position,$this->Max);\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.setIncrementAmount($this->Increment);\n"
. " $this->Name.setBorder(new qx.renderer.border.Border(1, '$border'));\n";
echo " $this->Name.addEventListener('change', function(e) { hid=findObj(\"". $this->Name. "_state\"); hid.value=$this->Name.getValue(); });\n";
* Check the position property between min and max
if ($this->Min > $this->Max)
{ $this->Max = $this->Min; }
if ($this->Position > $this->Max)
{ $this->Position = $this->Max; }
if ($this->Position < $this->Min)
{ $this->Position = $this->Min; }
* Determines whether the edit control has a single line border
* around the client area.
* @return enum (bsSingle, bsNone)
protected function readBorderStyle() { return $this->_borderstyle; }
protected function writeBorderStyle($value) { $this->_borderstyle= $value; }
protected function defaultBorderStyle() { return bsSingle; }
protected function readDataField() { return $this->_datafield; }
protected function writeDataField($value) { $this->_datafield = $value; }
protected function defaultDataField() { return ""; }
* DataSource points to a DataSource component if used.
* @return object Reference to the DataSource
protected function readDataSource() { return $this->_datasource; }
protected function defaultDataSource() { return null; }
* Specifies the amount the Position value changes each time the up
* or down button is pressed.
protected function readIncrement() { return $this->_increment; }
protected function writeIncrement($value) { $this->_increment= $value; }
protected function defaultIncrement() { return 1; }
* Specifies the minimum value of the Position property.
protected function readMin() { return $this->_min; }
protected function defaultMin() { return 0; }
* Specifies the maximum value of the Position property.
protected function readMax() { return $this->_max; }
protected function defaultMax() { return 100; }
* Specifies the current value represented by the up-down control.
protected function readPosition() { return $this->_position; }
protected function defaultPosition() { return 0; }
//Calls inherited constructor
//function getFont() { return $this->readFont(); }
//function setFont($value) { $this->writeFont($value); }
//function getParentFont() { return $this->readParentFont(); }
//function setParentFont($value) { $this->writeParentFont($value); }
function getAlignment() { return $this->readAlignment(); }
function setAlignment($value) { $this->writeAlignment($value); }
function getParentShowHint() { return $this->readParentShowHint(); }
function setParentShowHint($value) { $this->writeParentShowHint($value); }
function getShowHint() { return $this->readShowHint(); }
function setShowHint($value) { $this->writeShowHint($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
// Publish new properties
function getBorderStyle() { return $this->readBorderStyle(); }
function setBorderStyle($value) { $this->writeBorderStyle($value); }
function getDataField() { return $this->readDataField(); }
function setDataField($value) { $this->writeDataField($value); }
function getDataSource() { return $this->readDataSource(); }
function setDataSource($value) { $this->writeDataSource($value); }
function getIncrement() { return $this->readIncrement(); }
function setIncrement($value) { $this->writeIncrement($value); }
function getMin() { return $this->readMin(); }
function setMin($value) { $this->writeMin($value); }
function getMax() { return $this->readMax(); }
function setMax($value) { $this->writeMax($value); }
function getPosition() { return $this->readPosition(); }
function setPosition($value) { $this->writePosition($value); }
function getjsOnActivate() { return $this->readjsOnActivate(); }
function setjsOnActivate($value){ $this->writejsOnActivate($value); }
function getjsOnDeActivate() { return $this->readjsOnDeActivate(); }
function setjsOnDeActivate($value) { $this->writejsOnDeActivate($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 getjsOnContextMenu() { return $this->readjsOnContextMenu(); }
function setjsOnContextMenu($value) { $this->writejsOnContextMenu($value); }
function getjsOnDblClick() { return $this->readjsOnDblClick(); }
function setjsOnDblClick($value){ $this->writejsOnDblClick($value); }
function getjsOnFocus() { return $this->readjsOnFocus(); }
function setjsOnFocus($value) { $this->writejsOnFocus($value); }
function getjsOnKeyDown() { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyPress() { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress($value){ $this->writejsOnKeyPress($value); }
function getjsOnKeyUp() { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp($value) { $this->writejsOnKeyUp($value); }
function getjsOnMouseDown() { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown($value){ $this->writejsOnMouseDown($value); }
function getjsOnMouseUp() { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseMove() { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut() { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut($value) { $this->writejsOnMouseOut($value); }
function getjsOnMouseOver() { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver($value) { $this->writejsOnMouseOver($value); }
// protected $_jsonchange=null;
if ($value[0]== '#') $value= substr($value,1);
// echo " d.setBackgroundColor('#EBE9ED');\n";
echo " var $this->Name = new qx.ui.component.ColorSelector($value);\n";
echo " $this->Name.setLeft(0);\n";
echo " $this->Name.setTop(0);\n";
echo " $this->Name.setWidth($this->Width);\n";
echo " $this->Name.setHeight($this->Height);\n";
echo " $this->Name.setBackgroundColor('#EBE9ED');\n";
else { $visible= "false"; };
echo " $this->Name.setVisibility($visible);\n";
echo " $this->Name.addEventListener(\"dialogok\", $this->_jsonchange);\n";
//Calls inherited constructor
$this->ControlStyle= "csSlowRedraw=1";
//Publish common properties
function getColor() { return $this->readColor(); }
function setColor($value) { $this->writeColor($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getjsOnChange() { return $this->readjsOnChange(); }
function setjsOnChange($value) { $this->writejsOnChange($value); }
* LabeledEdit is an edit control that has an associated label.
* Assign the $dest->caption to the control caption
* @param object $dest Component to set the caption to
* Specifies the caption used in the label
protected function readCaption() { return $this->_caption; }
protected function writeCaption($value) { $this->_caption= $value; }
function defaultCaption() { return ""; }
function getCaption() { return $this->readCaption(); }
function setCaption($value) { $this->writeCaption($value); }
* Calculates the rect for the editor component
return array(0, $y, $this->Width, $this->Height - 14 - $this->_lblspacing);
* Dumps the control for the label part of the component
echo " var $this->_lblname = new qx.ui.basic.Atom(\"" . $this->_edtlabel->Caption . "\");\n"
. " $this->_lblname.setWidth($this->Width);\n"
. " $this->_lblname.setHorizontalChildrenAlign(\"left\");\n";
else { $visible= "false"; };
echo " $this->_lblname.setVisibility($visible);\n"
. " inline_div.add($this->_lblname);\n";
//Calls inherited constructor
//Sets the caption if not already changed
* Use EditLabel to work with the label that is associated with this
* labeled edit control. Use this label’s properties to specify the
* caption that appears on the label.
protected function readEditLabel() { return $this->_edtlabel; }
protected function writeEditLabel($value) { if (is_object($value)) $this->_edtlabel= $value; }
* Specifies the position of the label relative to the edit control.
* @return enum (lpAbove, lpBelow)
protected function readLabelPosition() { return $this->_lblposition; }
protected function writeLabelPosition($value) { $this->_lblposition= $value; }
function defaultLabelPosition() { return lpAbove; }
* Specifies the distance, in pixels, between the label and the edit region.
protected function readLabelSpacing() { return $this->_lblspacing; }
protected function writeLabelSpacing($value) { $this->_lblspacing= $value; }
function defaultLabelSpacing() { return 3; }
//Publish common properties
//function getFont() { return $this->readFont(); }
//function setFont($value) { $this->writeFont($value); }
function getColor() { return $this->readColor(); }
function setColor($value) { $this->writeColor($value); }
function getEnabled() { return $this->readEnabled(); }
function setEnabled($value) { $this->writeEnabled($value); }
function getParentColor() { return $this->readParentColor(); }
function setParentColor($value) { $this->writeParentColor($value); }
function getParentFont() { return $this->readParentFont(); }
function setParentFont($value) { $this->writeParentFont($value); }
function getParentShowHint() { return $this->readParentShowHint(); }
function setParentShowHint($value) { $this->writeParentShowHint($value); }
function getPopupMenu() { return $this->readPopupMenu(); }
function setPopupMenu($value) { $this->writePopupMenu($value); }
function getShowHint() { return $this->readShowHint(); }
function setShowHint($value) { $this->writeShowHint($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
//Publish Edit control properties
function getBorderStyle() { return $this->readBorderStyle(); }
function setBorderStyle($value) { $this->writeBorderStyle($value); }
function getCharCase() { return $this->readCharCase(); }
function setCharCase($value) { $this->writeCharCase($value); }
function getDataField() { return $this->readDataField(); }
function setDataField($value) { $this->writeDataField($value); }
function getDataSource() { return $this->readDataSource(); }
function setDataSource($value) { $this->writeDataSource($value); }
function getIsPassword() { return $this->readIsPassword(); }
function setIsPassword($value) { $this->writeIsPassword($value); }
function getMaxLength() { return $this->readMaxLength(); }
function setMaxLength($value) { $this->writeMaxLength($value); }
function getReadOnly() { return $this->readReadOnly(); }
function setReadOnly($value) { $this->writeReadOnly($value); }
function getText() { return $this->readText(); }
function setText($value) { $this->writeText($value); }
function getjsOnActivate() { return $this->readjsOnActivate(); }
function setjsOnActivate($value){ $this->writejsOnActivate($value); }
function getjsOnDeActivate() { return $this->readjsOnDeActivate(); }
function setjsOnDeActivate($value) { $this->writejsOnDeActivate($value); }
function getjsOnChange() { return $this->readjsOnChange(); }
function setjsOnChange($value) { $this->writejsOnChange($value); }
function getjsOnBlur() { return $this->readjsOnBlur(); }
function setjsOnBlur($value) { $this->writejsOnBlur($value); }
function getjsOnClick() { return $this->readjsOnClick(); }
function setjsOnClick($value) { $this->writejsOnClick($value); }
function getjsOnContextMenu() { return $this->readjsOnContextMenu(); }
function setjsOnContextMenu($value) { $this->writejsOnContextMenu($value); }
function getjsOnDblClick() { return $this->readjsOnDblClick(); }
function setjsOnDblClick($value){ $this->writejsOnDblClick($value); }
function getjsOnFocus() { return $this->readjsOnFocus(); }
function setjsOnFocus($value) { $this->writejsOnFocus($value); }
function getjsOnKeyDown() { return $this->readjsOnKeyDown(); }
function setjsOnKeyDown($value) { $this->writejsOnKeyDown($value); }
function getjsOnKeyPress() { return $this->readjsOnKeyPress(); }
function setjsOnKeyPress($value){ $this->writejsOnKeyPress($value); }
function getjsOnKeyUp() { return $this->readjsOnKeyUp(); }
function setjsOnKeyUp($value) { $this->writejsOnKeyUp($value); }
function getjsOnMouseDown() { return $this->readjsOnMouseDown(); }
function setjsOnMouseDown($value){ $this->writejsOnMouseDown($value); }
function getjsOnMouseUp() { return $this->readjsOnMouseUp(); }
function setjsOnMouseUp($value) { $this->writejsOnMouseUp($value); }
function getjsOnMouseMove() { return $this->readjsOnMouseMove(); }
function setjsOnMouseMove($value) { $this->writejsOnMouseMove($value); }
function getjsOnMouseOut() { return $this->readjsOnMouseOut(); }
function setjsOnMouseOut($value) { $this->writejsOnMouseOut($value); }
function getjsOnMouseOver() { return $this->readjsOnMouseOver(); }
function setjsOnMouseOver($value) { $this->writejsOnMouseOver($value); }
// publish new properties
function getEditLabel() { return $this->readEditLabel(); }
function setEditLabel($value) { $this->writeEditLabel($value); }
function getLabelPosition() { return $this->readLabelPosition(); }
function setLabelPosition($value) { $this->writeLabelPosition($value); }
function getLabelSpacing() { return $this->readLabelSpacing(); }
function setLabelSpacing($value) { $this->writeLabelSpacing($value); }
//function getOnClick() { return $this->readOnClick(); }
//function setOnClick($value) { $this->writeOnClick($value); }
$this->writeImages($this->_images);
//This function is used as a common click processor for all item clicks
echo '<script type="text/javascript">';
echo "function $this->Name". "_clickwrapper(e)\n";
if ($this->JsOnClick!= null)
echo " submit=". $this->JsOnClick. "(e);\n";
echo " var tag=e.getTarget().tag;\n";
echo " if ((tag!=0) && (submit))\n";
echo " var hid=findObj('$this->Name". "_state');\n";
echo " if (hid) hid.value=tag;\n";
$form = "document.". $this->owner->Name;
echo " if (($form.onsubmit) && (typeof($form.onsubmit) == 'function')) { $form.onsubmit(); }\n";
echo " $form.submit();\n";
private function dumpParts()
echo " <!-- Part #$index Start -->\n";
echo " var tbp = new qx.ui.toolbar.Part;\n";
$subitems = $item['Items'];
if ((isset ($subitems)) && (count($subitems)))
$this->dumpButtons("tbp", $subitems);
echo " $this->Name.add(tbp);\n";
echo " <!-- Part $index End -->\n";
private function dumpButtons($name, $items)
while(list ($index, $item) = each($items))
$caption= $item['Caption'];
$imageindex= $item['ImageIndex'];
$image = $this->_images->readImageByID($imageindex, 1);
$itemname = $name . "_" . $index;
echo " var $itemname = new qx.ui.toolbar.Separator();\n";
echo " var $itemname = new qx.ui.toolbar.Button(\"$caption\", $image);\n";
echo " $itemname.addEventListener(\"execute\", " . $this->Name . "_clickwrapper);\n";
echo " $itemname.tag=$tag;\n";
echo " $name.add(" . implode(",", $elements) . ");\n";
echo " var ". $this->Name. " = new qx.ui.toolbar.ToolBar;\n";
echo " $this->Name.setLeft(0);\n";
echo " $this->Name.setTop(0);\n";
echo " $this->Name.setWidth($this->Width);\n";
echo " $this->Name.setHeight(". ($this->Height- 1). ");\n";
echo " <!-- Part Main Start -->\n";
echo " var tbp = new qx.ui.toolbar.Part;\n";
$this->dumpButtons("tbp", $this->_items);
echo " $this->Name.add(tbp);\n";
echo " <!-- Part Main End -->\n";
//Calls inherited constructor
function defaultAlign() { return alTop; }
* Lists the images that can appear beside individual menu items.
protected function readImages() { return $this->_images; }
function defaultImages() { return null; }
* Describes the elements of the menu.
* Use Items to access information about the elements in the menu.
* Item contain information about Caption, associated image and Tag.
* @return item collection
protected function readItems() { return $this->_items; }
protected function writeItems($value) { $this->_items= $value; }
* Defines how items specified are used to build toolbar elements
* If set to True then main level in the Items tree will define Parts
* and elements from sublevel will be used to build buttons
* Otherwise, only elements from the main level are used and all subitems are ignored.
protected function readUseParts() { return $this->_useparts; }
protected function writeUseParts($value){ $this->_useparts= $value; }
function defaultUseParts() { return false; }
//Publish common properties
// function getColor() { return $this->readColor(); }
// function setColor($value) { $this->writeColor($value); }
// function getFont() { return $this->readFont(); }
// function setFont($value) { $this->writeFont($value); }
// function getParentFont() { return $this->readParentFont(); }
// function setParentFont($value) { $this->writeParentFont($value); }
function getVisible() { return $this->readVisible(); }
function setVisible($value) { $this->writeVisible($value); }
function getjsOnClick() { return $this->readjsOnClick(); }
function setjsOnClick($value) { $this->writejsOnClick($value); }
function getImages() { return $this->readImages(); }
function setImages($value) { $this->writeImages($value); }
function getItems() { return $this->readItems(); }
function setItems($value) { $this->writeItems($value); }
function getUseParts() { return $this->readUseParts(); }
function setUseParts($value) { $this->writeUseParts($value); }
|