You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(10) |
Jul
(24) |
Aug
(93) |
Sep
(261) |
Oct
(257) |
Nov
(218) |
Dec
(95) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(184) |
Feb
(87) |
Mar
(155) |
Apr
(398) |
May
(201) |
Jun
(35) |
Jul
(68) |
Aug
(92) |
Sep
(52) |
Oct
(111) |
Nov
(135) |
Dec
(116) |
2009 |
Jan
(225) |
Feb
(204) |
Mar
(113) |
Apr
(137) |
May
(220) |
Jun
(199) |
Jul
(196) |
Aug
(98) |
Sep
(100) |
Oct
(179) |
Nov
(164) |
Dec
(72) |
2010 |
Jan
(59) |
Feb
(61) |
Mar
(64) |
Apr
(159) |
May
(107) |
Jun
(252) |
Jul
(180) |
Aug
(96) |
Sep
(82) |
Oct
(58) |
Nov
(43) |
Dec
(53) |
2011 |
Jan
(39) |
Feb
(18) |
Mar
(33) |
Apr
(66) |
May
(48) |
Jun
(124) |
Jul
(112) |
Aug
(62) |
Sep
(45) |
Oct
(102) |
Nov
(47) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(18) |
Mar
(1) |
Apr
(5) |
May
(18) |
Jun
(13) |
Jul
(9) |
Aug
(38) |
Sep
(3) |
Oct
(7) |
Nov
(24) |
Dec
(6) |
2013 |
Jan
(1) |
Feb
(14) |
Mar
(1) |
Apr
(2) |
May
(3) |
Jun
(4) |
Jul
(9) |
Aug
(4) |
Sep
(7) |
Oct
|
Nov
(1) |
Dec
(4) |
2014 |
Jan
(9) |
Feb
(2) |
Mar
|
Apr
|
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <d_w...@us...> - 2011-11-28 09:38:34
|
Revision: 21605 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21605&view=rev Author: d_wagner Date: 2011-11-28 09:38:23 +0000 (Mon, 28 Nov 2011) Log Message: ----------- [BUG #5829] Removed autoplay feature Modified Paths: -------------- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/DemoBrowser.js Modified: trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/DemoBrowser.js =================================================================== --- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/DemoBrowser.js 2011-11-27 23:43:56 UTC (rev 21604) +++ trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/DemoBrowser.js 2011-11-28 09:38:23 UTC (rev 21605) @@ -133,6 +133,7 @@ this.__versionSelect.add(li); } + /* if (this.__versionSelect.getSelection()[0].getLabel().indexOf("-pre")) { var items = this.__versionSelect.getChildren(); for (var i=0,l=items.length; i<l; i++) { @@ -142,13 +143,14 @@ } } } - + */ }, treeGetSelection : function(e) { this._apiButton.setEnabled(false); var treeNode = this.tree.getSelection()[0]; + this._runbutton.setEnabled(!treeNode.hasChildren()); var modelNode = treeNode.getUserData("modelLink"); this.tests.selected = this.tests.handler.getFullName(modelNode); if (modelNode) { @@ -222,9 +224,6 @@ { this.setActiveView("demo"); - this._runbutton.setVisibility("excluded"); - this._stopbutton.setVisibility("visible"); - if (this.tests.selected && this.tests.selected.indexOf(".html") > 0) { var file = this.tests.selected.replace(/\|/g, "/"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-27 23:44:02
|
Revision: 21604 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21604&view=rev Author: sandersson Date: 2011-11-27 23:43:56 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:36:12 UTC (rev 21603) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:43:56 UTC (rev 21604) @@ -200,8 +200,13 @@ */ _onPreviousPageButtonClick : function(e) { - this.__pageContainer.gotoRelativePage(-1); + var pageContainer = this.__pageContainer; + if(pageContainer.getCurrentPage() > 1) + { + pageContainer.gotoRelativePage(-1); + } + this.checkEnable(); }, @@ -224,8 +229,13 @@ */ _onNextPageButtonClick : function(e) { - this.__pageContainer.gotoRelativePage(1); + var pageContainer = this.__pageContainer; + if(pageContainer.getCurrentPage() < pageContainer.getNumPages()) + { + pageContainer.gotoRelativePage(1); + } + this.checkEnable(); }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-27 23:36:19
|
Revision: 21603 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21603&view=rev Author: sandersson Date: 2011-11-27 23:36:12 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:14:10 UTC (rev 21602) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:36:12 UTC (rev 21603) @@ -207,18 +207,14 @@ _onGotoPageChangeValue : function(e) { - var newFrame = e.getData(); + var newPage = e.getData(); + var pageContainer = this.__pageContainer; - if(newFrame.indexOf('+') == 0 || newFrame.indexOf('-') == 0) + if(newPage >= 1 && newPage <= pageContainer.getNumPages() && newPage != pageContainer.getCurrentPage()) { - this.__pageContainer.gotoRelativePage(newFrame, false); + pageContainer.gotoPage(newPage); + this.checkEnable(); } - else - { - this.__pageContainer.gotoPage(newFrame, false); - } - - this.checkEnable(); }, /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-27 23:14:17
|
Revision: 21602 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21602&view=rev Author: sandersson Date: 2011-11-27 23:14:10 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:12:18 UTC (rev 21601) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:14:10 UTC (rev 21602) @@ -54,14 +54,7 @@ this._createChildControl("control-pane"); - if(pageContainer != null) - { - this.__pageContainer = pageContainer; - } - else - { - this.__pageContainer = this.getLayoutParent(); - } + this.__pageContainer = pageContainer || this.getLayoutParent(); }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-27 23:12:24
|
Revision: 21601 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21601&view=rev Author: sandersson Date: 2011-11-27 23:12:18 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js 2011-11-27 23:12:18 UTC (rev 21601) @@ -0,0 +1,121 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * A page control interface to control the scrolling between pages. + */ +qx.Interface.define("qxe.ui.control.IPageControl", +{ + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + gotoFirstPage : function() + { + }, + + gotoPreviousPage : function() + { + this.gotoRelativePage(-1); + }, + + gotoNextPage : function() + { + this.gotoRelativePage(1); + }, + + /** + * 1. go to top of current page + * 2. go to top of first page + */ + gotoPageTop : function() + { + }, + + /** + * 1. go to bottom of current page + * 2. go to bottom of last page + */ + gotoPageBottom : function() + { + }, + + gotoLast : function() + { + }, + + goUp : function() + { + }, + + goDown : function() + { + }, + + /** + * + * fieldChange to prevent reentrance to the textfield of current page + * + */ + gotoRelativePage : function(relativeFrame, fieldChange) + { + }, + + /** + * + * fieldChange to prevent reentrance to the textfield of current page + * + */ + gotoPage : function(absoluteFrame, fieldChange) + { + }, + + goPageUp : function() + { + }, + + goPageDown : function() + { + }, + + /* + * + */ + getCurrentPage : function() + { + }, + + /* + * + * + */ + getNumPages : function() + { + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js 2011-11-27 23:12:18 UTC (rev 21601) @@ -0,0 +1,185 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * A page control mixin to control the scrolling between pages. + */ +qx.Mixin.define("qxe.ui.control.MPageControl", +{ + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + gotoPage : function(page) + { + +// this.getChildControl("scroll-pane").scrollToY(0); + }, + + gotoPreviousPage : function() + { + this.gotoRelativePage(-1); + +// this.getChildControl("scroll-pane").scrollToY(0); + }, + + gotoNextPage : function() + { +// this.gotoRelativePage(1); + +// this.getChildControl("scroll-pane").scrollToY(0); + }, + + /** + * 1. go to top of current page + * 2. go to top of first page + */ + gotoPageTop : function() + { + }, + + /** + * 1. go to bottom of current page + * 2. go to bottom of last page + */ + gotoPageBottom : function() + { + }, + + gotoLast : function() + { + }, + + goUp : function() + { + }, + + goDown : function() + { + }, + + /** + * + * fieldChange to prevent reentrance to the textfield of current page + * + */ + gotoRelativePage : function(relativeFrame, fieldChange) + { + }, + + /** + * + * fieldChange to prevent reentrance to the textfield of current page + * + */ + gotoPage : function(absoluteFrame, fieldChange) + { + }, + + goPageUp : function() + { + }, + + goPageDown : function() + { + }, + + _onKeyUp : function(e) + { + var key = (e.isCtrlPressed() ? "Ctrl-" : "") + (e.isShiftPressed() ? "Shift-" : "") + (e.getType() !== "keyinput" ? e.getKeyIdentifier() : ""); + + switch(key) + { + case "Home": +// this.getChildControl("scroll-pane").scrollToY(0); + break; + + case "Ctrl-Home": + this.gotoPageTop(); + break; + + case "Ctrl-Shift-Home": + this.gotoPage(1); + break; + + case "End": +// var flashS = this.getChildControl("scroll-pane"); +// var maxPosition = flashS.getChildControl("pane").getScrollMaxY(); + +// flashS.scrollToY(maxPosition); + break; + + case "Ctrl-End": + this.gotoPageBottom(); + break; + + case "Ctrl-Shift-End": + this.gotoLast(); + break; + + case "Up": + this.goUp(); + break; + + case "Down": + this.goDown(); + break; + + case "PageUp": + this.goPageUp(); + break; + + case "Ctrl-PageUp": + this.gotoRelativePage(-1); + break; + + case "PageDown": + this.goPageDown(); + break; + + case "Ctrl-PageDown": + this.gotoRelativePage(1); + break; + } + }, + + /* + * + */ + getCurrentPage : function() + { + }, + + /* + * + * + */ + getTotalPages : function() + { + }, + + enableAll : function() + { +// this.getChildControl("search-pane").setEnabled(true); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-27 23:12:18 UTC (rev 21601) @@ -0,0 +1,295 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qx/icon/${qx.icontheme}/16/actions/go-first.png) +#asset(qx/icon/${qx.icontheme}/16/actions/go-previous.png) +#asset(qx/icon/${qx.icontheme}/16/actions/go-next.png) +#asset(qx/icon/${qx.icontheme}/16/actions/go-last.png) + +************************************************************************ */ + +/** + * A page control pane to control the scrolling between pages. + * + * @childControl control-pane {qx.ui.container.Composite} a pane of all page control widgets. + * @childControl first-page-button {qx.ui.form.Button} go to first page button + * @childControl previous-page-button {qx.ui.form.Button} go to previous page button + * @childControl current-page-field {qx.ui.form.TextField} the current page field + * @childControl num-pages-field {qx.ui.form.TextField} the total number of pages field + * @childControl next-page-button {qx.ui.form.Button} go to next page button + * @childControl last-page-button {qx.ui.form.Button} go to last page button + */ +qx.Class.define("qxe.ui.control.PageControl", +{ + extend : qx.ui.core.Widget, + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function(pageContainer) + { + this.base(arguments); + + // configure internal layout + this._setLayout(new qx.ui.layout.Canvas()); + + this._createChildControl("control-pane"); + + if(pageContainer != null) + { + this.__pageContainer = pageContainer; + } + else + { + this.__pageContainer = this.getLayoutParent(); + } + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "page-control" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** The container class where this widget is added. */ + __pageContainer : null, + + // overridden + _createChildControlImpl : function(id) + { + var control; + var tooltip; + + switch(id) + { + case "control-pane": + control = new qx.ui.container.Composite(new qx.ui.layout.HBox()); + control.add(this._createChildControl("first-page-button")); + control.add(this._createChildControl("previous-page-button")); + control.add(this._createChildControl("current-page-field")); + + var dash = new qx.ui.basic.Label("/"); + dash.setAlignY("middle"); + dash.setMarginLeft(2); + dash.setMarginRight(2); + + control.add(dash); + control.add(this._createChildControl("num-pages-field")); + control.add(this._createChildControl("next-page-button")); + control.add(this._createChildControl("last-page-button")); + + this._add(control); + break; + + case "first-page-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Go to first page.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/go-first.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onFirstPageButtonClick, this); + break; + + case "previous-page-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Go to previous page.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/go-previous.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onPreviousPageButtonClick, this); + break; + + case "current-page-field": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Current page number.")); + + control = new qx.ui.form.TextField(); + control.setTextAlign("right"); + control.setWidth(35); + control.setAlignY("middle"); + control.setToolTip(tooltip); + control.setFilter(/[0-9]/); + control.addListener("changeValue", this._onGotoPageChangeValue, this); + break; + + case "num-pages-field": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Total number of pages.")); + + control = new qx.ui.form.TextField(); + control.setFocusable(false); + control.setKeepFocus(true); + control.setTextAlign("right"); + control.setReadOnly(true); + control.setWidth(35); + control.setAlignY("middle"); + control.setToolTip(tooltip); + break; + + case "next-page-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Go to next page.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/go-next.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onNextPageButtonClick, this); + break; + + case "last-page-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Go to last page.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/go-last.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onLastPageButtonClick, this); + break; + } + + return control || this.base(arguments, id); + }, + + + /* + --------------------------------------------------------------------------- + EVENTS FOR VIEW PANEL BUTTONS + --------------------------------------------------------------------------- + */ + + /** + * Listens to the "execute" event to scroll to first page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onFirstPageButtonClick : function(e) + { + this.__pageContainer.gotoPage(1); + + this.checkEnable(); + }, + + /** + * Listens to the "execute" event to scroll to previous page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onPreviousPageButtonClick : function(e) + { + this.__pageContainer.gotoRelativePage(-1); + + this.checkEnable(); + }, + + _onGotoPageChangeValue : function(e) + { + var newFrame = e.getData(); + + if(newFrame.indexOf('+') == 0 || newFrame.indexOf('-') == 0) + { + this.__pageContainer.gotoRelativePage(newFrame, false); + } + else + { + this.__pageContainer.gotoPage(newFrame, false); + } + + this.checkEnable(); + }, + + /** + * Listens to the "execute" event to scroll to next page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onNextPageButtonClick : function(e) + { + this.__pageContainer.gotoRelativePage(1); + + this.checkEnable(); + }, + + /** + * Listens to the "execute" event to scroll to last page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onLastPageButtonClick : function(e) + { + var pageContainer = this.__pageContainer; + pageContainer.gotoPage(pageContainer.getNumPages()); + + this.checkEnable(); + }, + + + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + /** + * Check the enable state for the buttons. + */ + checkEnable : function() + { + var pageContainer = this.__pageContainer; + var currentPage = pageContainer.getCurrentPage(); + + if(currentPage == 1) + { + this.getChildControl("first-page-button").setEnabled(false); + this.getChildControl("previous-page-button").setEnabled(false); + } + else + { + this.getChildControl("first-page-button").setEnabled(true); + this.getChildControl("previous-page-button").setEnabled(true); + } + + if(currentPage == pageContainer.getNumPages()) + { + this.getChildControl("last-page-button").setEnabled(false); + this.getChildControl("next-page-button").setEnabled(false); + } + else + { + this.getChildControl("last-page-button").setEnabled(true); + this.getChildControl("next-page-button").setEnabled(true); + } + } + } +}); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-27 13:46:23
|
Revision: 21600 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21600&view=rev Author: sandersson Date: 2011-11-27 13:46:16 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/image.json trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/translation/readme.txt Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/Manifest.json 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe Page Control Demo", + + "summary" : "qooxdoo extension framework Demo", + "description" : "Extension of the standard qooxdoo framework demo.", + + "homepage" : "http://contrib.qooxdoo.org/project/qxe", + + "license" : "LGPL/EPL", + "authors" : + [ + { + "name" : "Stefan Andersson (sand)", + "email" : "ste...@li..." + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["1.6"] + }, + + "provides" : + { + "namespace" : "qxe.demo", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/config.json 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,69 @@ +{ + "name" : "qxe Page Control Demo", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + }, + { + "path" : "image.json" + } + ], + + "export" : + [ + "api", + "api-data", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "source-hybrid", + "simulation-build", + "simulation-run", + "test", + "test-source", + "translation", + "image-combine" + ], + + "default-job" : "source", + + "let" : + { + "APPLICATION" : "qxe.demo", + "QOOXDOO_PATH" : "../../../../qooxdoo/1.6", + "QXTHEME" : "qxe.demo.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"], + "LOCALES" : [ "en" ], + "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", + "ROOT" : "." + }, + + "config-warnings" : + { + "job-shadowing" : ["libraries"] + }, + + "jobs" : + { + "libraries" : + { + "library" : + [ + { + "manifest" : "../../Manifest.json" + } + ] + } + } +} Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/generate.py 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Thomas Herchenroeder (thron7) +# +################################################################################ + +## +# This is a stub proxy for the real generator.py +## + +import sys, os, re, subprocess + +CMD_PYTHON = sys.executable +QOOXDOO_PATH = '../../qooxdoo/1.6' + +def getQxPath(): + path = QOOXDOO_PATH + # try updating from config file + if os.path.exists('config.json'): + # "using QOOXDOO_PATH from config.json" + qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?') + conffile = open('config.json') + aconffile = conffile.readlines() + for line in aconffile: + mo = qpathr.search(line) + if mo: + path = mo.group(1) + break # assume first occurrence is ok + path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) + + return path + +os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir +qxpath = getQxPath() +REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') + +if not os.path.exists(REAL_GENERATOR): + print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR + sys.exit(1) + +argList = [] +argList.append(CMD_PYTHON) +argList.append(REAL_GENERATOR) +argList.extend(sys.argv[1:]) +if sys.platform == "win32": + argList1=[] + for arg in argList: + if arg.find(' ')>-1: + argList1.append('"%s"' % arg) + else: + argList1.append(arg) + argList = argList1 +else: + argList = ['"%s"' % x for x in argList] # quote argv elements + +cmd = " ".join(argList) +retval = subprocess.call(cmd, shell=True) +sys.exit(retval) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/image.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/image.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/image.json 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,56 @@ +{ + "jobs" : + { + + "image-combine" : + { + "desc" : "LED image combining", + + "let" : + { + "RESPATH" : "./source/resource" + }, + + "cache" : + { + "compile" : "${CACHE}" + }, + + "combine-images" : + { + "images" : + { + "${RESPATH}/qxe/demo/info/LED.jpg" : + { + "prefix": [ "${RESPATH}" ], + "input" : + [ + { + "prefix": [ "${RESPATH}" ], + "files" : + [ + "${RESPATH}/qxe/demo/info/blank.gif", + "${RESPATH}/qxe/demo/info/digit_0.gif", + "${RESPATH}/qxe/demo/info/digit_1.gif", + "${RESPATH}/qxe/demo/info/digit_2.gif", + "${RESPATH}/qxe/demo/info/digit_3.gif", + "${RESPATH}/qxe/demo/info/digit_4.gif", + "${RESPATH}/qxe/demo/info/digit_5.gif", + "${RESPATH}/qxe/demo/info/digit_6.gif", + "${RESPATH}/qxe/demo/info/digit_7.gif", + "${RESPATH}/qxe/demo/info/digit_8.gif", + "${RESPATH}/qxe/demo/info/digit_9.gif", + "${RESPATH}/qxe/demo/info/colon.gif", + "${RESPATH}/qxe/demo/info/am.gif", + "${RESPATH}/qxe/demo/info/pm.gif" + ] + } + ], + "layout" : "horizontal" + } + } + } + } + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/Application.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,76 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe Page Control indicator" + */ +qx.Class.define("qxe.demo.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Environment.get("qx.debug")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + + var pageControl = new qxe.ui.control.PageControl(); + + doc.add(pageControl, {left: 50, top: 50}); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,44 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define simulated interaction tests for your + * application. See the manual for details: + * {@link http://manual.qooxdoo.org/1.6/pages/development/simulator.html} + * + * @lint ignoreUndefined(simulator) + */ +qx.Class.define("qxe.demo.simulation.DemoSimulation", { + + extend : simulator.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** Check if a widget is present (part of the DOM) */ + testButtonPresent : function() + { + this.assertNotNull(this.getSimulation().getWidgetOrNull("qxh=qx.ui.form.Button"), "Button widget not present!"); + }, + + /** Click a button and check if an alert box pops up */ + testButtonClick : function() + { + this.getQxSelenium().qxClick("qxh=qx.ui.form.Button"); + this.assertEquals("true", String(this.getQxSelenium().isAlertPresent())); + } + } + +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/test/DemoTest.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("qxe.demo.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Appearance.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Appearance", +{ + extend : qxe.theme.modern.Appearance, + + appearances : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Color.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Color", +{ + extend : qxe.theme.modern.Color, + + colors : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Decoration.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Decoration", +{ + extend : qxe.theme.modern.Decoration, + + decorations : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Font.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Font", +{ + extend : qxe.theme.modern.Font, + + fonts : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/class/qxe/demo/theme/Theme.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Theme", +{ + meta : + { + color : qxe.demo.theme.Color, + decoration : qxe.demo.theme.Decoration, + font : qxe.demo.theme.Font, + icon : qx.theme.icon.Tango, + appearance : qxe.demo.theme.Appearance + } +}); \ No newline at end of file Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/index.html 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qxe</title> + <script type="text/javascript" src="script/qxe.demo.js"></script> +</head> +<body></body> +</html> Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/PageControl/source/translation/readme.txt 2011-11-27 13:46:16 UTC (rev 21600) @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-25 21:19:52 UTC (rev 21599) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -133,6 +133,14 @@ /* --------------------------------------------------------------------------- + PAGE CONTROL + --------------------------------------------------------------------------- + */ + + "page-control" : "widget", + + /* + --------------------------------------------------------------------------- PROGRESSBAR --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-25 21:19:52 UTC (rev 21599) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-27 13:46:16 UTC (rev 21600) @@ -138,6 +138,14 @@ /* --------------------------------------------------------------------------- + PAGE CONTROL + --------------------------------------------------------------------------- + */ + + "page-control" : "widget", + + /* + --------------------------------------------------------------------------- PROGRESSBAR --------------------------------------------------------------------------- */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-11-25 21:19:58
|
Revision: 21599 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21599&view=rev Author: cboulanger Date: 2011-11-25 21:19:52 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Applied patch from bug #5747 (zIndex bug) Modified Paths: -------------- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-11-25 21:12:41 UTC (rev 21598) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-11-25 21:19:52 UTC (rev 21599) @@ -230,7 +230,7 @@ /* * make sure the dialog is above any opened window */ - var maxWindowZIndex = 1E5; + var maxWindowZIndex = 0; var windows = root.getWindows(); for (var i = 0; i < windows.length; i++) { var zIndex = windows[i].getZIndex(); @@ -566,8 +566,10 @@ var root = this.getApplicationRoot(); root.setBlockerOpacity( this.getBlockerOpacity() ); root.setBlockerColor( this.getBlockerColor() ); - root.blockContent( this.getZIndex()-1 ); - } + var zIndex = this.getZIndex(); + this.setZIndex( zIndex + 1 ); + new qx.util.DeferredCall(function(){ root.blockContent( zIndex ) }).schedule(); + } this.setVisibility("visible"); this.__previousFocus = qx.ui.core.FocusHandler.getInstance().getActiveWidget(); this.focus(); @@ -649,4 +651,4 @@ dialog.select = dialog.Dialog.select; dialog.form = dialog.Dialog.form; } -}); \ No newline at end of file +}); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-11-25 21:12:48
|
Revision: 21598 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21598&view=rev Author: cboulanger Date: 2011-11-25 21:12:41 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Fixed bug #5515 (Give focus to "OK"-Button by default) Modified Paths: -------------- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-11-25 21:03:36 UTC (rev 21597) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-11-25 21:12:41 UTC (rev 21598) @@ -494,6 +494,9 @@ okButton.setIcon("icon/22/actions/dialog-ok.png") okButton.setAllowStretchX(false); okButton.addListener("execute", this._handleOk, this); + this.addListener("appear",function(){ + okButton.focus(); + },this); return okButton; }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-11-25 21:03:42
|
Revision: 21597 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21597&view=rev Author: cboulanger Date: 2011-11-25 21:03:36 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Removed resource initialization from dialog.Dialog.init() since it was not needed (images are determined by generator hints). Init method is deprecated and will be removed. Modified Paths: -------------- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-11-25 16:12:59 UTC (rev 21596) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-11-25 21:03:36 UTC (rev 21597) @@ -72,24 +72,10 @@ */ init : function() { - qx.core.Init.getApplication().warn("Initializing the Dialog package is no longer necessary. Please remove calls to 'dialog.Dialog.init()', which is now deprecated."); - var images = ["22/actions/dialog-cancel","22/actions/dialog-ok","48/status/dialog-information","48/status/dialog-error","48/status/dialog-warning"]; - var decoration = ["form/button","form/button-hovered","form/button-pressed","groupbox/groupbox","shadow/shadow-small","form/button-focused"]; - - for(var i=0;i<images.length;i++) - { - var p = qx.theme.manager.Icon.getInstance().getTheme().aliases.icon; - qx.io.ImageLoader.load("resource/" + p + "/" +images[i]+".png",null,this); - } - - for(var i=0;i<decoration.length;i++) - { - var p = qx.theme.manager.Decoration.getInstance().getTheme().aliases.decoration; - qx.io.ImageLoader.load("resource/" + p + "/" +decoration[i]+".png",null,this); - } - + qx.core.Init.getApplication().warn("Initializing the Dialog package is no longer necessary. Please remove calls to 'dialog.Dialog.init()', which is now deprecated."); }, + /** * Shortcut for alert dialog * @param message {String} The message to display @@ -658,6 +644,6 @@ dialog.confirm = dialog.Dialog.confirm; dialog.prompt = dialog.Dialog.prompt; dialog.select = dialog.Dialog.select; - dialog.form = dialog.Dialog.form; + dialog.form = dialog.Dialog.form; } }); \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-25 16:13:07
|
Revision: 21596 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21596&view=rev Author: sandersson Date: 2011-11-25 16:12:59 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ButtonPane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/MultiStateButton.js trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/ trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/ trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/off.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/on.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/ trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/am.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/blank.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/colon.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_0.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_1.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_2.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_3.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_4.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_5.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_6.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_7.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_8.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_9.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/pm.gif Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-25 15:30:07 UTC (rev 21595) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -68,12 +68,12 @@ var doc = this.getRoot(); // var analogClock = new qxe.ui.info.AnalogClock(); -// var binaryClock = new qxe.ui.info.BinaryClock(); + var binaryClock = new qxe.ui.info.BinaryClock(); var digitalClock = new qxe.ui.info.DigitalClock(); // doc.add(analogClock, {left: 50, top: 50}); -// doc.add(binaryClock, {left: 50, top: 150}); - doc.add(digitalClock, {left: 50, top: 200}); + doc.add(binaryClock, {left: 50, top: 150}); + doc.add(digitalClock, {left: 50, top: 300}); } } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-25 15:30:07 UTC (rev 21595) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -29,6 +29,14 @@ { /* --------------------------------------------------------------------------- + BINARY CLOCK + --------------------------------------------------------------------------- + */ + + "binary-clock" : "widget", + + /* + --------------------------------------------------------------------------- BUSY INDICATOR --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-25 15:30:07 UTC (rev 21595) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -34,6 +34,14 @@ { /* --------------------------------------------------------------------------- + BINARY CLOCK + --------------------------------------------------------------------------- + */ + + "binary-clock" : "widget", + + /* + --------------------------------------------------------------------------- BUSY INDICATOR --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-25 15:30:07 UTC (rev 21595) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -115,7 +115,7 @@ hours = (hours % 12); } - var padZeros = qx.util.format.StringFormat.padZeros; + var padZeros = qxe.util.format.StringFormat.padZeros; var time = padZeros(hours, 2) + ':' + padZeros(minutes, 2); Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ButtonPane.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ButtonPane.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -0,0 +1,654 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-cancel.png) +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-apply.png) +#asset(qx/icon/${qx.icontheme}/16/actions/help-about.png) + +************************************************************************ */ + +/** + * A button pane is a pane with a number of buttons. It can be a standardised + * button pane with preset combinations of buttons. It can also be totally customised. + * All buttons are kept together in a Widget container with preset spacing. + * + * A button pane has the following features: + * - horizontal and vertical orientation + * - create from json objects + * - predefined buttons like ok, cancel, help, yes and no + * - button spacing + * - buttons kept together + * - individual button access + * - button constrain for Windows and OS/X respectively and default none (original button order) + * - button size constraint + * - add spacer between buttons + */ +qx.Class.define("qxe.ui.mobile.form.ButtonPane", +{ + extend : qx.ui.core.Widget, + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + /** + * @param orientation {String} Orientation of the button pane + * @param spacing {Integer} The spacing between buttons of the button pane + */ + construct : function(orientation, spacing) + { + this.base(arguments); + + if(orientation != null) + { + this.setOrientation(orientation); + } + else + { + this.initOrientation(); + } + + if(spacing != null) + { + this.setSpacing(spacing); + } + }, + + + /* + ***************************************************************************** + STATICS + ***************************************************************************** + */ + + statics : + { + // Buttons + /** The OK button */ + OK : { + label : qx.locale.Manager.marktr("OK"), + icon : "icon/16/actions/dialog-ok.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Accept the dialog.") + }, + + /** The Cancel button */ + CANCEL : { + label : qx.locale.Manager.marktr("Cancel"), + icon : "icon/16/actions/dialog-cancel.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Cancel the dialog.") + }, + + /** The Help button */ + HELP : { + label : qx.locale.Manager.marktr("Help"), + icon : "icon/16/actions/help-about.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Get help about the dialog.") + }, + + /** The YES button */ + YES : { + label : qx.locale.Manager.marktr("Yes"), + icon : "icon/16/actions/dialog-ok.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Answer yes to the dialog.") + }, + + /** The NO button */ + NO : { + label : qx.locale.Manager.marktr("No"), + icon : "icon/16/actions/dialog-cancel.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Answer no to the dialog.") + }, + + /** + * Get an instance of a button pane by definition through json. + * + * The json structure looks like this: + * { + * orientation : <"horizontal" | "vertical">, + * spacing : <pixels>, + * buttons : { + * <button name> : { + * constraint : "affirmative", + * label : qx.locale.Manager.marktr("Submit"), + * icon : "icon/16/actions/dialog-ok.png", + * toolTip : null, + * toolTipIcon : "icon/16/actions/help-about.png", + * toolTipText : qx.locale.Manager.marktr("Submit the dialog."), + * userData : ["constraint", "affirmative"] // http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 + * }, + * <button name> : { + * ... + * }, + * ... + * } + * } + * + * Calls setOrientation(), setSpacing() and setButtons() functions. + * + * @param json {object} The new value. + * @return {qxe.ui.form.ButtonPane} The newly created button pane. + */ + getInstance : function(json) + { + var buttonPane = new qxe.ui.mobile.form.ButtonPane(); + buttonPane.set(json); + + return buttonPane; + } + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "button-pane" + }, + + /** + * The orientation. + */ + orientation : + { + check : [ "horizontal", "vertical" ], + init : "horizontal", + apply : "_applyOrientation" + }, + + /** + * The spacing between buttons. + */ + spacing : + { + check : "Integer", + init : 4, + apply : "_applySpacing" + }, + + /** + * The constraint of buttons positioning affirmative button to the right or left of the cancel button + * and the help button. + * + * true: + * windows -> buttons in following order from left to right: other > help > cancel > affirmative + * os/x -> buttons in following order from left to right: affirmative > cancel > help > other + * false: + * all -> in the order you define them + */ + constraint : + { + check : "Boolean", + init : false, + apply : "_applyConstraint" + }, + + /** + * The size constraint of buttons making them grow to same width (false) or optimized (true). + * + * qx.ui.layout.HBox has minimum width as default + * qx.ui.layout.VBox has maximum width as default. + * + * This has been change for the button pane to be minimum width as default. + * + * true -> minimum width + * false -> maximum width (flex:1) + */ + sizeConstraint : + { + check : "Boolean", + init : true, + apply : "_applySizeConstraint" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + __buttonOrder : [], + + /* + --------------------------------------------------------------------------- + APPLY ROUTINES + --------------------------------------------------------------------------- + */ + + /** + * Apply method for the orientation. + * + * @param value {boolean} The new value. + * @param old {boolean} The old value. + */ + _applyOrientation : function(value, old) + { + // Dispose old layout + var oldLayout = this._getLayout(); + + if (oldLayout) + { + oldLayout.dispose(); + } + + // Reconfigure + if (value === "horizontal") + { + var layout = new qx.ui.mobile.layout.HBox(this.getSpacing()); +//rtl layout.setReversed(qx.locale.Manager.getInstance().getDirection() == "right-to-left"); + this._setLayout(layout); + + this.setAllowStretchX(true); + this.setAllowStretchY(false); + } + else + { + this._setLayout(new qx.ui.mobile.layout.VBox(this.getSpacing())); + + this.setAllowStretchX(false); + this.setAllowStretchY(true); + } + }, + + /** + * Apply method for spacing between buttons. + * + * @param value {boolean} The new value. + * @param old {boolean} The old value. + */ + _applySpacing : function(value, old) + { + var layout = this._getLayout(); + value == null ? layout.resetSpacing() : layout.setSpacing(value); + }, + + /** + * Apply method for constraint. + * + * @param value {boolean} The new value. + * @param old {boolean} The old value. + */ + _applyConstraint : function(value, old) + { + if(value) + { + this._constrainButtons(); + } + else + { + this.removeAll(); + + var buttonOrder = this.__buttonOrder; + + // Restore initial button order + for(var i = 0, l = this._getChildren().length; i < l; i++) + { + this.add(buttonOrder[i]); + } + } + }, + + /** + * Apply method for size constraint. + * + * Horizontal layout has optimized lengths as default while vertical layout has same lengths as default. + * + * @param value {boolean} The new value. + * true -> optimized lengths + * false -> same lengths + * @param old {boolean} The old value. + */ + _applySizeConstraint : function(value, old) + { + if(value != old && this._getChildren()) + { + this.invalidateLayoutCache(); + } + }, + + /* + --------------------------------------------------------------------------- + CHILD HANDLING + --------------------------------------------------------------------------- + */ + + /** + * Add button to a button pane with specified constraint. + * The valid constraints are "affirmative", "cancel" and "help". + * + * The main purpose of the constraints is to determine how the buttons are + * laid out on different platforms according to the OS convention. For example, on + * Windows, affirmative button appears on the right hand side of cancel button. + * On Mac OS X, affirmative button will appear on the left hand side of cancel button. + * + * @param button {qx.ui.form.Button} The button to add. + * @param constraint {[ "affirmative" | "cancel" | "help" ]} The constraint used for the button. + */ + add : function(button, constraint) + { + if (qx.core.Environment.get("qx.debug")) + { + if (!(button instanceof qx.ui.mobile.form.Button)) + { + throw new Error("Incompatible child for ButtonPane: " + button); + } + } + + if(this.__buttonOrder.indexOf(button) != -1) + { + this.__buttonOrder.push(button); + } + + var index = this._getChildren().length; + + if(constraint != null) + { + var constraints = this._getConstraints(); + + if(constraint.match("affirmative|cancel|help") && !constraints[constraint]) + { + button.setUserData("constraint", constraint); + } + else + { + this.debug("Illegal or double constraint " + constraint + "."); + } + + if(this.getConstraint()) + { + index = this._constrainButton(button, constraint); + } + } + + this._addAt(button, index); + }, + + /** + * Remove a button from the button pane. + * + * @param button {qx.ui.form.Button} The button to be removed. + */ + remove : function(button) + { + var buttonOrder = this.__buttonOrder; + buttonOrder.splice(buttonOrder.indexOf(button), 1); + + this._remove(button); + }, + + /** + * Add a spacer to the button pane. The spacer has a flex + * value of one and will stretch to the available space. + * + * @return {qx.ui.core.Spacer} The newly added spacer object. A reference + * to the spacer is needed to remove this spacer from the layout. + */ + addSpacer : function() + { + var spacer = new qx.ui.core.Spacer; + this._add(spacer, {flex:1}); + + return spacer; + }, + + + /* + --------------------------------------------------------------------------- + LAYOUT INTERFACE + --------------------------------------------------------------------------- + */ + + // overridden + renderLayout : function(left, top, width, height) + { + this._sizeConstrainButtons(this.getSizeConstraint()); + + return this.base(arguments, left, top, width, height); + }, + + /* + --------------------------------------------------------------------------- + INTERNAL ROUTINES + --------------------------------------------------------------------------- + */ + + /** + * Set all buttons. + * + * @param json {Object} The json definition of button pane. + */ + setButtons : function(json) + { + var button; + + for(var key in json) + { + if(json[key]) + { + button = new qx.ui.mobile.form.Button(); + button.setUserData("name", key); + button.set(json[key]); + // The set() function does not take functions with >1 parameter + // Bug: http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 + this.add(button, json[key].userData ? json[key].userData[1] : null); + } + } + }, + + /** + * Get all constrained buttons. + * + * @return {Array#map} the constrained buttons. + */ + _getConstraints : function() + { + var constraint; + var constraints = []; + var children = this._getChildren(); + + for(var i = 0, l = children.length; i < l; i++) + { + constraint = children[i].getUserData("constraint"); + + if(!constraints[constraint]) + { + constraints[constraint] = children[i]; + } + } + + return constraints; + }, + + /** + * The main purpose of the constraints is to determine how the buttons are + * laid out on different platforms according to the OS convention. For example, on + * Windows, affirmative button appears on the right hand side of cancel button. + * On Mac OS X, affirmative button will appear on the left hand side of cancel button. + * + * @param button {qx.ui.form.Button} The button to constrain. + * @param constraint {[ "affirmative" | "cancel" | "help" | "other" ]} The constraint for the button. + */ + _constrainButton : function(button, constraint) + { + // First remove the button if it has been added + this.remove(button); + + var children = this._getChildren(); + var index = children.length; + + // Then add the button to the new position according to the standard of the OS + var win = (qx.core.Environment.get("os.name") == "win"); + + if(constraint == "affirmative") + { + this._addAt(button, win ? index : 0); + } + else + { + var constraints = this._getConstraints(); + var affirmative = constraints["affirmative"]; + + if(constraint == "cancel") + { + win ? this._addAfter(button, children[index - !!affirmative]) : this._addBefore(button, children[!!affirmative]); + } + else + { + var cancel = (constraints["cancel"] ? 1 : 0); + + if(constraint == "help") + { + win ? this._addAfter(button, children[index - !!affirmative - !!cancel]) : this._addBefore(button, children[!!affirmative + !!cancel]); + } + } + } + }, + + /** + * Re-constrain all buttons. + */ + _constrainButtons : function() + { + var children = this._getChildren(); + var l = children.length; + + for(var i = 0; i < l; i++) + { + this._constrainButton(children[i], children[i].getUserData("constraint")); + } + }, + + /** + * Resize the buttons according to sizeConstraint. + * + * @param value {boolean} True if size constrained. + */ + _sizeConstrainButtons : function(value) + { + var children = this._getChildren(); + var len = children.length; + + if(!value && len && this.getOrientation() == "horizontal") + { + var widest = 0; + var width; + + // Find the widest button + for(var i = 0; i < len; i++) + { + width = children[i].getSizeHint().width; + + widest = widest < width ? width : widest; + } + + // Set all button widths to widest + for(var i = 0; i < len; i++) + { + children[i].setWidth(widest); + } + } + else + { + if(value && len) + { + for(var i = 0, l = children.length; i < l; i++) + { + children[i].setAllowGrowX(!value); + children[i].setAllowShrinkX(value); + } + } + } + }, + + /* + --------------------------------------------------------------------------- + UTILITIES + --------------------------------------------------------------------------- + */ + + /** + * Gets the button with the index. + * + * @param index {Number} the button index. + * @return {qx.ui.form.Button} the button which has the name. null if there is no button with that name. + */ + getButton : function(index) + { + return this._getChildren()[index]; + }, + + /** + * Gets the button with the name. + * In order to use this method, you have to set a name to the button using {@link + * Widget#setUserData("name", String)} method. + * + * @param name {String} the button name. + * @return {qx.ui.form.Button} the button which has the name. null if there is no button with that name. + */ + getButtonByName : function(name) + { + var button = null; + var children = this._getChildren(); + + for(var i = 0, l = children.length; i < l; i++) + { + if(children[i].getUserData("name") == name) + { + button = children[i]; + break; + } + } + + return button; + } + }, + + /** + * Destruct function. + */ + destruct : function() + { + this._disposeArray("__buttonOrder"); + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/MultiStateButton.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/MultiStateButton.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/MultiStateButton.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -0,0 +1,342 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * A multi-state Button widget. + * + * If the user presses the button by clicking on it, pressing the enter or + * space key, the button toggles between the different states. Each state has its own + * atom definitions. + */ +qx.Class.define("qxe.ui.mobile.form.MultiStateButton", +{ + extend : qx.ui.mobile.form.Button, + implement : qx.ui.core.ISingleSelection, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + /** + * Creates a MultiStateButton. + * + * @param command {qx.ui.core.Command?null} Command instance to connect with + */ + construct : function(command) + { + this.base(arguments, null, null, command); + + this.__atoms = []; + this.__maxSize = { + height : 0, + width : 0 + }; + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties: + { + // overridden + appearance: + { + refine: true, + init: "multi-state-button" + }, + + /** + * Whether the size of the widget depends on the selected button state. When + * disabled (default) the size is configured to the largest child. + */ + dynamic : + { + check : "Boolean", + init : false, + apply : "_applyDynamic" + } + }, + + + /* + ***************************************************************************** + EVENTS + ***************************************************************************** + */ + + events : + { + /** Fires after the selection was modified */ + "changeSelection" : "qx.event.type.Data" + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + __selection : null, + __atoms : null, + __maxSize : null, + + + /** + * Calculates the biggest size; height and width, for non-dynamic size behaviour. + * + * @param atom {json} Button state json definition. + * @return {void} + */ + __calcSize : function(atom) + { + var button = new qx.ui.mobile.form.Button(); + button.set(atom); + + var sizeHint = button.getSizeHint(); + var maxSize = this.__maxSize; + + maxSize.height = (maxSize.height > sizeHint.height) ? maxSize.height : sizeHint.height; + maxSize.width = (maxSize.width > sizeHint.width) ? maxSize.width : sizeHint.width; + }, + + + /* + --------------------------------------------------------------------------- + PROPERTY APPLY + --------------------------------------------------------------------------- + */ + + // property apply + _applyDynamic : function(value, oldValue) + { + var children = this.__atoms; + var selected = this.__selection; + var child; + + if (!value && value != oldValue) { + for (var i=0, l=children.length; i<l; i++) + { + this.__calcSize(children[i]); + } + + var maxSize = this.__maxSize; + this.setHeight(maxSize.height); + this.setWidth(maxSize.width); + } + }, + + + /* + --------------------------------------------------------------------------- + EVENT LISTENERS + --------------------------------------------------------------------------- + */ + + /** + * Listener method for "mouseup" event + * <ul> + * <li>Removes "pressed" state (if set)</li> + * <li>Removes "abandoned" state (if set)</li> + * <li>Adds "hovered" state (if "abandoned" state is not set)</li> + *</ul> + * + * @param e {Event} Mouse event + * @return {void} + */ + _onMouseUp : function(e) + { + this.base(arguments, e); + + this.setSelection((this.getSelection() + 1) % this.__atoms.length); + }, + + /** + * Listener method for "keyup" event.<br/> + * Removes "abandoned" and "pressed" state (if "pressed" state is set) + * for the keys "Enter" or "Space" + * + * @param e {Event} Key event + * @return {void} + */ + _onKeyUp : function(e) + { + this.base(arguments, e); + + this.setSelection((this.getSelection() + 1) % this.__atoms.length); + }, + + /* + --------------------------------------------------------------------------- + BUTTON STATE HANDLING + --------------------------------------------------------------------------- + */ + + /** + * Adds a button state to the multistate button. + * + * @param label {String} The label which should be added. + * @param icon {String} The icon which should be added. + * @param toolTipText {String} The tooltip text which should be added. + */ + addButtonState : function(label, icon, toolTipText) + { + var atoms = this.__atoms; + var atom = { + label : label, + icon : icon, + toolTipText : toolTipText || null + }; + + atoms.push(atom); + + // Calculate size hint + // No better way to do it if not the states should be added as buttons. + // It would not be logical as it should be the same button + if(!this.isDynamic()) + { + this.__calcSize(atom); + + var maxSize = this.__maxSize; + this.setHeight(maxSize.height); + this.setWidth(maxSize.width); + } + + // Set selection + if(atoms.length == 1) + { + this.setSelection(0); + } + }, + + /** + * Removes a button state from the MultiStateButton. + * + * @param index {Integer} The button state index to be removed. + */ + removeButtonState : function(index) + { + var atoms = this.__atoms; + + // Try to select next button state + if (this.getSelection() == index) + { + if (index == 0) + { + if (atoms[1]) + { + this.setSelection(1); + } + else + { + this.resetSelection(); + } + } + else + { + this.setSelection(index - 1); + } + } + + atoms.slice(index, 1); + }, + + + /* + --------------------------------------------------------------------------- + SELECTION API + --------------------------------------------------------------------------- + */ + + /** + * Returns an array of currently selected items. + * + * Note: The result is only a set of selected items, so the order can + * differ from the sequence in which the items were added. + * + * @return {qx.ui.core.Widget[]} List of items. + */ + getSelection : function() + { + return this.__selection; + }, + + /** + * Replaces current selection with the given items. + * + * @param items {qx.ui.core.Widget[]} Items to select. + * @throws an exception if the item is not a child element. + */ + setSelection : function(items) + { + var oldSelection = this.getSelection(); + + this.__selection = items; + this.set(this.__atoms[items]); + + this.fireDataEvent("changeSelection", items, oldSelection); + }, + + /** + * Clears the whole selection at once. + */ + resetSelection : function() + { + this.setSelection(0); + }, + + /** + * Detects whether the given item is currently selected. + * + * @param item {qx.ui.core.Widget} Any valid selectable item + * @return {Boolean} Whether the item is selected. + * @throws an exception if the item is not a child element. + */ + isSelected : function(item) { + return item == this.__selection; + }, + + /** + * Whether the selection is empty. + * + * @return {Boolean} Whether the selection is empty. + */ + isSelectionEmpty : function() { + return false; + }, + + /** + * Returns all elements which are selectable. + * + * @param all {boolean} true for all selectables, false for the + * selectables the user can interactively select + * @return {qx.ui.core.Widget[]} The contained items. + */ + getSelectables: function(all) { + return this.__atoms; + } + } +}); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js 2011-11-25 15:30:07 UTC (rev 21595) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js 2011-11-25 16:12:59 UTC (rev 21596) @@ -18,7 +18,7 @@ /** * A formatter and parser for strings. */ -qx.Class.define("qx.util.format.StringFormat", +qx.Class.define("qxe.util.format.StringFormat", { extend : qx.core.Object, Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/off.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/off.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/on.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/binary/on.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/am.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/am.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/blank.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/blank.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/colon.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/colon.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_0.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_0.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_1.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_1.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_2.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_2.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_3.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_3.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_4.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_4.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_5.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_5.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_6.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_6.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_7.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_7.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_8.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_8.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_9.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/digit_9.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/pm.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/pm.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_w...@us...> - 2011-11-25 15:30:13
|
Revision: 21595 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21595&view=rev Author: d_wagner Date: 2011-11-25 15:30:07 +0000 (Fri, 25 Nov 2011) Log Message: ----------- use default cache dir Modified Paths: -------------- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/config.json Modified: trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/config.json =================================================================== --- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/config.json 2011-11-25 10:55:20 UTC (rev 21594) +++ trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/config.json 2011-11-25 15:30:07 UTC (rev 21595) @@ -41,7 +41,6 @@ "QXTHEME" : "contribdemobrowser.theme.Theme", "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"], "LOCALES" : [ "en" ], - "CACHE" : "${TMPDIR}/cache", "ROOT" : "." }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-25 10:55:30
|
Revision: 21594 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21594&view=rev Author: sandersson Date: 2011-11-25 10:55:20 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/image.json trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/am.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/blank.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/colon.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_0.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_1.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_2.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_3.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_4.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_5.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_6.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_7.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_8.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_9.gif trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/pm.gif trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json 2011-11-24 10:49:41 UTC (rev 21593) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json 2011-11-25 10:55:20 UTC (rev 21594) @@ -5,6 +5,9 @@ [ { "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + }, + { + "path" : "image.json" } ], @@ -29,7 +32,8 @@ "simulation-run", "test", "test-source", - "translation" + "translation", + "image-combine" ], "default-job" : "source", Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/image.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/image.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/image.json 2011-11-25 10:55:20 UTC (rev 21594) @@ -0,0 +1,56 @@ +{ + "jobs" : + { + + "image-combine" : + { + "desc" : "LED image combining", + + "let" : + { + "RESPATH" : "./source/resource" + }, + + "cache" : + { + "compile" : "${CACHE}" + }, + + "combine-images" : + { + "images" : + { + "${RESPATH}/qxe/demo/info/LED.jpg" : + { + "prefix": [ "${RESPATH}" ], + "input" : + [ + { + "prefix": [ "${RESPATH}" ], + "files" : + [ + "${RESPATH}/qxe/demo/info/blank.gif", + "${RESPATH}/qxe/demo/info/digit_0.gif", + "${RESPATH}/qxe/demo/info/digit_1.gif", + "${RESPATH}/qxe/demo/info/digit_2.gif", + "${RESPATH}/qxe/demo/info/digit_3.gif", + "${RESPATH}/qxe/demo/info/digit_4.gif", + "${RESPATH}/qxe/demo/info/digit_5.gif", + "${RESPATH}/qxe/demo/info/digit_6.gif", + "${RESPATH}/qxe/demo/info/digit_7.gif", + "${RESPATH}/qxe/demo/info/digit_8.gif", + "${RESPATH}/qxe/demo/info/digit_9.gif", + "${RESPATH}/qxe/demo/info/colon.gif", + "${RESPATH}/qxe/demo/info/am.gif", + "${RESPATH}/qxe/demo/info/pm.gif" + ] + } + ], + "layout" : "horizontal" + } + } + } + } + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/am.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/am.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/blank.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/blank.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/colon.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/colon.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_0.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_0.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_1.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_1.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_2.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_2.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_3.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_3.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_4.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_4.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_5.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_5.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_6.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_6.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_7.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_7.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_8.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_8.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_9.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/digit_9.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/pm.gif =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/pm.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js 2011-11-24 10:49:41 UTC (rev 21593) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js 2011-11-25 10:55:20 UTC (rev 21594) @@ -68,8 +68,7 @@ interval : { check : "Number", - init : 1000, - apply : "_applyInterval" + init : 1000 }, /* @@ -78,11 +77,21 @@ zoneOffset : { check : "Number", - init : -1, - apply : "_applyZoneOffset" + init : -1 }, /* + * The zone method: + * true : zone based on web browser setting + * false : zone based on ip address + */ + zoneMethod : + { + check : "Boolean", + init : false + }, + + /* * Central Daylight Time * CDT is 5 hours behind of Coordinated Universal Time (UTC) * @@ -133,24 +142,7 @@ /** Timer id */ __timerId : null, - /* - --------------------------------------------------------------------------- - APPLY ROUTINES - --------------------------------------------------------------------------- - */ - - // property modifier - _applyInterval : function(value, old) - { - }, - - // property modifier - _applyZoneOffset : function(value, old) - { - }, - - /* * This function shows the Internet Time which is a time scheme designed by Swatch, * which divides the 24 hour day into 1000 "beats", measured from midnight in Biel, * Switzerland. As the Internet Time is the same all over the world this script would @@ -170,21 +162,10 @@ var total = ((hour + min + sec + bmt) * (1000 / 1440)); var intTime = Math.floor(total); - if (intTime < 0) - { - intTime = intTime + 1000; - } + intTime = (intTime < 0) ? intTime + 1000 : intTime; + intTime = (intTime < 10) ? "00" + intTime : intTime; + intTime = (intTime < 100) ? "0" + intTime : intTime; - if (intTime < 10) - { - intTime = "00" + intTime; - } - - if (intTime < 100) - { - intTime = "0" + intTime; - } - return intTime; }, @@ -209,14 +190,9 @@ var seconds = date.getSeconds(); var offset = this.getZoneOffset(); - if (hours < offset) - { - hours = hours + 24 - offset; // If hours < 0 add 24 for correct time - } - else - { - hours = hours - offset; // Else just subtract it. - } + // If hours < 0 add 24 for correct time + // Else just subtract it. + hours = (hours < offset) ? hours + 24 - offset : hours - offset; this.display(hours, minutes, seconds); }, Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-24 10:49:41 UTC (rev 21593) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-25 10:55:20 UTC (rev 21594) @@ -109,20 +109,19 @@ if(this.getShowHours() == 12) { - am_pm = (hours > 11 ? " PM" : " AM"); - hours = (hours > 12 ? hours - 12 : hours); - hours = (hours == 0 ? 12 : hours); + am_pm = (hours > 11) ? " PM" : " AM"; + hours = (hours > 12) ? hours - 12 : hours; + hours = (hours == 0) ? 12 : hours; hours = (hours % 12); } - minutes = ("0" + minutes).slice(("" + minutes).length - 1); - seconds = ("0" + seconds).slice(("" + seconds).length - 1); + var padZeros = qx.util.format.StringFormat.padZeros; - var time = hours + ':' + minutes; + var time = padZeros(hours, 2) + ':' + padZeros(minutes, 2); if(this.getShowSeconds()) { - time += ':' + seconds; + time += ':' + padZeros(seconds, 2); } time += am_pm; Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/util/format/StringFormat.js 2011-11-25 10:55:20 UTC (rev 21594) @@ -0,0 +1,52 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * A formatter and parser for strings. + */ +qx.Class.define("qx.util.format.StringFormat", +{ + extend : qx.core.Object, + + + /* + ***************************************************************************** + STATICS + ***************************************************************************** + */ + + statics : + { + /** + * Fills a number with leading zeros ("25" -> "0025"). + * + * @param number {Integer} the number to fill. + * @param minSize {Integer} the minimum size the returned string should have. + * @return {String} the filled number as string. + */ + padZeros : function(number, minSize) + { + var str = "" + (number < 0 ? ((-1) * number) : number); + + while (str.length < minSize) { + str = "0" + str; + } + + return number < 0 ? "-" + str : str; + } + } +}); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-24 10:49:53
|
Revision: 21593 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21593&view=rev Author: sandersson Date: 2011-11-24 10:49:41 +0000 (Thu, 24 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/translation/readme.txt trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/Manifest.json 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe Clock Demo", + + "summary" : "qooxdoo extension framework Demo", + "description" : "Extension of the standard qooxdoo framework demo.", + + "homepage" : "http://contrib.qooxdoo.org/project/qxe", + + "license" : "LGPL/EPL", + "authors" : + [ + { + "name" : "Stefan Andersson (sand)", + "email" : "ste...@li..." + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["1.6"] + }, + + "provides" : + { + "namespace" : "qxe.demo", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/config.json 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,65 @@ +{ + "name" : "qxe Clock Demo", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + } + ], + + "export" : + [ + "api", + "api-data", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "source-hybrid", + "simulation-build", + "simulation-run", + "test", + "test-source", + "translation" + ], + + "default-job" : "source", + + "let" : + { + "APPLICATION" : "qxe.demo", + "QOOXDOO_PATH" : "../../../../qooxdoo/1.6", + "QXTHEME" : "qxe.demo.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"], + "LOCALES" : [ "en" ], + "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", + "ROOT" : "." + }, + + "config-warnings" : + { + "job-shadowing" : ["libraries"] + }, + + "jobs" : + { + "libraries" : + { + "library" : + [ + { + "manifest" : "../../Manifest.json" + } + ] + } + } +} Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/generate.py 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Thomas Herchenroeder (thron7) +# +################################################################################ + +## +# This is a stub proxy for the real generator.py +## + +import sys, os, re, subprocess + +CMD_PYTHON = sys.executable +QOOXDOO_PATH = '../../qooxdoo/1.6' + +def getQxPath(): + path = QOOXDOO_PATH + # try updating from config file + if os.path.exists('config.json'): + # "using QOOXDOO_PATH from config.json" + qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?') + conffile = open('config.json') + aconffile = conffile.readlines() + for line in aconffile: + mo = qpathr.search(line) + if mo: + path = mo.group(1) + break # assume first occurrence is ok + path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) + + return path + +os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir +qxpath = getQxPath() +REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') + +if not os.path.exists(REAL_GENERATOR): + print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR + sys.exit(1) + +argList = [] +argList.append(CMD_PYTHON) +argList.append(REAL_GENERATOR) +argList.extend(sys.argv[1:]) +if sys.platform == "win32": + argList1=[] + for arg in argList: + if arg.find(' ')>-1: + argList1.append('"%s"' % arg) + else: + argList1.append(arg) + argList = argList1 +else: + argList = ['"%s"' % x for x in argList] # quote argv elements + +cmd = " ".join(argList) +retval = subprocess.call(cmd, shell=True) +sys.exit(retval) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,80 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe Clock indicator" + */ +qx.Class.define("qxe.demo.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Environment.get("qx.debug")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + +// var analogClock = new qxe.ui.info.AnalogClock(); +// var binaryClock = new qxe.ui.info.BinaryClock(); + var digitalClock = new qxe.ui.info.DigitalClock(); + +// doc.add(analogClock, {left: 50, top: 50}); +// doc.add(binaryClock, {left: 50, top: 150}); + doc.add(digitalClock, {left: 50, top: 200}); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,44 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define simulated interaction tests for your + * application. See the manual for details: + * {@link http://manual.qooxdoo.org/1.6/pages/development/simulator.html} + * + * @lint ignoreUndefined(simulator) + */ +qx.Class.define("qxe.demo.simulation.DemoSimulation", { + + extend : simulator.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** Check if a widget is present (part of the DOM) */ + testButtonPresent : function() + { + this.assertNotNull(this.getSimulation().getWidgetOrNull("qxh=qx.ui.form.Button"), "Button widget not present!"); + }, + + /** Click a button and check if an alert box pops up */ + testButtonClick : function() + { + this.getQxSelenium().qxClick("qxh=qx.ui.form.Button"); + this.assertEquals("true", String(this.getQxSelenium().isAlertPresent())); + } + } + +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/test/DemoTest.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("qxe.demo.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Appearance.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Appearance", +{ + extend : qxe.theme.modern.Appearance, + + appearances : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Color.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Color", +{ + extend : qxe.theme.modern.Color, + + colors : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Decoration.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Decoration", +{ + extend : qxe.theme.modern.Decoration, + + decorations : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Font.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Font", +{ + extend : qxe.theme.modern.Font, + + fonts : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/theme/Theme.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Theme", +{ + meta : + { + color : qxe.demo.theme.Color, + decoration : qxe.demo.theme.Decoration, + font : qxe.demo.theme.Font, + icon : qx.theme.icon.Tango, + appearance : qxe.demo.theme.Appearance + } +}); \ No newline at end of file Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/index.html 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qxe</title> + <script type="text/javascript" src="script/qxe.demo.js"></script> +</head> +<body></body> +</html> Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/translation/readme.txt 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-23 14:46:12 UTC (rev 21592) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -69,16 +69,16 @@ // Document is the application root var doc = this.getRoot(); - var frame = this.createFrame(); +// var frame = this.createFrame(); // Button - var button = new qx.ui.form.Button("Click here!"); - button.addListener("execute", function() { +// var button = new qx.ui.form.Button("Click here!"); +// button.addListener("execute", function() { - }, this); +// }, this); - doc.add(button, {left: 50, top: 50}); +// doc.add(button, {left: 50, top: 50}); doc.add(this.createTable(), {left: 50, top: 50}); }, @@ -87,6 +87,7 @@ var statusBar = new qxe.ui.statusbar.StatusBar(); var frame = new qxe.ui.window.Frame("StatusBar Demo"); +// frame.addStatusBar(statusBar); return frame; }, @@ -122,7 +123,7 @@ // table var table = new qxe.ui.table.Table(tableModel); - table.setStatusBar(statusbar); + table.addStatusBar(statusbar); table.set({ width: 600, Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-23 14:46:12 UTC (rev 21592) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -54,6 +54,14 @@ /* --------------------------------------------------------------------------- + CLOCK + --------------------------------------------------------------------------- + */ + + "clock" : "widget", + + /* + --------------------------------------------------------------------------- DECORATED WINDOW --------------------------------------------------------------------------- */ @@ -74,6 +82,14 @@ /* --------------------------------------------------------------------------- + DIGITAL CLOCK + --------------------------------------------------------------------------- + */ + + "digital-clock" : "widget", + + /* + --------------------------------------------------------------------------- FRAME --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-23 14:46:12 UTC (rev 21592) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -59,6 +59,14 @@ /* --------------------------------------------------------------------------- + CLOCK + --------------------------------------------------------------------------- + */ + + "clock" : "widget", + + /* + --------------------------------------------------------------------------- DECORATED WINDOW --------------------------------------------------------------------------- */ @@ -79,6 +87,14 @@ /* --------------------------------------------------------------------------- + DIGITAL CLOCK + --------------------------------------------------------------------------- + */ + + "digital-clock" : "widget", + + /* + --------------------------------------------------------------------------- FRAME --------------------------------------------------------------------------- */ Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,251 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * An abstract class for all info clock classes. + */ +qx.Class.define("qxe.ui.info.Clock", +{ + extend : qx.ui.core.Widget, + type : "abstract", + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + var interval = this.getInterval(); + + var timer = this._timer = qx.util.TimerManager.getInstance(); + this._timerId = timer.start(this._onInterval, interval, this, null, interval); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "clock" + }, + + /* + --------------------------------------------------------------------------- + FEATURES + --------------------------------------------------------------------------- + */ + + /* + * The current value of the interval (this should be used internally only). + */ + interval : + { + check : "Number", + init : 1000, + apply : "_applyInterval" + }, + + /* + * The current zone. + */ + zoneOffset : + { + check : "Number", + init : -1, + apply : "_applyZoneOffset" + }, + + /* + * Central Daylight Time + * CDT is 5 hours behind of Coordinated Universal Time (UTC) + * + * Note that CDT is a daylight saving time/summer time zone. It is generally only used during + * the summer in the places listed below, during the winter CST is used instead + */ + CDT : + { + check : "Number", + init : 5 + }, + + /* + * Central Standard Time + * + * CST is 6 hours behind of Coordinated Universal Time (UTC) + * + * Note that most places observe daylight saving time/summer time during summer, + * and are therefore using CDT instead in the summer. + */ + CST : + { + check : "Number", + init : 6 + }, + + /* + * Show seconds. + */ + showSeconds : + { + check : "Boolean", + init : true + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** Timer instance */ + __timer : null, + /** Timer id */ + __timerId : null, + + + /* + --------------------------------------------------------------------------- + APPLY ROUTINES + --------------------------------------------------------------------------- + */ + + // property modifier + _applyInterval : function(value, old) + { + }, + + // property modifier + _applyZoneOffset : function(value, old) + { + }, + + /* + * This function shows the Internet Time which is a time scheme designed by Swatch, + * which divides the 24 hour day into 1000 "beats", measured from midnight in Biel, + * Switzerland. As the Internet Time is the same all over the world this script would + * be useful if you want to make an appointment. See www.swatch.com. + * + * @return {Number} The Internet time. + */ + internetTime : function() + { + var now = new Date(); + var hour = now.getHours() * 60; + var min = now.getMinutes(); + var sec = now.getSeconds() / 60; + // Biel MeanTime (BMT) is the universal reference for Internet Time. + var bmt = (now.getTimezoneOffset() + 60); + + var total = ((hour + min + sec + bmt) * (1000 / 1440)); + var intTime = Math.floor(total); + + if (intTime < 0) + { + intTime = intTime + 1000; + } + + if (intTime < 10) + { + intTime = "00" + intTime; + } + + if (intTime < 100) + { + intTime = "0" + intTime; + } + + return intTime; + }, + + + /* + --------------------------------------------------------------------------- + BASIC EVENT HANDLERS + --------------------------------------------------------------------------- + */ + + /** + * Called every clock interval. + * + * @param userData {json} The user data transferred + * @param timerId {Number} The timer id + */ + _onInterval : function(userData, timerId) + { + var date = new Date(); + var hours = date.getUTCHours(); + var minutes = date.getMinutes(); + var seconds = date.getSeconds(); + var offset = this.getZoneOffset(); + + if (hours < offset) + { + hours = hours + 24 - offset; // If hours < 0 add 24 for correct time + } + else + { + hours = hours - offset; // Else just subtract it. + } + + this.display(hours, minutes, seconds); + }, + + /** + * Display the clock. + */ + display : function(hours, minutes, seconds) + { + throw new Error("Abstract method call."); + } + }, + + + /* + ***************************************************************************** + DESTRUCTOR + ***************************************************************************** + */ + + destruct : function() + { + var timer = this.__timer; + + if (timer) + { + timer.stop(this.__timerId); + timer = null; + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -0,0 +1,134 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * A digital clock. + */ +qx.Class.define("qxe.ui.info.DigitalClock", +{ + extend : qxe.ui.info.Clock, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + // configure internal layout + this._setLayout(new qx.ui.layout.HBox()); + + this._createChildControl("pane"); + }, + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "digital-clock" + }, + + + /* + --------------------------------------------------------------------------- + FEATURES + --------------------------------------------------------------------------- + */ + + /* + * Show a 12 or 24 hour clock. + */ + showHours : + { + check : [12, 24], + init : 12 + } + }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + + // overridden + _createChildControlImpl : function(id, hash) + { + var control; + + switch(id) + { + case "pane": + control = new qx.ui.basic.Label(); + + this._add(control); + break; + } + + return control || this.base(arguments, id); + }, + + // overriden + display : function(hours, minutes, seconds) + { + var am_pm = ""; + + if(this.getShowHours() == 12) + { + am_pm = (hours > 11 ? " PM" : " AM"); + hours = (hours > 12 ? hours - 12 : hours); + hours = (hours == 0 ? 12 : hours); + hours = (hours % 12); + } + + minutes = ("0" + minutes).slice(("" + minutes).length - 1); + seconds = ("0" + seconds).slice(("" + seconds).length - 1); + + var time = hours + ':' + minutes; + + if(this.getShowSeconds()) + { + time += ':' + seconds; + } + + time += am_pm; + + this.getChildControl("pane").setValue(time); + } + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-11-23 14:46:12 UTC (rev 21592) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -68,13 +68,18 @@ } }, - member : + members : { + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + // overridden _createChildControlImpl : function(id) { var control; - var tooltip; switch(id) { Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js 2011-11-23 14:46:12 UTC (rev 21592) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -1936,7 +1936,7 @@ text = this.trn("one of one row", "%1 of %2 rows", rowCount, selectedRowCount, rowCount); } - this.getChildControl("statusbar").getChildControl("message").setValue(text); + this.getChildControl("statusbar").getChildControl("message-pane").setValue(text); } } }, Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-11-23 14:46:12 UTC (rev 21592) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-11-24 10:49:41 UTC (rev 21593) @@ -59,19 +59,15 @@ * @param icon {String} The URL of the caption bar icon * @param statusbar {qxe.ui.statusbar.StatusBar} The statusbar of the Frame */ - construct : function(caption, icon, statusbar) + construct : function(caption, icon) { this.base(arguments, caption, icon); // captionbar events this.getChildControl("captionbar").addListener("dblclick", this._onCaptionMouseDblClick, this); -// this._createChildControl("statusbar"); + this._createChildControl("statusbar"); - if (statusbar != null) { -// this.setStatusBar(statusbar); - } - // Update statusbar // this._updateStatusBar(); }, @@ -342,7 +338,7 @@ { // store the state if the status bar is shown var resizeFrame = this._getResizeFrame(); - +/* if (value) { this.addState("showStatusbar"); resizeFrame.addState("showStatusbar"); @@ -350,7 +346,7 @@ this.removeState("showStatusbar"); resizeFrame.removeState("showStatusbar"); } - +*/ var statusbar = this.getStatusBar(); if (statusbar) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-23 14:46:20
|
Revision: 21592 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21592&view=rev Author: sandersson Date: 2011-11-23 14:46:12 +0000 (Wed, 23 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Message.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Pane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -17,6 +17,8 @@ /* ************************************************************************ +#asset(qx/icon/${qx.icontheme}/16/apps/office-calendar.png) + #asset(qxe/demo/*) ************************************************************************ */ @@ -84,18 +86,60 @@ { var statusBar = new qxe.ui.statusbar.StatusBar(); - var frame = new qxe.ui.Window.Frame("StatusBar Demo"); + var frame = new qxe.ui.window.Frame("StatusBar Demo"); return frame; }, + nextId : 0, + + createRandomRows : function(rowCount) + { + var rowData = []; + var now = new Date().getTime(); + var dateRange = 400 * 24 * 60 * 60 * 1000; // 400 days + for (var row = 0; row < rowCount; row++) { + var date = new Date(now + Math.random() * dateRange - dateRange / 2); + rowData.push([ this.nextId++, Math.random() * 10000, date, (Math.random() > 0.5) ]); + } + return rowData; + }, + createTable : function() { var statusBar = new qxe.ui.statusbar.StatusBar(); - var table = new qxe.ui.table.Table(); + // Create the initial data + var rowData = this.createRandomRows(50); + + // table model + var tableModel = this._tableModel = new qx.ui.table.model.Simple(); + tableModel.setColumns([ "ID", "A number", "A date", "Boolean" ]); + tableModel.setData(rowData); + tableModel.setColumnEditable(1, true); + tableModel.setColumnEditable(2, true); + tableModel.setColumnSortable(3, false); + + // table + var table = new qxe.ui.table.Table(tableModel); table.setStatusBar(statusbar); + table.set({ + width: 600, + height: 400, + decorator : null + }); + + table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION); + + var tcm = table.getTableColumnModel(); + + // Display a checkbox in column 3 + tcm.setDataCellRenderer(3, new qx.ui.table.cellrenderer.Boolean()); + + // use a different header renderer + tcm.setHeaderCellRenderer(2, new qx.ui.table.headerrenderer.Icon("icon/16/apps/office-calendar.png", "A date")); + return table; } } Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json 2011-11-23 14:46:12 UTC (rev 21592) @@ -24,7 +24,6 @@ "profiling", "source", "source-all", - "source-each", "source-hybrid", "simulation-build", "simulation-run", Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -0,0 +1,52 @@ +/* **************************************************************************** + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +**************************************************************************** */ + +/* **************************************************************************** + +**************************************************************************** */ + +/** + * A status bar pane. + */ +qx.Interface.define("qxe.ui.statusbar.IPane", +{ + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + /** + * Sets the value of the statusbar. + * + * @param required {Object} An object value to set. + */ + setValue : function(obj) + { + return arguments.length == 1; + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Message.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Message.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Message.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -0,0 +1,104 @@ +/* **************************************************************************** + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +**************************************************************************** */ + +/* **************************************************************************** + +**************************************************************************** */ + +/** + * A status bar pane. + */ +qx.Class.define("qxe.ui.statusbar.Message", +{ + extend : qxe.ui.statusbar.Pane, + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + this._setLayout(new qx.ui.layout.Basic()); + + this._createChildControl("text"); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "statusbar-pane-message" + } + }, + + members : + { + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + + // overridden + _createChildControlImpl : function(id) + { + var control; + + switch(id) + { + case "text": + control = new qx.ui.basic.Label(); + + this._add(control); + break; + } + + return control || this.base(arguments, id); + }, + + + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + /** + * Set the value of the statusbar pane. + * + * @param value {object} The new value. + */ + setValue : function(value) + { + this.getChildControl("text").setValue(value); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Pane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Pane.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/Pane.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -0,0 +1,48 @@ +/* **************************************************************************** + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +**************************************************************************** */ + +/* **************************************************************************** + +**************************************************************************** */ + +/** + * A status bar pane. + */ +qx.Class.define("qxe.ui.statusbar.Pane", +{ + extend : qx.ui.core.Widget, + implement : qxe.ui.statusbar.IPane, + type : "abstract", + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "statusbar-pane" + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -0,0 +1,145 @@ +/* **************************************************************************** + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +**************************************************************************** */ + +/** + * A status bar showing different kind of information from different sources. + * + * The following features exist in the status bar: + * - adding different status bar plugins. + * - timeout or focus out removing of message (animation). + */ +qx.Class.define("qxe.ui.statusbar.StatusBar", +{ + extend : qx.ui.core.Widget, + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + this._setLayout(new qx.ui.layout.HBox()); + + this._createChildControl("message-pane"); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "statusbar" + }, + + /** + * The spacing between panes. + */ + spacing : + { + check : "Integer", + init : 4, + apply : "_applySpacing" + } + }, + + member : + { + // overridden + _createChildControlImpl : function(id) + { + var control; + var tooltip; + + switch(id) + { + case "message-pane": + control = new qxe.ui.statusbar.Message(); + + this._add(control); + break; + } + + return control || this.base(arguments, id); + }, + + /* + --------------------------------------------------------------------------- + CHILDREN HANDLING + --------------------------------------------------------------------------- + */ + + /** + * Add a pane to the statusbar. + * + * @param page {qxe.ui.statusbar.Pane} The pane which should be added. + */ + add : function(pane) + { + if (qx.core.Environment.get("qx.debug")) + { + if (!(pane instanceof qxe.ui.statusbar.Pane)) + { + throw new Error("Incompatible child for StatusBar: " + pane); + } + } + + this._add(pane); + }, + + /** + * Remove a pane from the statusbar. + * + * @param pane {qxe.ui.statusbar.Pane} The pane to be removed. + */ + remove : function(pane) + { + this._remove(pane); + }, + + + /* + --------------------------------------------------------------------------- + APPLY ROUTINES + --------------------------------------------------------------------------- + */ + + /** + * Apply method for spacing between buttons. + * + * @param value {boolean} The new value. + * @param old {boolean} The old value. + */ + _applySpacing : function(value, old) + { + var layout = this._getLayout(); + value == null ? layout.resetSpacing() : layout.setSpacing(value); + } + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -18,7 +18,10 @@ * Jonathan Weiß (jonathan_rass) * Stefan Andersson (sands) - - change of statusbar + - change of statusbar implementing qxe.ui.statusbar.StatusBar + - statusBarVisible changed to showStatusBar to use the same + nomenclature as in qx.ui.window.Window + - removed property additionalStatusBarText as it is part of the statusbar now ************************************************************************ */ @@ -207,7 +210,7 @@ this.__focusedCol = null; this.__focusedRow = null; - this.initStatusBarVisible(); + this.initShowStatusBar(); // If the table model has an init() method... tableModel = this.getTableModel(); @@ -432,23 +435,14 @@ /** Whether to show the status bar */ - statusBarVisible : + showStatusBar : { check : "Boolean", init : true, - apply : "_applyStatusBarVisible" + apply : "_applyShowStatusBar" }, - /** The Statusbartext, set it, if you want some more Information */ - additionalStatusBarText : - { - nullable : true, - init : null, - apply : "_applyAdditionalStatusBarText" - }, - - /** Whether to show the column visibility button */ columnVisibilityButtonVisible : { @@ -716,7 +710,6 @@ __selectionManager : null, - __additionalStatusBarText : null, __lastRowCount : null, __internalChange : null, @@ -913,7 +906,7 @@ // property modifier - _applyStatusBarVisible : function(value, old) + _applyShowStatusBar : function(value, old) { if (value) { this._showChildControl("statusbar"); @@ -928,14 +921,6 @@ // property modifier - _applyAdditionalStatusBarText : function(value, old) - { - this.__additionalStatusBarText = value; - this._updateStatusBar(); - }, - - - // property modifier _applyColumnVisibilityButtonVisible : function(value, old) { if (value) { @@ -1934,36 +1919,25 @@ */ _updateStatusBar : function() { - var tableModel = this.getTableModel(); - - if (this.getStatusBarVisible()) + if (this.getShowStatusBar()) { var selectedRowCount = this.getSelectionModel().getSelectedCount(); - var rowCount = tableModel.getRowCount(); + var rowCount = this.getTableModel().getRowCount(); - var text; - if (rowCount >= 0) { + var text; + if (selectedRowCount == 0) { text = this.trn("one row", "%1 rows", rowCount, rowCount); } else { + // More logical to use figures instead of text as plural is. +// text = this.trn("1 of 1 row", "%1 of %2 rows", rowCount, selectedRowCount, rowCount); text = this.trn("one of one row", "%1 of %2 rows", rowCount, selectedRowCount, rowCount); } - } - if (this.__additionalStatusBarText) - { - if (text) { - text += this.__additionalStatusBarText; - } else { - text = this.__additionalStatusBarText; - } + this.getChildControl("statusbar").getChildControl("message").setValue(text); } - - if (text) { - this.getChildControl("statusbar").setValue(text); - } } }, Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-11-23 10:40:30 UTC (rev 21591) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-11-23 14:46:12 UTC (rev 21592) @@ -198,6 +198,14 @@ --------------------------------------------------------------------------- */ + /** Should the statusbar be shown */ + showStatusbar : + { + check : "Boolean", + init : false, + apply : "_applyShowStatusbar" + }, + statusBar : { check : "qxe.ui.statusbar.StatusBar", @@ -332,6 +340,17 @@ _updateStatusBar : function() { + // store the state if the status bar is shown + var resizeFrame = this._getResizeFrame(); + + if (value) { + this.addState("showStatusbar"); + resizeFrame.addState("showStatusbar"); + } else { + this.removeState("showStatusbar"); + resizeFrame.removeState("showStatusbar"); + } + var statusbar = this.getStatusBar(); if (statusbar) { @@ -396,6 +415,27 @@ */ // property apply + _applyShowStatusbar : function(value, old) + { + // store the state if the status bar is shown + var resizeFrame = this._getResizeFrame(); + + if (value) { + this.addState("showStatusbar"); + resizeFrame.addState("showStatusbar"); + } else { + this.removeState("showStatusbar"); + resizeFrame.removeState("showStatusbar"); + } + + if (value) { + this._showChildControl("statusbar"); + } else { + this._excludeChildControl("statusbar"); + } + }, + + // property apply _applyStatusBarChange : function(value, old) { this._updateStatusBar(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-23 10:40:38
|
Revision: 21591 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21591&view=rev Author: sandersson Date: 2011-11-23 10:40:30 +0000 (Wed, 23 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/translation/readme.txt Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/Manifest.json 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe StatusBar Demo", + + "summary" : "qooxdoo extension framework Demo", + "description" : "Extension of the standard qooxdoo framework demo.", + + "homepage" : "http://contrib.qooxdoo.org/project/qxe", + + "license" : "LGPL/EPL", + "authors" : + [ + { + "name" : "Stefan Andersson (sand)", + "email" : "ste...@li..." + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["1.6"] + }, + + "provides" : + { + "namespace" : "qxe.demo", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/config.json 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,66 @@ +{ + "name" : "qxe StatusBar Demo", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + } + ], + + "export" : + [ + "api", + "api-data", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "source-each", + "source-hybrid", + "simulation-build", + "simulation-run", + "test", + "test-source", + "translation" + ], + + "default-job" : "source", + + "let" : + { + "APPLICATION" : "qxe.demo", + "QOOXDOO_PATH" : "../../../../qooxdoo/1.6", + "QXTHEME" : "qxe.demo.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"], + "LOCALES" : [ "en" ], + "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", + "ROOT" : "." + }, + + "config-warnings" : + { + "job-shadowing" : ["libraries"] + }, + + "jobs" : + { + "libraries" : + { + "library" : + [ + { + "manifest" : "../../Manifest.json" + } + ] + } + } +} Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/generate.py 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Thomas Herchenroeder (thron7) +# +################################################################################ + +## +# This is a stub proxy for the real generator.py +## + +import sys, os, re, subprocess + +CMD_PYTHON = sys.executable +QOOXDOO_PATH = '../../qooxdoo/1.6' + +def getQxPath(): + path = QOOXDOO_PATH + # try updating from config file + if os.path.exists('config.json'): + # "using QOOXDOO_PATH from config.json" + qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?') + conffile = open('config.json') + aconffile = conffile.readlines() + for line in aconffile: + mo = qpathr.search(line) + if mo: + path = mo.group(1) + break # assume first occurrence is ok + path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) + + return path + +os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir +qxpath = getQxPath() +REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') + +if not os.path.exists(REAL_GENERATOR): + print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR + sys.exit(1) + +argList = [] +argList.append(CMD_PYTHON) +argList.append(REAL_GENERATOR) +argList.extend(sys.argv[1:]) +if sys.platform == "win32": + argList1=[] + for arg in argList: + if arg.find(' ')>-1: + argList1.append('"%s"' % arg) + else: + argList1.append(arg) + argList = argList1 +else: + argList = ['"%s"' % x for x in argList] # quote argv elements + +cmd = " ".join(argList) +retval = subprocess.call(cmd, shell=True) +sys.exit(retval) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,103 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe StatusBar" + */ +qx.Class.define("qxe.demo.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Environment.get("qx.debug")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + + var frame = this.createFrame(); + + + // Button + var button = new qx.ui.form.Button("Click here!"); + button.addListener("execute", function() { + + }, this); + + doc.add(button, {left: 50, top: 50}); + doc.add(this.createTable(), {left: 50, top: 50}); + }, + + createFrame : function() + { + var statusBar = new qxe.ui.statusbar.StatusBar(); + + var frame = new qxe.ui.Window.Frame("StatusBar Demo"); + + return frame; + }, + + createTable : function() + { + var statusBar = new qxe.ui.statusbar.StatusBar(); + + var table = new qxe.ui.table.Table(); + table.setStatusBar(statusbar); + + return table; + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,44 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define simulated interaction tests for your + * application. See the manual for details: + * {@link http://manual.qooxdoo.org/1.6/pages/development/simulator.html} + * + * @lint ignoreUndefined(simulator) + */ +qx.Class.define("qxe.demo.simulation.DemoSimulation", { + + extend : simulator.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** Check if a widget is present (part of the DOM) */ + testButtonPresent : function() + { + this.assertNotNull(this.getSimulation().getWidgetOrNull("qxh=qx.ui.form.Button"), "Button widget not present!"); + }, + + /** Click a button and check if an alert box pops up */ + testButtonClick : function() + { + this.getQxSelenium().qxClick("qxh=qx.ui.form.Button"); + this.assertEquals("true", String(this.getQxSelenium().isAlertPresent())); + } + } + +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/test/DemoTest.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("qxe.demo.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Appearance.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Appearance", +{ + extend : qxe.theme.modern.Appearance, + + appearances : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Color.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Color", +{ + extend : qxe.theme.modern.Color, + + colors : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Decoration.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Decoration", +{ + extend : qxe.theme.modern.Decoration, + + decorations : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Font.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Font", +{ + extend : qxe.theme.modern.Font, + + fonts : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/theme/Theme.js 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Theme", +{ + meta : + { + color : qxe.demo.theme.Color, + decoration : qxe.demo.theme.Decoration, + font : qxe.demo.theme.Font, + icon : qx.theme.icon.Tango, + appearance : qxe.demo.theme.Appearance + } +}); \ No newline at end of file Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/index.html 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qxe</title> + <script type="text/javascript" src="script/qxe.demo.js"></script> +</head> +<body></body> +</html> Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/translation/readme.txt 2011-11-23 10:40:30 UTC (rev 21591) @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-23 10:11:04
|
Revision: 21590 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21590&view=rev Author: sandersson Date: 2011-11-23 10:10:58 +0000 (Wed, 23 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-high.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-low.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-medium.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-muted.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/help-browser.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/login.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/text.png Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-high.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-high.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-low.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-low.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-medium.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-medium.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-muted.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/audio-volume-muted.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/help-browser.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/help-browser.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/login.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/login.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/text.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/text.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-23 10:08:58
|
Revision: 21589 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21589&view=rev Author: sandersson Date: 2011-11-23 10:08:50 +0000 (Wed, 23 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/MultiStateButton.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/MultiStateButton.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/MultiStateButton.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/MultiStateButton.js 2011-11-23 10:08:50 UTC (rev 21589) @@ -0,0 +1,342 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * A multi-state Button widget. + * + * If the user presses the button by clicking on it, pressing the enter or + * space key, the button toggles between the different states. Each state has its own + * atom definitions. + */ +qx.Class.define("qxe.ui.form.MultiStateButton", +{ + extend : qx.ui.form.Button, + implement : qx.ui.core.ISingleSelection, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + /** + * Creates a MultiStateButton. + * + * @param command {qx.ui.core.Command?null} Command instance to connect with + */ + construct : function(command) + { + this.base(arguments, null, null, command); + + this.__atoms = []; + this.__maxSize = { + height : 0, + width : 0 + }; + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties: + { + // overridden + appearance: + { + refine: true, + init: "multi-state-button" + }, + + /** + * Whether the size of the widget depends on the selected button state. When + * disabled (default) the size is configured to the largest child. + */ + dynamic : + { + check : "Boolean", + init : false, + apply : "_applyDynamic" + } + }, + + + /* + ***************************************************************************** + EVENTS + ***************************************************************************** + */ + + events : + { + /** Fires after the selection was modified */ + "changeSelection" : "qx.event.type.Data" + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + __selection : null, + __atoms : null, + __maxSize : null, + + + /** + * Calculates the biggest size; height and width, for non-dynamic size behaviour. + * + * @param atom {json} Button state json definition. + * @return {void} + */ + __calcSize : function(atom) + { + var button = new qx.ui.form.Button(); + button.set(atom); + + var sizeHint = button.getSizeHint(); + var maxSize = this.__maxSize; + + maxSize.height = (maxSize.height > sizeHint.height) ? maxSize.height : sizeHint.height; + maxSize.width = (maxSize.width > sizeHint.width) ? maxSize.width : sizeHint.width; + }, + + + /* + --------------------------------------------------------------------------- + PROPERTY APPLY + --------------------------------------------------------------------------- + */ + + // property apply + _applyDynamic : function(value, oldValue) + { + var children = this.__atoms; + var selected = this.__selection; + var child; + + if (!value && value != oldValue) { + for (var i=0, l=children.length; i<l; i++) + { + this.__calcSize(children[i]); + } + + var maxSize = this.__maxSize; + this.setHeight(maxSize.height); + this.setWidth(maxSize.width); + } + }, + + + /* + --------------------------------------------------------------------------- + EVENT LISTENERS + --------------------------------------------------------------------------- + */ + + /** + * Listener method for "mouseup" event + * <ul> + * <li>Removes "pressed" state (if set)</li> + * <li>Removes "abandoned" state (if set)</li> + * <li>Adds "hovered" state (if "abandoned" state is not set)</li> + *</ul> + * + * @param e {Event} Mouse event + * @return {void} + */ + _onMouseUp : function(e) + { + this.base(arguments, e); + + this.setSelection((this.getSelection() + 1) % this.__atoms.length); + }, + + /** + * Listener method for "keyup" event.<br/> + * Removes "abandoned" and "pressed" state (if "pressed" state is set) + * for the keys "Enter" or "Space" + * + * @param e {Event} Key event + * @return {void} + */ + _onKeyUp : function(e) + { + this.base(arguments, e); + + this.setSelection((this.getSelection() + 1) % this.__atoms.length); + }, + + /* + --------------------------------------------------------------------------- + BUTTON STATE HANDLING + --------------------------------------------------------------------------- + */ + + /** + * Adds a button state to the multistate button. + * + * @param label {String} The label which should be added. + * @param icon {String} The icon which should be added. + * @param toolTipText {String} The tooltip text which should be added. + */ + addButtonState : function(label, icon, toolTipText) + { + var atoms = this.__atoms; + var atom = { + label : label, + icon : icon, + toolTipText : toolTipText || null + }; + + atoms.push(atom); + + // Calculate size hint + // No better way to do it if not the states should be added as buttons. + // It would not be logical as it should be the same button + if(!this.isDynamic()) + { + this.__calcSize(atom); + + var maxSize = this.__maxSize; + this.setHeight(maxSize.height); + this.setWidth(maxSize.width); + } + + // Set selection + if(atoms.length == 1) + { + this.setSelection(0); + } + }, + + /** + * Removes a button state from the MultiStateButton. + * + * @param index {Integer} The button state index to be removed. + */ + removeButtonState : function(index) + { + var atoms = this.__atoms; + + // Try to select next button state + if (this.getSelection() == index) + { + if (index == 0) + { + if (atoms[1]) + { + this.setSelection(1); + } + else + { + this.resetSelection(); + } + } + else + { + this.setSelection(index - 1); + } + } + + atoms.slice(index, 1); + }, + + + /* + --------------------------------------------------------------------------- + SELECTION API + --------------------------------------------------------------------------- + */ + + /** + * Returns an array of currently selected items. + * + * Note: The result is only a set of selected items, so the order can + * differ from the sequence in which the items were added. + * + * @return {qx.ui.core.Widget[]} List of items. + */ + getSelection : function() + { + return this.__selection; + }, + + /** + * Replaces current selection with the given items. + * + * @param items {qx.ui.core.Widget[]} Items to select. + * @throws an exception if the item is not a child element. + */ + setSelection : function(items) + { + var oldSelection = this.getSelection(); + + this.__selection = items; + this.set(this.__atoms[items]); + + this.fireDataEvent("changeSelection", items, oldSelection); + }, + + /** + * Clears the whole selection at once. + */ + resetSelection : function() + { + this.setSelection(0); + }, + + /** + * Detects whether the given item is currently selected. + * + * @param item {qx.ui.core.Widget} Any valid selectable item + * @return {Boolean} Whether the item is selected. + * @throws an exception if the item is not a child element. + */ + isSelected : function(item) { + return item == this.__selection; + }, + + /** + * Whether the selection is empty. + * + * @return {Boolean} Whether the selection is empty. + */ + isSelectionEmpty : function() { + return false; + }, + + /** + * Returns all elements which are selectable. + * + * @param all {boolean} true for all selectables, false for the + * selectables the user can interactively select + * @return {qx.ui.core.Widget[]} The contained items. + */ + getSelectables: function(all) { + return this.__atoms; + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js 2011-11-23 10:08:50 UTC (rev 21589) @@ -0,0 +1,2255 @@ +/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2006 STZ-IDA, Germany, http://www.stz-ida.de + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Til Schneider (til132) + * Fabian Jakobs (fjakobs) + * Jonathan Weiß (jonathan_rass) + + * Stefan Andersson (sands) + - change of statusbar + +************************************************************************ */ + +/** + * Table + * + * A detailed description can be found in the package description + * {@link qx.ui.table}. + * + * @childControl statusbar {qx.ui.basic.Label} label to show the status of the table + * @childControl column-button {qx.ui.table.columnmenu.Button} button to open the column menu + */ +qx.Class.define("qxe.ui.table.Table", +{ + extend : qx.ui.core.Widget, + + + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + /** + * @param tableModel {qx.ui.table.ITableModel ? null} + * The table model to read the data from. + * + * @param custom {Map ? null} + * A map provided to override the various supplemental classes allocated + * within this constructor. Each property must be a function which + * returns an object instance, as indicated by shown the defaults listed + * here: + * + * <dl> + * <dt>initiallyHiddenColumns</dt> + * <dd> + * {Array?} + * A list of column numbers that should be initially invisible. Any + * column not mentioned will be initially visible, and if no array + * is provided, all columns will be initially visible. + * </dd> + * <dt>selectionManager</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.selection.Manager(obj); + * } + * </pre></dd> + * <dt>selectionModel</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.selection.Model(obj); + * } + * </pre></dd> + * <dt>tableColumnModel</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.columnmodel.Basic(obj); + * } + * </pre></dd> + * <dt>tablePaneModel</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.pane.Model(obj); + * } + * </pre></dd> + * <dt>tablePane</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.pane.Pane(obj); + * } + * </pre></dd> + * <dt>tablePaneHeader</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.pane.Header(obj); + * } + * </pre></dd> + * <dt>tablePaneScroller</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.pane.Scroller(obj); + * } + * </pre></dd> + * <dt>tablePaneModel</dt> + * <dd><pre class='javascript'> + * function(obj) + * { + * return new qx.ui.table.pane.Model(obj); + * } + * </pre></dd> + * <dt>columnMenu</dt> + * <dd><pre class='javascript'> + * function() + * { + * return new qx.ui.table.columnmenu.Button(); + * } + * </pre></dd> + * </dl> + */ + construct : function(tableModel, custom) + { + this.base(arguments); + // + // Use default objects if custom objects are not specified + // + if (!custom) { + custom = { }; + } + + if (custom.initiallyHiddenColumns) { + this.setInitiallyHiddenColumns(custom.initiallyHiddenColumns); + } + + if (custom.selectionManager) { + this.setNewSelectionManager(custom.selectionManager); + } + + if (custom.selectionModel) { + this.setNewSelectionModel(custom.selectionModel); + } + + if (custom.tableColumnModel) { + this.setNewTableColumnModel(custom.tableColumnModel); + } + + if (custom.tablePane) { + this.setNewTablePane(custom.tablePane); + } + + if (custom.tablePaneHeader) { + this.setNewTablePaneHeader(custom.tablePaneHeader); + } + + if (custom.tablePaneScroller) { + this.setNewTablePaneScroller(custom.tablePaneScroller); + } + + if (custom.tablePaneModel) { + this.setNewTablePaneModel(custom.tablePaneModel); + } + + if (custom.columnMenu) { + this.setNewColumnMenu(custom.columnMenu); + } + + this._setLayout(new qx.ui.layout.VBox()); + + // Create the child widgets + this.__scrollerParent = new qx.ui.container.Composite(new qx.ui.layout.HBox()); + this._add(this.__scrollerParent, {flex: 1}); + + // Allocate a default data row renderer + this.setDataRowRenderer(new qx.ui.table.rowrenderer.Default(this)); + + // Create the models + this.__selectionManager = this.getNewSelectionManager()(this); + this.setSelectionModel(this.getNewSelectionModel()(this)); + this.setTableModel(tableModel || this.getEmptyTableModel()); + + // create the main meta column + this.setMetaColumnCounts([ -1 ]); + + // Make focusable + this.setTabIndex(1); + this.addListener("keypress", this._onKeyPress); + this.addListener("focus", this._onFocusChanged); + this.addListener("blur", this._onFocusChanged); + + // attach the resize listener to the last child of the layout. This + // ensures that all other children are laid out before + var spacer = new qx.ui.core.Widget().set({ + height: 0 + }); + this._add(spacer); + spacer.addListener("resize", this._onResize, this); + + this.__focusedCol = null; + this.__focusedRow = null; + + this.initStatusBarVisible(); + + // If the table model has an init() method... + tableModel = this.getTableModel(); + if (tableModel.init && typeof(tableModel.init) == "function") + { + // ... then call it now to allow the table model to affect table + // properties. + tableModel.init(this); + } + }, + + + + + /* + ***************************************************************************** + EVENTS + ***************************************************************************** + */ + + events : + { + /** + * Dispatched before adding the column list to the column visibility menu. + * The event data is a map with two properties: table and menu. Listeners + * may add additional items to the menu, which appear at the top of the + * menu. + */ + "columnVisibilityMenuCreateStart" : "qx.event.type.Data", + + /** + * Dispatched after adding the column list to the column visibility menu. + * The event data is a map with two properties: table and menu. Listeners + * may add additional items to the menu, which appear at the bottom of the + * menu. + */ + "columnVisibilityMenuCreateEnd" : "qx.event.type.Data", + + /** + * Dispatched when the width of the table has changed. + */ + "tableWidthChanged" : "qx.event.type.Event", + + /** + * Dispatched when updating scrollbars discovers that a vertical scrollbar + * is needed when it previously was not, or vice versa. The data is a + * boolean indicating whether a vertical scrollbar is now being used. + */ + "verticalScrollBarChanged" : "qx.event.type.Data", + + /** + * Dispatched when a data cell has been clicked. + */ + "cellClick" : "qx.ui.table.pane.CellEvent", + + /** + * Dispatched when a data cell has been clicked. + */ + "cellDblclick" : "qx.ui.table.pane.CellEvent", + + /** + * Dispatched when the context menu is needed in a data cell + */ + "cellContextmenu" : "qx.ui.table.pane.CellEvent", + + /** + * Dispatched after a cell editor is flushed. + * + * The data is a map containing this properties: + * <ul> + * <li>row</li> + * <li>col</li> + * <li>value</li> + * <li>oldValue</li> + * </ul> + */ + "dataEdited" : "qx.event.type.Data" + }, + + + + /* + ***************************************************************************** + STATICS + ***************************************************************************** + */ + + statics : + { + /** Events that must be redirected to the scrollers. */ + __redirectEvents : { cellClick: 1, cellDblclick: 1, cellContextmenu: 1 } + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + appearance : + { + refine : true, + init : "table" + }, + + + focusable : + { + refine : true, + init : true + }, + + + minWidth : + { + refine : true, + init : 50 + }, + + /** + * The list of columns that are initially hidden. This property is set by + * the constructor, from the value received in + * custom.initiallyHiddenColumns, and is only used when a column model is + * initialized. It can be of great benefit in tables with numerous columns + * where most are not initially visible. The process of creating the + * headers for all of the columns, only to have those columns discarded + * shortly thereafter when setColumnVisibility(false) is called, is a + * waste of (significant, in some browsers) time. Specifying the + * non-visible columns at constructor time can therefore avoid the initial + * creation of all of those superfluous widgets. + */ + initiallyHiddenColumns : + { + init : null + }, + + /** + * Whether the widget contains content which may be selected by the user. + * + * If the value set to <code>true</code> the native browser selection can + * be used for text selection. But it is normally useful for + * forms fields, longer texts/documents, editors, etc. + * + * Note: This has no effect on Table! + */ + selectable : + { + refine : true, + init : false + }, + + + /** The selection model. */ + selectionModel : + { + check : "qx.ui.table.selection.Model", + apply : "_applySelectionModel", + event : "changeSelectionModel" + }, + + + /** The table model. */ + tableModel : + { + check : "qx.ui.table.ITableModel", + apply : "_applyTableModel", + event : "changeTableModel" + }, + + + /** The height of the table rows. */ + rowHeight : + { + check : "Number", + init : 20, + apply : "_applyRowHeight", + event : "changeRowHeight", + themeable : true + }, + + + /** + * Force line height to match row height. May be disabled if cell + * renderers being used wish to render multiple lines of data within a + * cell. (With the default setting, all but the first of multiple lines + * of data will not be visible.) + */ + forceLineHeight : + { + check : "Boolean", + init : true + }, + + + /** + * Whether the header cells are visible. When setting this to false, + * you'll likely also want to set the {#columnVisibilityButtonVisible} + * property to false as well, to entirely remove the header row. + */ + headerCellsVisible : + { + check : "Boolean", + init : true, + apply : "_applyHeaderCellsVisible", + themeable : true + }, + + + /** The height of the header cells. */ + headerCellHeight : + { + check : "Integer", + init : 16, + apply : "_applyHeaderCellHeight", + event : "changeHeaderCellHeight", + nullable : true, + themeable : true + }, + + + /** Whether to show the status bar */ + statusBarVisible : + { + check : "Boolean", + init : true, + apply : "_applyStatusBarVisible" + }, + + + /** The Statusbartext, set it, if you want some more Information */ + additionalStatusBarText : + { + nullable : true, + init : null, + apply : "_applyAdditionalStatusBarText" + }, + + + /** Whether to show the column visibility button */ + columnVisibilityButtonVisible : + { + check : "Boolean", + init : true, + apply : "_applyColumnVisibilityButtonVisible", + themeable : true + }, + + + /** + * {Integer[]} The number of columns per meta column. If the last array entry is -1, + * this meta column will get the remaining columns. + */ + metaColumnCounts : + { + check : "Object", + apply : "_applyMetaColumnCounts" + }, + + + /** + * Whether the focus should moved when the mouse is moved over a cell. If false + * the focus is only moved on mouse clicks. + */ + focusCellOnMouseMove : + { + check : "Boolean", + init : false, + apply : "_applyFocusCellOnMouseMove" + }, + + /** + * Whether row focus change by keyboard also modifies selection + */ + rowFocusChangeModifiesSelection : + { + check : "Boolean", + init : true + }, + + /** + * Whether the cell focus indicator should be shown + */ + showCellFocusIndicator : + { + check : "Boolean", + init : true, + apply : "_applyShowCellFocusIndicator" + }, + + /** + * By default, the "cellContextmenu" event is fired only when a data cell + * is right-clicked. It is not fired when a right-click occurs in the + * empty area of the table below the last data row. By turning on this + * property, "cellContextMenu" events will also be generated when a + * right-click occurs in that empty area. In such a case, row identifier + * in the event data will be null, so event handlers can check (row === + * null) to handle this case. + */ + contextMenuFromDataCellsOnly : + { + check : "Boolean", + init : true, + apply : "_applyContextMenuFromDataCellsOnly" + }, + + /** + * Whether the table should keep the first visible row complete. If set to false, + * the first row may be rendered partial, depending on the vertical scroll value. + */ + keepFirstVisibleRowComplete : + { + check : "Boolean", + init : true, + apply : "_applyKeepFirstVisibleRowComplete" + }, + + + /** + * Whether the table cells should be updated when only the selection or the + * focus changed. This slows down the table update but allows to react on a + * changed selection or a changed focus in a cell renderer. + */ + alwaysUpdateCells : + { + check : "Boolean", + init : false + }, + + + /** + * Whether to reset the selection when a header cell is clicked. Since + * most data models do not have provisions to retain a selection after + * sorting, the default is to reset the selection in this case. Some data + * models, however, do have the capability to retain the selection, so + * when using those, this property should be set to false. + */ + resetSelectionOnHeaderClick : + { + check : "Boolean", + init : true, + apply : "_applyResetSelectionOnHeaderClick" + }, + + + /** The renderer to use for styling the rows. */ + dataRowRenderer : + { + check : "qx.ui.table.IRowRenderer", + init : null, + nullable : true, + event : "changeDataRowRenderer" + }, + + + /** + * A function to call when before modal cell editor is opened. + * + * @signature function(cellEditor, cellInfo) + * + * @param cellEditor {qx.ui.window.Window} + * The modal window which has been created for this cell editor + * + * @param cellInfo {Map} + * Information about the cell for which this cell editor was created. + * It contains the following properties: + * col, row, xPos, value + * + * @return {void} + */ + modalCellEditorPreOpenFunction : + { + check : "Function", + init : null, + nullable : true + }, + + + /** + * A function to instantiate a new column menu button. + */ + newColumnMenu : + { + check : "Function", + init : function() { + return new qx.ui.table.columnmenu.Button(); + } + }, + + + /** + * A function to instantiate a selection manager. this allows subclasses of + * Table to subclass this internal class. To take effect, this property must + * be set before calling the Table constructor. + */ + newSelectionManager : + { + check : "Function", + init : function(obj) { + return new qx.ui.table.selection.Manager(obj); + } + }, + + + /** + * A function to instantiate a selection model. this allows subclasses of + * Table to subclass this internal class. To take effect, this property must + * be set before calling the Table constructor. + */ + newSelectionModel : + { + check : "Function", + init : function(obj) { + return new qx.ui.table.selection.Model(obj); + } + }, + + + /** + * A function to instantiate a table column model. This allows subclasses + * of Table to subclass this internal class. To take effect, this + * property must be set before calling the Table constructor. + */ + newTableColumnModel : + { + check : "Function", + init : function(table) { + return new qx.ui.table.columnmodel.Basic(table); + } + }, + + + /** + * A function to instantiate a table pane. this allows subclasses of + * Table to subclass this internal class. To take effect, this property + * must be set before calling the Table constructor. + */ + newTablePane : + { + check : "Function", + init : function(obj) { + return new qx.ui.table.pane.Pane(obj); + } + }, + + + /** + * A function to instantiate a table pane. this allows subclasses of + * Table to subclass this internal class. To take effect, this property + * must be set before calling the Table constructor. + */ + newTablePaneHeader : + { + check : "Function", + init : function(obj) { + return new qx.ui.table.pane.Header(obj); + } + }, + + + /** + * A function to instantiate a table pane scroller. this allows + * subclasses of Table to subclass this internal class. To take effect, + * this property must be set before calling the Table constructor. + */ + newTablePaneScroller : + { + check : "Function", + init : function(obj) { + return new qx.ui.table.pane.Scroller(obj); + } + }, + + + /** + * A function to instantiate a table pane model. this allows subclasses + * of Table to subclass this internal class. To take effect, this + * property must be set before calling the Table constructor. + */ + newTablePaneModel : + { + check : "Function", + init : function(columnModel) { + return new qx.ui.table.pane.Model(columnModel); + } + } + }, + + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + __focusedCol : null, + __focusedRow : null, + + __scrollerParent : null, + + __selectionManager : null, + + __additionalStatusBarText : null, + __lastRowCount : null, + __internalChange : null, + + __columnMenuButtons : null, + __columnModel : null, + __emptyTableModel : null, + + __hadVerticalScrollBar : null, + + __timer : null, + + + // overridden + _createChildControlImpl : function(id, hash) + { + var control; + + switch(id) + { + case "statusbar": + control = new qxe.ui.statusbar.StatusBar(); + control.setAllowGrowX(true); + this._add(control); + break; + + case "column-button": + control = this.getNewColumnMenu()(); + control.set({ + focusable : false + }); + + // Create the initial menu too + var menu = control.factory("menu", { table : this }); + + // Add a listener to initialize the column menu when it becomes visible + menu.addListener( + "appear", + this._initColumnMenu, + this + ); + + break; + } + + return control || this.base(arguments, id); + }, + + + + // property modifier + _applySelectionModel : function(value, old) + { + this.__selectionManager.setSelectionModel(value); + + if (old != null) { + old.removeListener("changeSelection", this._onSelectionChanged, this); + } + + value.addListener("changeSelection", this._onSelectionChanged, this); + }, + + + // property modifier + _applyRowHeight : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].updateVerScrollBarMaximum(); + } + }, + + + // property modifier + _applyHeaderCellsVisible : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) + { + scrollerArr[i]._excludeChildControl("header"); + } + }, + + + // property modifier + _applyHeaderCellHeight : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].getHeader().setHeight(value); + } + }, + + + /** + * Get an empty table model instance to use for this table. Use this table + * to configure the table with no table model. + * + * @return {qx.ui.table.ITableModel} The empty table model + */ + getEmptyTableModel : function() + { + if (!this.__emptyTableModel) + { + this.__emptyTableModel = new qx.ui.table.model.Simple(); + this.__emptyTableModel.setColumns([]); + this.__emptyTableModel.setData([]); + } + return this.__emptyTableModel; + }, + + + // property modifier + _applyTableModel : function(value, old) + { + this.getTableColumnModel().init(value.getColumnCount(), this); + + if (old != null) + { + old.removeListener( + "metaDataChanged", + this._onTableModelMetaDataChanged, this + ); + + old.removeListener( + "dataChanged", + this._onTableModelDataChanged, + this); + } + + value.addListener( + "metaDataChanged", + this._onTableModelMetaDataChanged, this + ); + + value.addListener( + "dataChanged", + this._onTableModelDataChanged, + this); + + // Update the status bar + this._updateStatusBar(); + + this._updateTableData( + 0, value.getRowCount(), + 0, value.getColumnCount() + ); + this._onTableModelMetaDataChanged(); + + // If the table model has an init() method, call it. We don't, however, + // call it if this is the initial setting of the table model, as the + // scrollers are not yet initialized. In that case, the init method is + // called explicitly by the Table constructor. + if (old && value.init && typeof(value.init) == "function") + { + value.init(this); + } + }, + + + /** + * Get the The table column model. + * + * @return {qx.ui.table.columnmodel.Basic} The table's column model + */ + getTableColumnModel : function() + { + if (!this.__columnModel) + { + var columnModel = this.__columnModel = this.getNewTableColumnModel()(this); + + columnModel.addListener("visibilityChanged", this._onColVisibilityChanged, this); + columnModel.addListener("widthChanged", this._onColWidthChanged, this); + columnModel.addListener("orderChanged", this._onColOrderChanged, this); + + // Get the current table model + var tableModel = this.getTableModel(); + columnModel.init(tableModel.getColumnCount(), this); + + // Reset the table column model in each table pane model + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) + { + var paneScroller = scrollerArr[i]; + var paneModel = paneScroller.getTablePaneModel(); + paneModel.setTableColumnModel(columnModel); + } + } + return this.__columnModel; + }, + + + // property modifier + _applyStatusBarVisible : function(value, old) + { + if (value) { + this._showChildControl("statusbar"); + } else { + this._excludeChildControl("statusbar"); + } + + if (value) { + this._updateStatusBar(); + } + }, + + + // property modifier + _applyAdditionalStatusBarText : function(value, old) + { + this.__additionalStatusBarText = value; + this._updateStatusBar(); + }, + + + // property modifier + _applyColumnVisibilityButtonVisible : function(value, old) + { + if (value) { + this._showChildControl("column-button"); + } else { + this._excludeChildControl("column-button"); + } + }, + + + // property modifier + _applyMetaColumnCounts : function(value, old) + { + var metaColumnCounts = value; + var scrollerArr = this._getPaneScrollerArr(); + var handlers = { }; + + if (value > old) + { + // Save event listeners on the redirected events so we can re-apply + // them to new scrollers. + var manager = qx.event.Registration.getManager(scrollerArr[0]); + for (var evName in qxe.ui.table.Table.__redirectEvents) + { + handlers[evName] = { }; + handlers[evName].capture = manager.getListeners(scrollerArr[0], + evName, + true); + handlers[evName].bubble = manager.getListeners(scrollerArr[0], + evName, + false); + } + } + + // Remove the panes not needed any more + this._cleanUpMetaColumns(metaColumnCounts.length); + + // Update the old panes + var leftX = 0; + + for (var i=0; i<scrollerArr.length; i++) + { + var paneScroller = scrollerArr[i]; + var paneModel = paneScroller.getTablePaneModel(); + paneModel.setFirstColumnX(leftX); + paneModel.setMaxColumnCount(metaColumnCounts[i]); + leftX += metaColumnCounts[i]; + } + + // Add the new panes + if (metaColumnCounts.length > scrollerArr.length) + { + var columnModel = this.getTableColumnModel(); + + for (var i=scrollerArr.length; i<metaColumnCounts.length; i++) + { + var paneModel = this.getNewTablePaneModel()(columnModel); + paneModel.setFirstColumnX(leftX); + paneModel.setMaxColumnCount(metaColumnCounts[i]); + leftX += metaColumnCounts[i]; + + var paneScroller = this.getNewTablePaneScroller()(this); + paneScroller.setTablePaneModel(paneModel); + + // Register event listener for vertical scrolling + paneScroller.addListener("changeScrollY", this._onScrollY, this); + + // Apply redirected events to this new scroller + for (evName in qxe.ui.table.Table.__redirectEvents) + { + // On first setting of meta columns (constructing phase), there + // are no handlers to deal with yet. + if (! handlers[evName]) + { + break; + } + + if (handlers[evName].capture && + handlers[evName].capture.length > 0) + { + var capture = handlers[evName].capture; + for (var j = 0; j < capture.length; j++) + { + // Determine what context to use. If the context does not + // exist, we assume that the context is this table. If it + // does exist and it equals the first pane scroller (from + // which we retrieved the listeners) then set the context + // to be this new pane scroller. Otherwise leave the context + // as it was set. + var context = capture[j].context; + if (! context) + { + context = this; + } + else if (context == scrollerArr[0]) + { + context = paneScroller; + } + + paneScroller.addListener( + evName, + capture[j].handler, + context, + true); + } + } + + if (handlers[evName].bubble && + handlers[evName].bubble.length > 0) + { + var bubble = handlers[evName].bubble; + for (var j = 0; j < bubble.length; j++) + { + // Determine what context to use. If the context does not + // exist, we assume that the context is this table. If it + // does exist and it equals the first pane scroller (from + // which we retrieved the listeners) then set the context + // to be this new pane scroller. Otherwise leave the context + // as it was set. + var context = bubble[j].context; + if (! context) + { + context = this; + } + else if (context == scrollerArr[0]) + { + context = paneScroller; + } + + paneScroller.addListener( + evName, + bubble[j].handler, + context, + false); + } + } + } + + // last meta column is flexible + var flex = (i == metaColumnCounts.length - 1) ? 1 : 0; + this.__scrollerParent.add(paneScroller, {flex: flex}); + scrollerArr = this._getPaneScrollerArr(); + } + } + + // Update all meta columns + for (var i=0; i<scrollerArr.length; i++) + { + var paneScroller = scrollerArr[i]; + var isLast = (i == (scrollerArr.length - 1)); + + // Set the right header height + paneScroller.getHeader().setHeight(this.getHeaderCellHeight()); + + // Put the column visibility button in the top right corner of the last meta column + paneScroller.setTopRightWidget(isLast ? this.getChildControl("column-button") : null); + } + + if (!this.isColumnVisibilityButtonVisible()) { + this._excludeChildControl("column-button"); + } + + this._updateScrollerWidths(); + this._updateScrollBarVisibility(); + }, + + + // property modifier + _applyFocusCellOnMouseMove : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].setFocusCellOnMouseMove(value); + } + }, + + + // property modifier + _applyShowCellFocusIndicator : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].setShowCellFocusIndicator(value); + } + }, + + + // property modifier + _applyContextMenuFromDataCellsOnly : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].setContextMenuFromDataCellsOnly(value); + } + }, + + + // property modifier + _applyKeepFirstVisibleRowComplete : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].onKeepFirstVisibleRowCompleteChanged(); + } + }, + + + // property modifier + _applyResetSelectionOnHeaderClick : function(value, old) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].setResetSelectionOnHeaderClick(value); + } + }, + + + /** + * Returns the selection manager. + * + * @return {qx.ui.table.selection.Manager} the selection manager. + */ + getSelectionManager : function() { + return this.__selectionManager; + }, + + + /** + * Returns an array containing all TablePaneScrollers in this table. + * + * @return {qx.ui.table.pane.Scroller[]} all TablePaneScrollers in this table. + */ + _getPaneScrollerArr : function() { + return this.__scrollerParent.getChildren(); + }, + + + /** + * Returns a TablePaneScroller of this table. + * + * @param metaColumn {Integer} the meta column to get the TablePaneScroller for. + * @return {qx.ui.table.pane.Scroller} the qx.ui.table.pane.Scroller. + */ + getPaneScroller : function(metaColumn) { + return this._getPaneScrollerArr()[metaColumn]; + }, + + + /** + * Cleans up the meta columns. + * + * @param fromMetaColumn {Integer} the first meta column to clean up. All following + * meta columns will be cleaned up, too. All previous meta columns will + * stay unchanged. If 0 all meta columns will be cleaned up. + * @return {void} + */ + _cleanUpMetaColumns : function(fromMetaColumn) + { + var scrollerArr = this._getPaneScrollerArr(); + + if (scrollerArr != null) + { + for (var i=scrollerArr.length-1; i>=fromMetaColumn; i--) + { + scrollerArr[i].destroy(); + } + } + }, + + + /** + * Event handler. Called when the locale has changed. + * + * @param evt {Event} the event. + * @return {void} + */ + _onChangeLocale : function(evt) + { + this.base(arguments); + + this.updateContent(); + this._updateStatusBar(); + }, + + + /** + * Event handler. Called when the selection has changed. + * + * @param evt {Map} the event. + * @return {void} + */ + _onSelectionChanged : function(evt) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].onSelectionChanged(); + } + + this._updateStatusBar(); + }, + + + /** + * Event handler. Called when the table model meta data has changed. + * + * @param evt {Map} the event. + * @return {void} + */ + _onTableModelMetaDataChanged : function(evt) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].onTableModelMetaDataChanged(); + } + + this._updateStatusBar(); + }, + + + /** + * Event handler. Called when the table model data has changed. + * + * @param evt {Map} the event. + * @return {void} + */ + _onTableModelDataChanged : function(evt) + { + var data = evt.getData(); + + this._updateTableData( + data.firstRow, data.lastRow, + data.firstColumn, data.lastColumn, + data.removeStart, data.removeCount + ); + }, + + /** + * To update the table if the table model has changed and remove selection. + * + * @param firstRow {Integer} The index of the first row that has changed. + * @param lastRow {Integer} The index of the last row that has changed. + * @param firstColumn {Integer} The model index of the first column that has changed. + * @param lastColumn {Integer} The model index of the last column that has changed. + * @param removeStart {Integer ? null} The first index of the interval (including), to remove selection. + * @param removeCount {Integer ? null} The count of the interval, to remove selection. + * @return {void} + */ + _updateTableData : function(firstRow, lastRow, firstColumn, lastColumn, removeStart, removeCount) + { + var scrollerArr = this._getPaneScrollerArr(); + + // update selection if rows were removed + if (removeCount) { + this.getSelectionModel().removeSelectionInterval(removeStart, removeStart + removeCount); + // remove focus if the focused row has been removed + if (this.__focusedRow >= removeStart && this.__focusedRow < (removeStart + removeCount)) { + this.setFocusedCell(); + } + } + + for (var i=0; i<scrollerArr.length; i++) + { + scrollerArr[i].onTableModelDataChanged( + firstRow, lastRow, + firstColumn, lastColumn + ); + } + + var rowCount = this.getTableModel().getRowCount(); + + if (rowCount != this.__lastRowCount) + { + this.__lastRowCount = rowCount; + + this._updateScrollBarVisibility(); + this._updateStatusBar(); + } + }, + + + /** + * Event handler. Called when a TablePaneScroller has been scrolled vertically. + * + * @param evt {Map} the event. + * @return {void} + */ + _onScrollY : function(evt) + { + if (!this.__internalChange) + { + this.__internalChange = true; + + // Set the same scroll position to all meta columns + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].setScrollY(evt.getData()); + } + + this.__internalChange = false; + } + }, + + + /** + * Event handler. Called when a key was pressed. + * + * @param evt {qx.event.type.KeySequence} the event. + * @return {void} + */ + _onKeyPress : function(evt) + { + if (!this.getEnabled()) { + return; + } + + // No editing mode + var oldFocusedRow = this.__focusedRow; + var consumed = true; + + // Handle keys that are independent from the modifiers + var identifier = evt.getKeyIdentifier(); + + if (this.isEditing()) + { + // Editing mode + if (evt.getModifiers() == 0) + { + switch(identifier) + { + case "Enter": + this.stopEditing(); + var oldFocusedRow = this.__focusedRow; + this.moveFocusedCell(0, 1); + + if (this.__focusedRow != oldFocusedRow) { + consumed = this.startEditing(); + } + + break; + + case "Escape": + this.cancelEditing(); + this.focus(); + break; + + default: + consumed = false; + break; + } + } + + } + else + { + // No editing mode + if (evt.isCtrlPressed()) + { + // Handle keys that depend on modifiers + consumed = true; + + switch(identifier) + { + case "A": // Ctrl + A + var rowCount = this.getTableModel().getRowCount(); + + if (rowCount > 0) { + this.getSelectionModel().setSelectionInterval(0, rowCount - 1); + } + + break; + + default: + consumed = false; + break; + } + } + else + { + // Handle keys that are independent from the modifiers + switch(identifier) + { + case "Space": + this.__selectionManager.handleSelectKeyDown(this.__focusedRow, evt); + break; + + case "F2": + case "Enter": + this.startEditing(); + consumed = true; + break; + + case "Home": + this.setFocusedCell(this.__focusedCol, 0, true); + break; + + case "End": + var rowCount = this.getTableModel().getRowCount(); + this.setFocusedCell(this.__focusedCol, rowCount - 1, true); + break; + + case "Left": + this.moveFocusedCell(-1, 0); + break; + + case "Right": + this.moveFocusedCell(1, 0); + break; + + case "Up": + this.moveFocusedCell(0, -1); + break; + + case "Down": + this.moveFocusedCell(0, 1); + break; + + case "PageUp": + case "PageDown": + var scroller = this.getPaneScroller(0); + var pane = scroller.getTablePane(); + var rowHeight = this.getRowHeight(); + var direction = (identifier == "PageUp") ? -1 : 1; + rowCount = pane.getVisibleRowCount() - 1; + scroller.setScrollY(scroller.getScrollY() + direction * rowCount * rowHeight); + this.moveFocusedCell(0, direction * rowCount); + break; + + default: + consumed = false; + } + } + } + + if (oldFocusedRow != this.__focusedRow && + this.getRowFocusChangeModifiesSelection()) + { + // The focus moved -> Let the selection manager handle this event + this.__selectionManager.handleMoveKeyDown(this.__focusedRow, evt); + } + + if (consumed) + { + evt.preventDefault(); + evt.stopPropagation(); + } + }, + + + /** + * Event handler. Called when the table gets the focus. + * + * @param evt {Map} the event. + * @return {void} + */ + _onFocusChanged : function(evt) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].onFocusChanged(); + } + }, + + + /** + * Event handler. Called when the visibility of a column has changed. + * + * @param evt {Map} the event. + * @return {void} + */ + _onColVisibilityChanged : function(evt) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].onColVisibilityChanged(); + } + + var data = evt.getData(); + if (this.__columnMenuButtons != null && data.col != null && + data.visible != null) { + this.__columnMenuButtons[data.col].setVisible(data.visible); + } + + this._updateScrollerWidths(); + this._updateScrollBarVisibility(); + }, + + + /** + * Event handler. Called when the width of a column has changed. + * + * @param evt {Map} the event. + * @return {void} + */ + _onColWidthChanged : function(evt) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) + { + var data = evt.getData(); + scrollerArr[i].setColumnWidth(data.col, data.newWidth); + } + + this._updateScrollerWidths(); + this._updateScrollBarVisibility(); + }, + + + /** + * Event handler. Called when the column order has changed. + * + * @param evt {Map} the event. + * @return {void} + */ + _onColOrderChanged : function(evt) + { + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].onColOrderChanged(); + } + + // A column may have been moved between meta columns + this._updateScrollerWidths(); + this._updateScrollBarVisibility(); + }, + + + /** + * Gets the TablePaneScroller at a certain x position in the page. If there is + * no TablePaneScroller at this position, null is returned. + * + * @param pageX {Integer} the position in the page to check (in pixels). + * @return {qx.ui.table.pane.Scroller} the TablePaneScroller or null. + */ + getTablePaneScrollerAtPageX : function(pageX) + { + var metaCol = this._getMetaColumnAtPageX(pageX); + return (metaCol != -1) ? this.getPaneScroller(metaCol) : null; + }, + + + /** + * Sets the currently focused cell. A value of <code>null</code> hides the + * focus cell. + * + * @param col {Integer?null} the model index of the focused cell's column. + * @param row {Integer?null} the model index of the focused cell's row. + * @param scrollVisible {Boolean ? false} whether to scroll the new focused cell + * visible. + * @return {void} + */ + setFocusedCell : function(col, row, scrollVisible) + { + if (!this.isEditing() && (col != this.__focusedCol || row != this.__focusedRow)) + { + if (col === null) { + col = 0; + } + + this.__focusedCol = col; + this.__focusedRow = row; + + var scrollerArr = this._getPaneScrollerArr(); + + for (var i=0; i<scrollerArr.length; i++) { + scrollerArr[i].setFocusedCell(col, row); + } + + if (col !== null && scrollVisible) { + this.scrollCellVisible(col, row); + } + } + }, + + + /** + * Resets (clears) the current selection + */ + resetSelection : function() { + this.getSelectionModel().resetSelection(); + }, + + + /** + * Resets the focused cell. + */ + resetCellFocus : function() { + this.setFocusedCell(null, null, false); + }, + + + /** + * Returns the column of the currently focused cell. + * + * @return {Integer} the model index of the focused cell's column. + */ + getFocusedColumn : function() { + return this.__focusedCol; + }, + + + /** + * Returns the row of the currently focused cell. + * + * @return {Integer} the model index of the focused cell's column. + */ + getFocusedRow : function() { + return this.__focusedRow; + }, + + + /** + * Select whether the focused row is highlighted + * + * @param bHighlight {Boolean} + * Flag indicating whether the focused row should be highlighted. + * + * @return {void} + */ + highlightFocusedRow : function(bHighlight) + { + this.getDataRowRenderer().setHighlightFocusRow(bHighlight); + }, + + + /** + * Remove the highlighting of the current focus row. + * + * This is used to temporarily remove the highlighting of the currently + * focused row, and is expected to be used most typically by adding a + * listener on the "mouseout" event, so that the focus highlighting is + * suspended when the mouse leaves the table: + * + * table.addListener("mouseout", table.clearFocusedRowHighlight); + * + * @param evt {qx.event.type.Mouse} Incoming mouse event + * @return {void} + */ + clearFocusedRowHighlight : function(evt) + { + if(evt) + { + var relatedTarget = evt.getRelatedTarget(); + if ( + relatedTarget instanceof qx.ui.table.pane.Pane || + relatedTarget instanceof qx.ui.table.pane.FocusIndicator + ) { + return ; + } + } + + // Remove focus from any cell that has it + this.resetCellFocus(); + + // Now, for each pane scroller... + var scrollerArr = this._getPaneScrollerArr(); + for (var i=0; i<scrollerArr.length; i++) + { + // ... repaint without focus. + scrollerArr[i].onFocusChanged(); + } + }, + + + /** + * Moves the focus. + * + * @param deltaX {Integer} The delta by which the focus should be moved on the x axis. + * @param deltaY {Integer} The delta by which the focus should be moved on the y axis. + * @return {void} + */ + moveFocusedCell : function(deltaX, deltaY) + { + var col = this.__focusedCol; + var row = this.__focusedRow; + + // could also be undefined [BUG #4676] + if (col == null || row == null) { + return; + } + + if (deltaX != 0) + { + var columnModel = this.getTableColumnModel(); + var x = columnModel.getVisibleX(col); + var colCount = columnModel.getVisibleColumnCount(); + x = qx.lang.Number.limit(x + deltaX, 0, colCount - 1); + col = columnModel.getVisibleColumnAtX(x); + } + + if (deltaY != 0) + { + var tableModel = this.getTableModel(); + row = qx.lang.Number.limit(row + deltaY, 0, tableModel.getRowCount() - 1); + } + + this.setFocusedCell(col, row, true); + }, + + + /** + * Scrolls a cell visible. + * + * @param col {Integer} the model index of the column the cell belongs to. + * @param row {Integer} the model index of the row the cell belongs to. + * @return {void} + */ + scrollCellVisible : function(col, row) + { + // get the dom element + var elem = this.getContentElement().getDomElement(); + // if the dom element is not available, the table hasn't been rendered + if (!elem) { + // postpone the scroll until the table has appeared + this.addListenerOnce("appear", function() { + this.scrollCellVisible(col, row); + }, this); + } + + var columnModel = this.getTableColumnModel(); + var x = columnModel.getVisibleX(col); + + var metaColumn = this._getMetaColumnAtColumnX(x); + + if (metaColumn != -1) { + this.getPaneScroller(metaColumn).scrollCellVisible(col, row); + } + }, + + + /** + * Returns whether currently a cell is editing. + * + * @return {var} whether currently a cell is editing. + */ + isEditing : function() + { + if (this.__focusedCol != null) + { + var x = this.getTableColumnModel().getVisibleX(this.__focusedCol); + var metaColumn = this._getMetaColumnAtColumnX(x); + return this.getPaneScroller(metaColumn).isEditing(); + } + return false; + }, + + + /** + ... [truncated message content] |
From: <san...@us...> - 2011-11-23 09:32:36
|
Revision: 21588 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21588&view=rev Author: sandersson Date: 2011-11-23 09:32:29 +0000 (Wed, 23 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-22 23:15:04 UTC (rev 21587) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-23 09:32:29 UTC (rev 21588) @@ -45,6 +45,15 @@ /* --------------------------------------------------------------------------- + CAPTCHA + --------------------------------------------------------------------------- + */ + + "captcha" : "widget", + "captcha/captcha-box" : "groupbox", + + /* + --------------------------------------------------------------------------- DECORATED WINDOW --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-22 23:15:04 UTC (rev 21587) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-23 09:32:29 UTC (rev 21588) @@ -50,6 +50,15 @@ /* --------------------------------------------------------------------------- + CAPTCHA + --------------------------------------------------------------------------- + */ + + "captcha" : "widget", + "captcha/captcha-box" : "groupbox", + + /* + --------------------------------------------------------------------------- DECORATED WINDOW --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js 2011-11-22 23:15:04 UTC (rev 21587) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js 2011-11-23 09:32:29 UTC (rev 21588) @@ -163,11 +163,9 @@ case "sound-button" : control = new qxe.ui.form.MultiStateButton(); - control.add(null, "qxe/icon/ui/control/text.png", this.tr("Read the captcha code generated.")); - control.add(null, "qxe/icon/ui/control/audio-volume-high.png", this.tr("Listen to the captcha code generated.")); + control.addButtonState(null, "qxe/icon/ui/control/text.png", this.tr("Read the captcha code generated.")); + control.addButtonState(null, "qxe/icon/ui/control/audio-volume-high.png", this.tr("Listen to the captcha code generated.")); control.addListener("execute", this._onExecuteSound, this); - - control.setEnabled(false); break; case "help-button" : @@ -304,25 +302,6 @@ */ _onExecuteSound : function(e) { - var soundB = this.getChildControl("sound-button"); - - if(this.hasState("mute")) - { - soundB.replaceState("mute", "low"); - } - else if(this.hasState("low")) - { - soundB.replaceState("low", "medium"); - } - else if(this.hasState("medium")) - { - soundB.replaceState("medium", "high"); - } - else if(this.hasState("high")) - { - soundB.replaceState("high", "mute"); - } - // Put sound system here }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-22 23:15:11
|
Revision: 21587 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21587&view=rev Author: sandersson Date: 2011-11-22 23:15:04 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/translation/readme.txt trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/ trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/ Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/Manifest.json 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe MultiStateButton Demo", + + "summary" : "qooxdoo extension framework Demo", + "description" : "Extension of the standard qooxdoo framework demo.", + + "homepage" : "http://contrib.qooxdoo.org/project/qxe", + + "license" : "LGPL/EPL", + "authors" : + [ + { + "name" : "Stefan Andersson (sand)", + "email" : "ste...@li..." + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["1.6"] + }, + + "provides" : + { + "namespace" : "qxe.demo", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/config.json 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,65 @@ +{ + "name" : "qxe Demo MultiStateButton", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + } + ], + + "export" : + [ + "api", + "api-data", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "source-hybrid", + "simulation-build", + "simulation-run", + "test", + "test-source", + "translation" + ], + + "default-job" : "source", + + "let" : + { + "APPLICATION" : "qxe.demo", + "QOOXDOO_PATH" : "../../../../qooxdoo/1.6", + "QXTHEME" : "qxe.demo.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"], + "LOCALES" : [ "en" ], + "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", + "ROOT" : "." + }, + + "config-warnings" : + { + "job-shadowing" : ["libraries"] + }, + + "jobs" : + { + "libraries" : + { + "library" : + [ + { + "manifest" : "../../Manifest.json" + } + ] + } + } +} Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/generate.py 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Thomas Herchenroeder (thron7) +# +################################################################################ + +## +# This is a stub proxy for the real generator.py +## + +import sys, os, re, subprocess + +CMD_PYTHON = sys.executable +QOOXDOO_PATH = '../../qooxdoo/1.6' + +def getQxPath(): + path = QOOXDOO_PATH + # try updating from config file + if os.path.exists('config.json'): + # "using QOOXDOO_PATH from config.json" + qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?') + conffile = open('config.json') + aconffile = conffile.readlines() + for line in aconffile: + mo = qpathr.search(line) + if mo: + path = mo.group(1) + break # assume first occurrence is ok + path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) + + return path + +os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir +qxpath = getQxPath() +REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') + +if not os.path.exists(REAL_GENERATOR): + print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR + sys.exit(1) + +argList = [] +argList.append(CMD_PYTHON) +argList.append(REAL_GENERATOR) +argList.extend(sys.argv[1:]) +if sys.platform == "win32": + argList1=[] + for arg in argList: + if arg.find(' ')>-1: + argList1.append('"%s"' % arg) + else: + argList1.append(arg) + argList = argList1 +else: + argList = ['"%s"' % x for x in argList] # quote argv elements + +cmd = " ".join(argList) +retval = subprocess.call(cmd, shell=True) +sys.exit(retval) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/Application.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,93 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/icon/ui/control/audio-volume-muted.png) +#asset(qxe/icon/ui/control/audio-volume-low.png) +#asset(qxe/icon/ui/control/audio-volume-medium.png) +#asset(qxe/icon/ui/control/audio-volume-high.png) + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe MultiStateButton" + */ +qx.Class.define("qxe.demo.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Environment.get("qx.debug")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + + // Add button to document at fixed coordinates + var multiStateButton1 = new qxe.ui.form.MultiStateButton(); + multiStateButton1.addButtonState("Muted", "qxe/icon/ui/control/audio-volume-muted.png", "Muted volume"); + multiStateButton1.addButtonState("Low", "qxe/icon/ui/control/audio-volume-low.png", "Low volume"); + multiStateButton1.addButtonState("Medium", "qxe/icon/ui/control/audio-volume-medium.png", "Medium volume"); + multiStateButton1.addButtonState("High", "qxe/icon/ui/control/audio-volume-high.png", "High volume"); + + var multiStateButton2 = new qxe.ui.form.MultiStateButton(); + multiStateButton2.addButtonState("Muted", "qxe/icon/ui/control/audio-volume-muted.png", "Muted volume"); + multiStateButton2.addButtonState("Low", "qxe/icon/ui/control/audio-volume-low.png", "Low volume"); + multiStateButton2.addButtonState("Medium", "qxe/icon/ui/control/audio-volume-medium.png", "Medium volume"); + multiStateButton2.addButtonState("High", "qxe/icon/ui/control/audio-volume-high.png", "High volume"); + multiStateButton2.setDynamic(true); + + doc.add(multiStateButton1, {left: 50, top: 50}); + doc.add(multiStateButton2, {left: 150, top: 50}); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,44 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define simulated interaction tests for your + * application. See the manual for details: + * {@link http://manual.qooxdoo.org/1.6/pages/development/simulator.html} + * + * @lint ignoreUndefined(simulator) + */ +qx.Class.define("qxe.demo.simulation.DemoSimulation", { + + extend : simulator.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** Check if a widget is present (part of the DOM) */ + testButtonPresent : function() + { + this.assertNotNull(this.getSimulation().getWidgetOrNull("qxh=qx.ui.form.Button"), "Button widget not present!"); + }, + + /** Click a button and check if an alert box pops up */ + testButtonClick : function() + { + this.getQxSelenium().qxClick("qxh=qx.ui.form.Button"); + this.assertEquals("true", String(this.getQxSelenium().isAlertPresent())); + } + } + +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/test/DemoTest.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("qxe.demo.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Appearance.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Appearance", +{ + extend : qxe.theme.modern.Appearance, + + appearances : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Color.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Color", +{ + extend : qxe.theme.modern.Color, + + colors : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Decoration.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Decoration", +{ + extend : qxe.theme.modern.Decoration, + + decorations : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Font.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Font", +{ + extend : qxe.theme.modern.Font, + + fonts : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/class/qxe/demo/theme/Theme.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Theme", +{ + meta : + { + color : qxe.demo.theme.Color, + decoration : qxe.demo.theme.Decoration, + font : qxe.demo.theme.Font, + icon : qx.theme.icon.Tango, + appearance : qxe.demo.theme.Appearance + } +}); \ No newline at end of file Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/index.html 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qxe</title> + <script type="text/javascript" src="script/qxe.demo.js"></script> +</head> +<body></body> +</html> Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/MultiStateButton/source/translation/readme.txt 2011-11-22 23:15:04 UTC (rev 21587) @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-12 13:49:08 UTC (rev 21586) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -76,6 +76,14 @@ /* --------------------------------------------------------------------------- + MULTI STATE BUTTON + --------------------------------------------------------------------------- + */ + + "multi-state-button" : "button", + + /* + --------------------------------------------------------------------------- OPTION PANE --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-12 13:49:08 UTC (rev 21586) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -81,6 +81,14 @@ /* --------------------------------------------------------------------------- + MULTI STATE BUTTON + --------------------------------------------------------------------------- + */ + + "multi-state-button" : "button", + + /* + --------------------------------------------------------------------------- OPTION PANE --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js 2011-11-12 13:49:08 UTC (rev 21586) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js 2011-11-22 23:15:04 UTC (rev 21587) @@ -19,9 +19,9 @@ #asset(qx/icon/${qx.icontheme}/16/actions/view-refresh.png) -#asset(qxe/icon/security/text.png) -#asset(qxe/icon/security/audio-volume-high.png) -#asset(qxe/icon/security/help-browser.png) +#asset(qxe/icon/ui/control/text.png) +#asset(qxe/icon/ui/control/audio-volume-high.png) +#asset(qxe/icon/ui/control/help-browser.png) ************************************************************************ */ @@ -163,8 +163,8 @@ case "sound-button" : control = new qxe.ui.form.MultiStateButton(); - control.add(null, "qxe/icon/security/text.png", this.tr("Read the captcha code generated.")); - control.add(null, "qxe/icon/security/audio-volume-high.png", this.tr("Listen to the captcha code generated.")); + control.add(null, "qxe/icon/ui/control/text.png", this.tr("Read the captcha code generated.")); + control.add(null, "qxe/icon/ui/control/audio-volume-high.png", this.tr("Listen to the captcha code generated.")); control.addListener("execute", this._onExecuteSound, this); control.setEnabled(false); @@ -173,7 +173,7 @@ case "help-button" : tooltip = new qx.ui.tooltip.ToolTip(this.tr("Context sensitive help.")); - control = new qx.ui.form.Button(null, "qxe/icon/security/help-browser.png"); + control = new qx.ui.form.Button(null, "qxe/icon/ui/control/help-browser.png"); control.addListener("execute", this._onExecuteHelp, this); control.setToolTip(tooltip); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-12 13:49:16
|
Revision: 21586 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21586&view=rev Author: sandersson Date: 2011-11-12 13:49:08 +0000 (Sat, 12 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Indicator.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/translation/readme.txt Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Indicator.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Indicator.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Indicator.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,207 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/icon/info/loading_application.gif) + +************************************************************************ */ + +/** + * + * Get loading images from http://ajaxload.info/ + * + * @childControl control-bar {qx.ui.container.Composite} container which holds the control-pane and visual-pane + * @childControl control-pane {qx.ui.container.Composite} container shows the print-button and which holds the fit-pane, zoom-pane, orientation-pane, location-pane, tool-pane and search-pane + * + */ +qx.Class.define("qxe.ui.info.Indicator", +{ + extend : qx.ui.core.Widget, + include : qx.ui.core.MBlocker, + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + /** + * @param image {String} The image. + * @param indicator {Boolean} Show indicator. + */ + construct : function(image, indicator) + { + this.base(arguments); + + // configure internal layout + this._setLayout(new qx.ui.layout.Basic()); + + this._createChildControl("image-pane"); + + // apply constructor parameters + if(image == null) + { + image = "qxe/icon/info/loading_application.gif"; + } + + this.getChildControl("image-pane").setSource(image); + + if(indicator != null) + { + this.setIndicator(indicator); + } + }, + + + /* + ***************************************************************************** + STATISTICS + ***************************************************************************** + */ + + statics : + { + getInstance : function(widget, image) + { + var location = widget.getContainerLocation("padding"); + + // Show loading indicator + var loadingLI = new qxe.ui.info.LoadIndicator(image); + + var left = Math.round(location.left + (location.right - location.left - loadingLI.getWidth())/2); + // Height of <div id="join"> is 470 and is hard coded here cause it is not seen in. + var top = Math.round(location.top + (location.bottom - location.top - loadingLI.getHeight() + 470)/2); + + var rootW = widget.getApplicationRoot(); + rootW.add(loadingLI, {left: left, top: top}); + + return loadingLI; + } + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "indicator" + }, + + /* + --------------------------------------------------------------------------- + FEATURES + --------------------------------------------------------------------------- + */ + + /** Should the indicator be shown */ + indicator : + { + check : "Boolean", + init : true, + apply : "_applyIndicatorChange", + themeable : true + }, + + /** The value of the progress indicator */ + progress : + { + init : 0, + check : "_validateProgress" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + // overridden + _createChildControlImpl : function(id) + { + var control; + + switch(id) + { + case "image-pane": + control = new qx.ui.basic.Image(); + + if(this.getIndicator()) + { + this._add(this.getChildControl("progress-indicator")); + } + +// control.setZIndex(1e10); +// this.blockContent(this.getZIndex() - 1); + + this._add(control); + break; + + case "progress-indicator": + control = new qx.ui.basic.Label(); + break; + } + + return control || this.base(arguments, id); + }, + + /** + * Validate the progress. + * + * @param value {Integer} The progressed value + */ + _validateProgress : function(value) + { + if(value == 100) + { + this.terminate(); + + return true; + } + else + { + return !isNaN(value) && value >= 0 && value <= 100; + } + }, + + /** + * Terminate. + */ + terminate : function() + { +// if (this.isContentBlocked()) +// { +// this.unblockContent(); +// } + + this.getLayoutParent().remove(this); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/Manifest.json 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe Busy Demo", + + "summary" : "qooxdoo extension framework Demo", + "description" : "Extension of the standard qooxdoo framework demo.", + + "homepage" : "http://contrib.qooxdoo.org/project/qxe", + + "license" : "LGPL/EPL", + "authors" : + [ + { + "name" : "Stefan Andersson (sand)", + "email" : "ste...@li..." + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["1.6"] + }, + + "provides" : + { + "namespace" : "qxe.demo", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/config.json 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,65 @@ +{ + "name" : "qxe Busy Demo", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + } + ], + + "export" : + [ + "api", + "api-data", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "source-hybrid", + "simulation-build", + "simulation-run", + "test", + "test-source", + "translation" + ], + + "default-job" : "source", + + "let" : + { + "APPLICATION" : "qxe.demo", + "QOOXDOO_PATH" : "../../../../qooxdoo/1.6", + "QXTHEME" : "qxe.demo.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"], + "LOCALES" : [ "en" ], + "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", + "ROOT" : "." + }, + + "config-warnings" : + { + "job-shadowing" : ["libraries"] + }, + + "jobs" : + { + "libraries" : + { + "library" : + [ + { + "manifest" : "../../Manifest.json" + } + ] + } + } +} Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/generate.py 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Thomas Herchenroeder (thron7) +# +################################################################################ + +## +# This is a stub proxy for the real generator.py +## + +import sys, os, re, subprocess + +CMD_PYTHON = sys.executable +QOOXDOO_PATH = '../../qooxdoo/1.6' + +def getQxPath(): + path = QOOXDOO_PATH + # try updating from config file + if os.path.exists('config.json'): + # "using QOOXDOO_PATH from config.json" + qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?') + conffile = open('config.json') + aconffile = conffile.readlines() + for line in aconffile: + mo = qpathr.search(line) + if mo: + path = mo.group(1) + break # assume first occurrence is ok + path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) + + return path + +os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir +qxpath = getQxPath() +REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') + +if not os.path.exists(REAL_GENERATOR): + print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR + sys.exit(1) + +argList = [] +argList.append(CMD_PYTHON) +argList.append(REAL_GENERATOR) +argList.extend(sys.argv[1:]) +if sys.platform == "win32": + argList1=[] + for arg in argList: + if arg.find(' ')>-1: + argList1.append('"%s"' % arg) + else: + argList1.append(arg) + argList = argList1 +else: + argList = ['"%s"' % x for x in argList] # quote argv elements + +cmd = " ".join(argList) +retval = subprocess.call(cmd, shell=True) +sys.exit(retval) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/Application.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,201 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe Busy indicator" + */ +qx.Class.define("qxe.demo.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Environment.get("qx.debug")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + + var busy = new qxe.ui.indicator.Busy(); + + doc.add(busy, {left: 50, top: 50}); + doc.add(this._createControlPane(busy), {left: 100, top: 50}); + + busy.start(); + }, + + _createControlPane : function(busy) + { + // Create components + var linesL = new qx.ui.basic.Label("Number of lines"); + + var linesS = new qx.ui.form.Spinner(6, busy.getLines(), 16); + linesS.addListener("changeValue", function(e) { + busy.setLines(e.getData()); + }, this); + + var lineLengthL = new qx.ui.basic.Label("Line length"); + + var lineLengthS = new qx.ui.form.Spinner(0, busy.getLineLength(), 30); + lineLengthS.addListener("changeValue", function(e) { + busy.setLineLength(e.getData()); + }, this); + + var lineWidthL = new qx.ui.basic.Label("Line width"); + + var lineWidthS = new qx.ui.form.Spinner(2, busy.getLineWidth(), 20); + lineWidthS.addListener("changeValue", function(e) { + busy.setLineWidth(e.getData()); + }, this); + + var radiusL = new qx.ui.basic.Label("Radius"); + + var radiusS = new qx.ui.form.Spinner(0, busy.getRadius(), 40); + radiusS.addListener("changeValue", function(e) { + busy.setRadius(e.getData()); + }, this); + + var lineColorL = new qx.ui.basic.Label(); + + var lineColorP = new qx.ui.control.ColorPopup(); + lineColorP.exclude(); + lineColorP.setValue("#000"); + lineColorP.addListener("changeValue", function(e) { + busy.setLineColor(e.getData()); + }, this); + + var lineColorB = new qx.ui.form.Button("Line color"); + lineColorB.addListener("execute", function(e) + { + lineColorP.placeToWidget(lineColorB); + lineColorP.show(); + }); + + var trailL = new qx.ui.basic.Label("Trail"); + + var trailS = new qx.ui.form.Spinner(10, busy.getTrail(), 100); + trailS.addListener("changeValue", function(e) { + busy.setTrail(e.getData()); + }, this); + + var speedL = new qx.ui.basic.Label("Speed"); + + var speedS = new qx.ui.form.Spinner(0.5, busy.getSpeed(), 2.2); + speedS.addListener("changeValue", function(e) { + busy.setSpeed(e.getData()); + }, this); + + var opacityL = new qx.ui.basic.Label("Opacity"); + + var format = new qx.util.format.NumberFormat(); + format.setMaximumFractionDigits(2); + + var opacityS = new qx.ui.form.Spinner(0, busy.getOpacity(), 1); + opacityS.addListener("changeValue", function(e) { + busy.setOpacity(e.getData()); + }, this); + opacityS.setNumberFormat(format); + + var fpsL = new qx.ui.basic.Label("Frames Per Second"); + + var fpsS = new qx.ui.form.Spinner(0, busy.getFps(), 40); + fpsS.addListener("changeValue", function(e) { + busy.setFps(e.getData()); + }, this); + + var shadowCB = new qx.ui.form.CheckBox("Apply shadow"); + shadowCB.addListener("changeValue", function(e) { + busy.setShadow(e.getData()); + }, this); + +// progress + + // Layout + var layout = new qx.ui.layout.Grid(); + var pane = new qx.ui.container.Composite(layout); + + pane.add(linesL, {row: 0, column: 0}); + pane.add(linesS, {row: 0, column: 1}); + + pane.add(lineLengthL, {row: 1, column: 0}); + pane.add(lineLengthS, {row: 1, column: 1}); + + pane.add(lineWidthL, {row: 2, column: 0}); + pane.add(lineWidthS, {row: 2, column: 1}); + + pane.add(radiusL, {row: 3, column: 0}); + pane.add(radiusS, {row: 3, column: 1}); + + pane.add(lineColorB, {row: 4, column: 0}); + pane.add(lineColorL, {row: 4, column: 1}); + + pane.add(trailL, {row: 5, column: 0}); + pane.add(trailS, {row: 5, column: 1}); + + pane.add(speedL, {row: 6, column: 0}); + pane.add(speedS, {row: 6, column: 1}); + + pane.add(opacityL, {row: 7, column: 0}); + pane.add(opacityS, {row: 7, column: 1}); + + pane.add(fpsL, {row: 8, column: 0}); + pane.add(fpsS, {row: 8, column: 1}); + + pane.add(shadowCB, {row: 9, column: 0}); + + return pane; + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,44 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define simulated interaction tests for your + * application. See the manual for details: + * {@link http://manual.qooxdoo.org/1.6/pages/development/simulator.html} + * + * @lint ignoreUndefined(simulator) + */ +qx.Class.define("qxe.demo.simulation.DemoSimulation", { + + extend : simulator.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** Check if a widget is present (part of the DOM) */ + testButtonPresent : function() + { + this.assertNotNull(this.getSimulation().getWidgetOrNull("qxh=qx.ui.form.Button"), "Button widget not present!"); + }, + + /** Click a button and check if an alert box pops up */ + testButtonClick : function() + { + this.getQxSelenium().qxClick("qxh=qx.ui.form.Button"); + this.assertEquals("true", String(this.getQxSelenium().isAlertPresent())); + } + } + +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/test/DemoTest.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("qxe.demo.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Appearance.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Appearance", +{ + extend : qxe.theme.modern.Appearance, + + appearances : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Color.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Color", +{ + extend : qxe.theme.modern.Color, + + colors : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Decoration.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Decoration", +{ + extend : qxe.theme.modern.Decoration, + + decorations : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Font.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Font", +{ + extend : qxe.theme.modern.Font, + + fonts : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/class/qxe/demo/theme/Theme.js 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Theme", +{ + meta : + { + color : qxe.demo.theme.Color, + decoration : qxe.demo.theme.Decoration, + font : qxe.demo.theme.Font, + icon : qx.theme.icon.Tango, + appearance : qxe.demo.theme.Appearance + } +}); \ No newline at end of file Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/index.html 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qxe</title> + <script type="text/javascript" src="script/qxe.demo.js"></script> +</head> +<body></body> +</html> Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Busy/source/translation/readme.txt 2011-11-12 13:49:08 UTC (rev 21586) @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-12 13:46:54
|
Revision: 21585 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21585&view=rev Author: sandersson Date: 2011-11-12 13:46:47 +0000 (Sat, 12 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/Captcha.js 2011-11-12 13:46:47 UTC (rev 21585) @@ -0,0 +1,340 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qx/icon/${qx.icontheme}/16/actions/view-refresh.png) + +#asset(qxe/icon/security/text.png) +#asset(qxe/icon/security/audio-volume-high.png) +#asset(qxe/icon/security/help-browser.png) + +************************************************************************ */ + +qx.Class.define("qxe.ui.control.Captcha", +{ + extend : qx.ui.core.Widget, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + this._setLayout(new qx.ui.layout.VBox(5)); + + this._createChildControl("captcha-box"); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + /* + --------------------------------------------------------------------------- + INTERNAL OPTIONS + --------------------------------------------------------------------------- + */ + + // overridden + appearance : + { + refine : true, + init : "captcha" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + INTERNAL API + --------------------------------------------------------------------------- + */ + + // overridden + _createChildControlImpl : function(id) + { + var control; + var layout; + var widget; + var tooltip; + + switch(id) + { + case "captcha-box" : + control = new qx.ui.groupbox.GroupBox(this.tr("Captcha")); + control.setLayout(new qx.ui.layout.VBox(5)); + control.setAllowGrowX(false); + control.add(this._createChildControl("captcha-control")); + control.add(this._createChildControl("input")); + + this._add(control); + break; + + case "captcha-control" : + layout = new qx.ui.layout.HBox(5); + + control = new qx.ui.container.Composite(layout); + control.add(this._createChildControl("captcha-view")); + control.add(this._createChildControl("captcha-buttons")); + break; + + case "captcha-view" : + control = new qx.ui.container.Stack(new qx.ui.layout.Canvas()); + control.add(this._createChildControl("captcha-image")); +// control.add(this._createChildControl("captcha-vu-meter")); + break; + + case "captcha-image" : + tooltip = new qx.ui.tooltip.ToolTip(this.tr("The captcha code generated.")); + + control = new qx.ui.basic.Image(); + control.setHeight(100); + control.setWidth(200); + control.setBackgroundColor("#ffffff"); + control.addListenerOnce("appear", this._onAppearCaptchaImage, this); + control.addListener("changeSource", this._onSourceChange, this); + control.addListener("loaded", this._onLoaded, this); + control.addListener("loadingFailed", this._onLoadingFailed, this); + control.setToolTip(tooltip); + break; + + case "captcha-vu-meter" : + tooltip = new qx.ui.tooltip.ToolTip(this.tr("The captcha VU meter.")); + +// control = new qxe.ui.indicator.VUMeter(); +// control.setHeight(100); +// control.setWidth(200); +// control.setBackgroundColor("#ffffff"); +// control.addListenerOnce("appear", this._onAppearCaptchaImage, this); +// control.addListener("changeSource", this._onSourceChange, this); +// control.addListener("loaded", this._onLoaded, this); +// control.addListener("loadingFailed", this._onLoadingFailed, this); +// control.setToolTip(tooltip); + break; + + case "captcha-buttons" : + control = new qx.ui.container.Composite(new qx.ui.layout.VBox(5)); + + control.add(this._createChildControl("update-button")); + control.add(this._createChildControl("sound-button")); + control.add(this._createChildControl("help-button")); + break; + + case "update-button" : + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Get a new captcha code.")); + + control = new qx.ui.form.Button(null, "icon/16/actions/view-refresh.png"); + control.addListener("execute", this._onExecuteUpdate, this); + control.setToolTip(tooltip); + break; + + case "sound-button" : + control = new qxe.ui.form.MultiStateButton(); + control.add(null, "qxe/icon/security/text.png", this.tr("Read the captcha code generated.")); + control.add(null, "qxe/icon/security/audio-volume-high.png", this.tr("Listen to the captcha code generated.")); + control.addListener("execute", this._onExecuteSound, this); + + control.setEnabled(false); + break; + + case "help-button" : + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Context sensitive help.")); + + control = new qx.ui.form.Button(null, "qxe/icon/security/help-browser.png"); + control.addListener("execute", this._onExecuteHelp, this); + control.setToolTip(tooltip); + break; + + case "input": + layout = new qx.ui.layout.HBox(5); + + var control = new qx.ui.container.Composite(layout); + widget = this._createChildControl("captcha-textfield"); + control.add(this._createChildControl("captcha-label")); + control.add(widget); + + this._add(control); + break; + + case "captcha-label" : + control = new qx.ui.basic.Label(this.tr("Type the word")); + control.setAlignY("middle"); + control.setBuddy(this.getChildControl("captcha-textfield")); + break; + + case "captcha-textfield": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Type in the captcha code you can see to the left.")); + + control = new qx.ui.form.TextField(); + control.setPlaceholder(this.tr("Code")); + control.setRequired(true); + control.setEnabled(false); + control.setWidth(60); + control.addListener("input", this._onInput, this); + control.setToolTip(tooltip); + break; + } + + return control || this.base(arguments, id); + }, + + + /* + --------------------------------------------------------------------------- + BASIC EVENT HANDLERS + --------------------------------------------------------------------------- + */ + + /** + * Listens to the "appear" event to display the received captcha image. + * + * @param e {qx.event.type.Appear} focus event + */ + _onAppearCaptchaImage : function(e) + { + // Get the first captcha when the widget is appearing + this.getChildControl("update-button").fireEvent("execute"); + }, + + /** + * Listens to the "source" event to display the new captcha image. + * + * @param e {qx.event.type.Appear} focus event + */ + _onSourceChange : function(e) + { + this.debug("Captcha image changed."); + + this.getChildControl("captcha-textfield").setEnabled(false); + this.getChildControl("update-button").setEnabled(false); + this.getChildControl("sound-button").setEnabled(true); + + this.getChildControl("captcha-textfield").setValue(null); + }, + + /** + * Listens to the "loaded" event to display the loaded captcha image. + * + * @param e {qx.event.type.Appear} focus event + */ + _onLoaded : function(e) + { + this.debug("Captcha image loaded."); + + this.getChildControl("captcha-textfield").setEnabled(true); + this.getChildControl("update-button").setEnabled(true); + this.getChildControl("sound-button").setEnabled(true); + + this.getChildControl("captcha-textfield").setValue(null); + }, + + /** + * Listens to the "loadingFailed" event to act on failed loading of captcha image. + * + * @param e {qx.event.type.Appear} focus event + */ + _onLoadingFailed : function(e) + { + this.debug("Failed loading captcha image."); + + this.getChildControl("captcha-textfield").setEnabled(false); + this.getChildControl("update-button").setEnabled(true); + this.getChildControl("sound-button").setEnabled(false); + + this.getChildControl("captcha-textfield").setValue(null); + }, + + /** + * Listens to the "input" event on input of captcha code. + * + * @param e {qx.event.type.Appear} focus event + */ + _onInput : function(e) + { + }, + + /** + * Listens to the "appear" event to display the received captcha image. + * + * @param e {qx.event.type.Appear} focus event + */ + _onExecuteUpdate : function(e) + { + // validate + // Set buttons + }, + + /** + * Listens to the "appear" event to display the received captcha image. + * + * @param e {qx.event.type.Appear} focus event + */ + _onExecuteSound : function(e) + { + var soundB = this.getChildControl("sound-button"); + + if(this.hasState("mute")) + { + soundB.replaceState("mute", "low"); + } + else if(this.hasState("low")) + { + soundB.replaceState("low", "medium"); + } + else if(this.hasState("medium")) + { + soundB.replaceState("medium", "high"); + } + else if(this.hasState("high")) + { + soundB.replaceState("high", "mute"); + } + + // Put sound system here + }, + + /** + * Listens to the "execute" event to display help. + * + * @param e {qx.event.type.Execute} execute event + */ + _onExecuteHelp : function(e) + { + // Put help system in here + } + } +}); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-12 12:54:49
|
Revision: 21584 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21584&view=rev Author: sandersson Date: 2011-11-12 12:54:42 +0000 (Sat, 12 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/translation/readme.txt trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/application/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/application/MModules.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/html/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/ Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/bom/client/ Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/Manifest.json 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe Captcha Demo", + + "summary" : "qooxdoo extension framework Demo", + "description" : "Extension of the standard qooxdoo framework demo.", + + "homepage" : "http://contrib.qooxdoo.org/project/qxe", + + "license" : "LGPL/EPL", + "authors" : + [ + { + "name" : "Stefan Andersson (sand)", + "email" : "ste...@li..." + } + ], + + "version" : "trunk", + "qooxdoo-versions": ["1.6"] + }, + + "provides" : + { + "namespace" : "qxe.demo", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/config.json 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,65 @@ +{ + "name" : "qxe Demo Captcha", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + } + ], + + "export" : + [ + "api", + "api-data", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "source-hybrid", + "simulation-build", + "simulation-run", + "test", + "test-source", + "translation" + ], + + "default-job" : "source", + + "let" : + { + "APPLICATION" : "qxe.demo", + "QOOXDOO_PATH" : "../../../../qooxdoo/1.6", + "QXTHEME" : "qxe.demo.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"], + "LOCALES" : [ "en" ], + "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", + "ROOT" : "." + }, + + "config-warnings" : + { + "job-shadowing" : ["libraries"] + }, + + "jobs" : + { + "libraries" : + { + "library" : + [ + { + "manifest" : "../../Manifest.json" + } + ] + } + } +} Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/generate.py 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,72 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2008 - 2010 1&1 Internet AG, Germany, http://www.1und1.de +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Thomas Herchenroeder (thron7) +# +################################################################################ + +## +# This is a stub proxy for the real generator.py +## + +import sys, os, re, subprocess + +CMD_PYTHON = sys.executable +QOOXDOO_PATH = '../../qooxdoo/1.6' + +def getQxPath(): + path = QOOXDOO_PATH + # try updating from config file + if os.path.exists('config.json'): + # "using QOOXDOO_PATH from config.json" + qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?') + conffile = open('config.json') + aconffile = conffile.readlines() + for line in aconffile: + mo = qpathr.search(line) + if mo: + path = mo.group(1) + break # assume first occurrence is ok + path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path)) + + return path + +os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir +qxpath = getQxPath() +REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py') + +if not os.path.exists(REAL_GENERATOR): + print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR + sys.exit(1) + +argList = [] +argList.append(CMD_PYTHON) +argList.append(REAL_GENERATOR) +argList.extend(sys.argv[1:]) +if sys.platform == "win32": + argList1=[] + for arg in argList: + if arg.find(' ')>-1: + argList1.append('"%s"' % arg) + else: + argList1.append(arg) + argList = argList1 +else: + argList = ['"%s"' % x for x in argList] # quote argv elements + +cmd = " ".join(argList) +retval = subprocess.call(cmd, shell=True) +sys.exit(retval) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/Application.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,80 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-cancel.png) +#asset(qx/icon/${qx.icontheme}/16/actions/help-about.png) + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe Captcha" + */ +qx.Class.define("qxe.demo.Application", +{ + extend : qx.application.Standalone, + + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** + * This method contains the initial application code and gets called + * during startup of the application + * + * @lint ignoreDeprecated(alert) + */ + main : function() + { + // Call super class + this.base(arguments); + + // Enable logging in debug variant + if (qx.core.Environment.get("qx.debug")) + { + // support native logging capabilities, e.g. Firebug for Firefox + qx.log.appender.Native; + // support additional cross-browser console. Press F7 to toggle visibility + qx.log.appender.Console; + } + + /* + ------------------------------------------------------------------------- + Below is your actual application code... + ------------------------------------------------------------------------- + */ + + // Document is the application root + var doc = this.getRoot(); + + // Add button to document at fixed coordinates + var captcha = new qxe.ui.control.Captcha(); + + doc.add(captcha, {left: 50, top: 50}); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,44 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define simulated interaction tests for your + * application. See the manual for details: + * {@link http://manual.qooxdoo.org/1.6/pages/development/simulator.html} + * + * @lint ignoreUndefined(simulator) + */ +qx.Class.define("qxe.demo.simulation.DemoSimulation", { + + extend : simulator.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** Check if a widget is present (part of the DOM) */ + testButtonPresent : function() + { + this.assertNotNull(this.getSimulation().getWidgetOrNull("qxh=qx.ui.form.Button"), "Button widget not present!"); + }, + + /** Click a button and check if an alert box pops up */ + testButtonClick : function() + { + this.getQxSelenium().qxClick("qxh=qx.ui.form.Button"); + this.assertEquals("true", String(this.getQxSelenium().isAlertPresent())); + } + } + +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/test/DemoTest.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute <code>generate.py test</code> to generate a testrunner application + * and open it from <tt>test/index.html</tt> + * + * The methods that contain the tests are instance methods with a + * <code>test</code> prefix. You can create an arbitrary number of test + * classes like this one. They can be organized in a regular class hierarchy, + * i.e. using deeper namespaces and a corresponding file structure within the + * <tt>test</tt> folder. + */ +qx.Class.define("qxe.demo.test.DemoTest", +{ + extend : qx.dev.unit.TestCase, + + members : + { + /* + --------------------------------------------------------------------------- + TESTS + --------------------------------------------------------------------------- + */ + + /** + * Here are some simple tests + */ + testSimple : function() + { + this.assertEquals(4, 3+1, "This should never fail!"); + this.assertFalse(false, "Can false be true?!"); + }, + + /** + * Here are some more advanced tests + */ + testAdvanced: function () + { + var a = 3; + var b = a; + this.assertIdentical(a, b, "A rose by any other name is still a rose"); + this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!"); + } + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Appearance.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Appearance", +{ + extend : qxe.theme.modern.Appearance, + + appearances : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Color.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Color", +{ + extend : qxe.theme.modern.Color, + + colors : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Decoration.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Decoration", +{ + extend : qxe.theme.modern.Decoration, + + decorations : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Font.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Font", +{ + extend : qxe.theme.modern.Font, + + fonts : + { + } +}); Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/class/qxe/demo/theme/Theme.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("qxe.demo.theme.Theme", +{ + meta : + { + color : qxe.demo.theme.Color, + decoration : qxe.demo.theme.Decoration, + font : qxe.demo.theme.Font, + icon : qx.theme.icon.Tango, + appearance : qxe.demo.theme.Appearance + } +}); \ No newline at end of file Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/index.html 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qxe</title> + <script type="text/javascript" src="script/qxe.demo.js"></script> +</head> +<body></body> +</html> Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Captcha/source/translation/readme.txt 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/application/MModules.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/application/MModules.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/application/MModules.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -0,0 +1,95 @@ +/* ************************************************************************ + + qxe - qooxdoo extension framework + + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. + + Authors: + * Stefan Andersson (sand) + +************************************************************************ */ + +/** + * Registering program modules. + */ +qx.Mixin.define("qxe.application.MModules", +{ + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.__modules = []; + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /** Registered program modules. */ + __modules : null, + + + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + /** + * Register a program module. + * + * @param name {String} The program module name. + * @param clazz {qx.Object} The instance of program module. + */ + registerModule : function(name, clazz) + { + this.__modules[name] = clazz; + }, + + /** + * Register a program module. + * + * @param name {String} The program module name. + */ + unregisterModule : function(name) + { + var modules = this.__modules; + modules.splice(modules.indexOf(name), 1); + }, + + /** + * Lookup a program module. + * + * @param name {String} The program module name. + * @return {qx.Object} The instance of program module. + */ + lookupModule : function(name) + { + return this.__modules[name]; + } + }, + + /** + * Destruct. + */ + destruct : function() + { + this.__modules = null; + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-11 08:03:04 UTC (rev 21583) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -29,6 +29,14 @@ { /* --------------------------------------------------------------------------- + BUSY INDICATOR + --------------------------------------------------------------------------- + */ + + "busy-indicator" : "widget", + + /* + --------------------------------------------------------------------------- BUTTON PANE --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-11 08:03:04 UTC (rev 21583) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-12 12:54:42 UTC (rev 21584) @@ -34,6 +34,14 @@ { /* --------------------------------------------------------------------------- + BUSY INDICATOR + --------------------------------------------------------------------------- + */ + + "busy-indicator" : "widget", + + /* + --------------------------------------------------------------------------- BUTTON PANE --------------------------------------------------------------------------- */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_w...@us...> - 2011-11-11 08:03:13
|
Revision: 21583 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21583&view=rev Author: d_wagner Date: 2011-11-11 08:03:04 +0000 (Fri, 11 Nov 2011) Log Message: ----------- Changed test feed URL since the old one no longer works Modified Paths: -------------- trunk/qooxdoo-contrib/Simulator/1.5/tool/selenium/simulation/feedreader/test_feedreader.js trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/feedreader/test_feedreader.js Modified: trunk/qooxdoo-contrib/Simulator/1.5/tool/selenium/simulation/feedreader/test_feedreader.js =================================================================== --- trunk/qooxdoo-contrib/Simulator/1.5/tool/selenium/simulation/feedreader/test_feedreader.js 2011-11-09 01:58:08 UTC (rev 21582) +++ trunk/qooxdoo-contrib/Simulator/1.5/tool/selenium/simulation/feedreader/test_feedreader.js 2011-11-11 08:03:04 UTC (rev 21583) @@ -211,16 +211,8 @@ } // Enter new feed details - if (this.getConfigSetting("branch") == "branch_1_1_x") { - var setFeedTitle = feedWindowScript + ".getChildren()[0].getChildren()[1].setValue('Golem')"; - this.getEval(setFeedTitle, "Setting feed title"); - var setFeedUrl = feedWindowScript + ".getChildren()[0].getChildren()[3].setValue('http://rss.golem.de/rss.php?feed=ATOM1.0')"; - this.getEval(setFeedUrl, "Setting feed URL"); - } - else { - this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[1]", "Golem"); - this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[2]", "http://rss.golem.de/rss.php?feed=ATOM1.0"); - } + this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[1]", "Heise"); + this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[2]", "http://www.heise.de/newsticker/heise-atom.xml"); this.qxClick(locators.feedWindowButton, "", "Clicking 'Add'."); Packages.java.lang.Thread.sleep(2000); Modified: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/feedreader/test_feedreader.js =================================================================== --- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/feedreader/test_feedreader.js 2011-11-09 01:58:08 UTC (rev 21582) +++ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/feedreader/test_feedreader.js 2011-11-11 08:03:04 UTC (rev 21583) @@ -211,16 +211,8 @@ } // Enter new feed details - if (this.getConfigSetting("branch") == "branch_1_1_x") { - var setFeedTitle = feedWindowScript + ".getChildren()[0].getChildren()[1].setValue('Golem')"; - this.getEval(setFeedTitle, "Setting feed title"); - var setFeedUrl = feedWindowScript + ".getChildren()[0].getChildren()[3].setValue('http://rss.golem.de/rss.php?feed=ATOM1.0')"; - this.getEval(setFeedUrl, "Setting feed URL"); - } - else { - this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[1]", "Golem"); - this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[2]", "http://rss.golem.de/rss.php?feed=ATOM1.0"); - } + this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[1]", "Heise"); + this.qxType(locators.feedWindow + "/qx.ui.form.renderer.SinglePlaceholder/child[2]", "http://www.heise.de/newsticker/heise-atom.xml"); this.qxClick(locators.feedWindowButton, "", "Clicking 'Add'."); Packages.java.lang.Thread.sleep(2000); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-11-09 01:58:14
|
Revision: 21582 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21582&view=rev Author: derrell Date: 2011-11-09 01:58:08 +0000 (Wed, 09 Nov 2011) Log Message: ----------- Fixed date processing for App Engine Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-11-09 01:57:45 UTC (rev 21581) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-11-09 01:58:08 UTC (rev 21582) @@ -277,9 +277,11 @@ switch(type) { case "String": - case "Date": return value ? String(value) : null; + case "Date": + return value ? Number(value) : null; + case "LongString": return value ? String(value.getValue()) : null; @@ -480,10 +482,14 @@ case "Key": case "Integer": - case "Date": // Convert JavaScript Number to Java Long to avoid floating point return java.lang.Long(String(value)); + case "Date": + // If non-null, convert to a Java Long as with Integer; + // otherwise return null. + return value !== null ? java.lang.Long(String(value)) : null; + case "LongString": var Text = Packages.com.google.appengine.api.datastore.Text; return value ? new Text(value) : value; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2011-11-09 01:57:51
|
Revision: 21581 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21581&view=rev Author: derrell Date: 2011-11-09 01:57:45 +0000 (Wed, 09 Nov 2011) Log Message: ----------- Added missing Date type in put() Modified Paths: -------------- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js Modified: trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js =================================================================== --- trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-11-07 14:18:27 UTC (rev 21580) +++ trunk/qooxdoo-contrib/RpcJs/trunk/source/class/rpcjs/appengine/Dbif.js 2011-11-09 01:57:45 UTC (rev 21581) @@ -480,6 +480,7 @@ case "Key": case "Integer": + case "Date": // Convert JavaScript Number to Java Long to avoid floating point return java.lang.Long(String(value)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |