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: <san...@us...> - 2011-12-06 11:58:37
|
Revision: 21630 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21630&view=rev Author: sandersson Date: 2011-12-06 11:58:24 +0000 (Tue, 06 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/DocumentViewer.js Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/DocumentViewer.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/DocumentViewer.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/DocumentViewer.js 2011-12-06 11:58:24 UTC (rev 21630) @@ -0,0 +1,1501 @@ +/* ************************************************************************ + + 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) + +************************************************************************ */ + +/* ************************************************************************ + + Todo: + - fix zoom, with zoom frame + - fix panning + - fix scrollbars sync with the whole document and not only current page + - fix integration with flash for functions like: print, search, text select etc. + - fix for checking FRAMESLOADED instead of always 100% through getPercentLoaded() i.e. not all frames need to be loaded + only the frame you want to look at. + + Flash functions: + + Back() + CallFunction(request) + DisableLocalSecurity() + EnforceLocalSecurity() + FlashVersion() + Forward() + GetVariable(variable) + IsPlaying() + LoadMovie(layer, url) + Pan(x,y,mode) + Play() + Rewind() + SetReturnValue(value) + SetVariable(name, value) + SetZoomRect(left,top,right,bottom) + Stop() + StopPlay() + + http://www.adobe.com/support/flash/publishexport/scriptingwithflash/index.html + + flashFE.TGetProperty("/", n); + + Property Property number Constant Get Set + ----------------------------------------------------------- + X POSITION (_x) 0 X_POS ÷ ÷ + Y POSITION (_y) 1 Y_POS ÷ ÷ + X SCALE 2 X_SCALE ÷ ÷ + Y SCALE 3 Y_SCALE ÷ ÷ + CURRENTFRAME 4 CURRENT_FRAME ÷ + TOTALFRAMES 5 TOTAL_FRAMES ÷ + ALPHA 6 ALPHA ÷ ÷ + VISIBILITY 7 VISIBLE ÷ ÷ + WIDTH 8 WIDTH ÷ + HEIGHT 9 HEIGHT ÷ + ROTATION 10 ROTATE ÷ ÷ + TARGET 11 TARGET ÷ + FRAMESLOADED 12 FRAMES_LOADED ÷ + NAME 13 NAME ÷ ÷ + DROPTARGET 14 DROP_TARGET ÷ + URL(_url) 15 URL ÷ + + The following table shows global properties: + + Global Property Property number Constant Get Set + ----------------------------------------------------------- + HIGHQUALITY 16 HIGH_QUALITY ÷ ÷ + FOCUSRECT 17 FOCUS_RECT ÷ ÷ + SOUNDBUFTIME 18 SOUND_BUF_TIME ÷ ÷ + + + Converting a .pdf file to .swf + ----------------------------- + Using swftools by: + + pdf2swf -T4 -o file.swf file.pdf + + we tried version 9 by -T9 instead of -T4 because of allow access public but then an "undefined error" JScript + occurred in IE8. + + Conclusion: Use -T4 and there is no access violations either. + +************************************************************************ */ + +/* ************************************************************************ + +#asset(qxe/icon/info/loading_content.gif) + +#asset(qx/icon/${qx.icontheme}/16/actions/document-print.png) + +#asset(qxe/icon/ui/control/documentviewer/thumbnails.gif) +#asset(qxe/icon/ui/control/documentviewer/fitwidth.gif) +#asset(qxe/icon/ui/control/documentviewer/fitpage.gif) +#asset(qx/icon/${qx.icontheme}/16/actions/view-fullscreen.png) + +#asset(qx/icon/${qx.icontheme}/16/actions/zoom-in.png) +#asset(qx/icon/${qx.icontheme}/16/actions/zoom-out.png) + +#asset(qx/icon/${qx.icontheme}/16/actions/object-rotate-right.png) +#asset(qx/icon/${qx.icontheme}/16/actions/object-rotate-left.png) + +#asset(qxe/icon/ui/control/documentviewer/pointer.gif) +#asset(qxe/icon/ui/control/documentviewer/textselect.gif) +#asset(qxe/icon/ui/control/documentviewer/handtool.gif) + +#asset(qx/icon/${qx.icontheme}/16/actions/edit-find.png) + +************************************************************************ */ + +/** + * A document flash viewer as known from native applications. + * + * Includes support for viewing flash converted documents. + * + * @appearance textfield + * + * @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 + * @childControl print-button {qx.ui.toolbar.Button} prints the document in the visual-pane + * @childControl fit-pane {qx.ui.container.Composite} container shows the thumb-view-button, fit-width-button, fit-page-button and full-screen-button + * @childControl thumb-view-button {qx.ui.toolbar.RadioButton} shows all pages of the document in the visual-pane + * @childControl fit-width-button {qx.ui.toolbar.RadioButton} fits the width of the document in the visual-pane + * @childControl full-page-button {qx.ui.toolbar.RadioButton} fits the page of the document in the visual-pane + * @childControl full-screen-button {qx.ui.toolbar.RadioButton} fits the full screen for the document in the visual-pane + * @childControl zoom-pane {qx.ui.container.Composite} container shows the zoom-page-slider and zoom-page-field + * @childControl zoom-page-slider {qx.ui.form.Slider} zooms the document in the visual-pane + * @childControl zoom-page-field {qx.ui.form.TextField} shows the zoom value of the document in the visual-pane + * @childControl orientation-pane {qx.ui.container.Composite} container shows the clockwise-button and counterclockwise-button + * @childControl clockwise-button {qx.ui.toolbar.Button} rotates the document in the visual-pane clockwise + * @childControl counterclockwise-button {qx.ui.toolbar.Button} rotates the document in the visual-pane counterclockwise + * @childControl page-control-pane {qxe.ui.control.PageControl} container shows the page control pane + * @childControl tool-pane {qx.ui.container.Composite} container shows the selection-tool-button and hand-tool-button + * @childControl selection-tool-button {qx.ui.toolbar.RadioButton} chooses the text selection tool of the document in the visual-pane + * @childControl hand-tool-button {qx.ui.toolbar.RadioButton} chooses the hand tool of the document in the visual-pane + * @childControl search-pane {qx.ui.container.Composite} container shows the search-field and search-button + * @childControl search-field {qx.ui.form.TextField} text to be search for in the document in the visual-pane + * @childControl hand-tool-button {qx.ui.toolbar.Button} starts the search of the text in search-field of the document in the visual-pane + * @childControl visual-pane {qx.ui.container.Composite} container shows the scroll pane and the flash widgets showing the document + */ +qx.Class.define("qxe.ui.control.DocumentViewer", +{ + extend : qx.ui.core.Widget, + implement : [ + qxe.ui.control.IPageControl + ], + include : + [ +// qxe.ui.control.MPageControl, + qx.ui.core.MRemoteChildrenHandling, + qx.ui.core.MRemoteLayoutHandling, + qx.ui.core.MContentPadding + ], + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + /** + * Constructor. + * + * @param source {String} the flash source + * @param param {Map} the map of flash parameters + * @param variables {Map} the map of flash variables + */ + construct : function(source, param, variables) + { + this.base(arguments); + + // configure internal layout + this._setLayout(new qx.ui.layout.VBox()); + + this._createChildControl("control-pane"); + this._createChildControl("visual-pane"); + + // apply constructor parameters + if(source) + { + this.setSource(source); + } + + if(param) + { + this.setParam(param); + } + + if (variables) + { + this.setVariables(variables); + } + + // Register as root for the focus handler ??? + qx.ui.core.FocusHandler.getInstance().addRoot(this); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "document-viewer" + }, + + /** Should the whole view panel be shown */ + showControlPane : + { + check : "Boolean", + init : true, + apply : "_applyShowControlPaneChange", + themeable : true + }, + + /** Should the print button be shown */ + printable : + { + check : "Boolean", + init : true, + apply : "_applyPrintableChange", + themeable : true + }, + + /** Should the fit full screen button be shown */ + showFullScreen : + { + check : "Boolean", + init : true, + apply : "_applyShowFullScreenChange", + themeable : true + }, + + /** Should the selection tool button be shown */ + useSelectionTool : + { + check : "Boolean", + init : true, + apply : "_applyUseSelectionToolChange", + themeable : true + }, + + /* + * The fraction used at zooming. + */ + zoomFraction : + { + check : "Integer", + init : 10 + }, + + /* + * A flag to control if the user has scrolled to the bottom of the document. + */ + scrolledAll : + { + check : "Boolean", + init : false, + event : "scrolledAll" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + + /** + * The children container needed by the {@link qx.ui.core.MRemoteChildrenHandling} + * mixin + * + * @return {qx.ui.container.Composite} The container sub widget + */ + getChildrenContainer : function() + { + return this.getChildControl("visual-pane"); + }, + + /** + * Returns the element, to which the content padding should be applied. + * + * @return {qx.ui.core.Widget} The container sub widget + */ + _getContentPaddingTarget : function() + { + return this.getChildControl("pane"); + }, + + // overridden + _createChildControlImpl : function(id) + { + var control; + var radioGroup; + var widget; + var tooltip; + + switch(id) + { + /* + --------------------------------------------------------------------------- + CREATE #1: BASE STRUCTURE + --------------------------------------------------------------------------- + */ + + /* + --------------------------------------------------------------------------- + CREATE #2: PANES + --------------------------------------------------------------------------- + */ + + case "control-pane": + control = new qx.ui.toolbar.ToolBar(); + + if(this.getPrintable()) + { + control.add(this._createChildControl("print-button")); + } + + control.add(this._createChildControl("fit-pane")); + control.add(this._createChildControl("zoom-pane")); + control.add(this._createChildControl("orientation-pane")); + control.add(this._createChildControl("page-control-pane")); + control.add(this._createChildControl("tool-pane")); + control.add(this._createChildControl("search-pane")); + + this._add(control); + break; + + case "print-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Print the document.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/document-print.png"); + control.setEnabled(false); + control.setToolTip(tooltip); + control.addListener("execute", this._onPrintButtonClick, this); + break; + + case "fit-pane": + control = new qx.ui.toolbar.Part(); + control.setEnabled(false); + radioGroup = new qx.ui.form.RadioGroup(); + + widget = this._createChildControl("thumb-view-button"); + control.add(widget); + radioGroup.add(widget); + + widget = this._createChildControl("fit-width-button"); + control.add(widget); + radioGroup.add(widget); + + widget = this._createChildControl("fit-page-button"); + control.add(widget); + radioGroup.add(widget); + + if(this.getShowFullScreen()) + { + widget = this._createChildControl("full-screen-button"); + control.add(widget); + radioGroup.add(widget); + } + break; + + case "thumb-view-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Show thumbnails of the pages of the document.")); + + control = new qx.ui.toolbar.RadioButton(null, "qxe/icon/ui/control/documentviewer/thumbnails.gif"); + control.setToolTip(tooltip); + control.addListener("execute", this._onThumbViewButtonClick, this); + break; + + case "fit-width-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Fit page width with viewer.")); + + control = new qx.ui.toolbar.RadioButton(null, "qxe/icon/ui/control/documentviewer/fitwidth.gif"); + control.setToolTip(tooltip); + control.addListener("execute", this._onFitWidthButtonClick, this); + break; + + case "fit-page-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Fit page height with viewer.")); + + control = new qx.ui.toolbar.RadioButton(null, "qxe/icon/ui/control/documentviewer/fitpage.gif"); + control.setToolTip(tooltip); + control.addListener("execute", this._onFitPageButtonClick, this); + break; + + case "full-screen-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Show document in full screen.")); + + control = new qx.ui.toolbar.RadioButton(null, "icon/16/actions/view-fullscreen.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onFullScreenButtonClick, this); + break; + + case "zoom-pane": + control = new qx.ui.toolbar.Part(); + control.setEnabled(false); + control.add(this._createChildControl("zoom-in-page")); + control.add(this._createChildControl("zoom-page-field")); + control.add(this._createChildControl("zoom-out-page")); + break; + + case "zoom-in-page": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Zoom in the document.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/zoom-in.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onZoomInButtonClick, this); + break; + + case "zoom-page-field": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Zoom percentage of the document.")); + + 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._onZoomChangeValue, this); + break; + + case "zoom-out-page": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Zoom out the document.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/zoom-out.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onZoomOutButtonClick, this); + break; + + case "orientation-pane": + control = new qx.ui.toolbar.Part(); + control.setEnabled(false); + control.add(this._createChildControl("counterclockwise-button")); + control.add(this._createChildControl("clockwise-button")); + break; + + case "counterclockwise-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Rotate the document counterclockwise.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/object-rotate-left.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onCounterclockwiseButtonClick, this); + break; + + case "clockwise-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Rotate the document clockwise.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/object-rotate-right.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onClockwiseButtonClick, this); + break; + + case "page-control-pane": + control = new qx.ui.toolbar.Part(); + control.setEnabled(false); + control.add(this._createChildControl("page-control")); + break; + + case "page-control": + control = new qxe.ui.control.PageControl(this); + break; + + case "tool-pane": + control = new qx.ui.toolbar.Part(); + control.setEnabled(false); + radioGroup = new qx.ui.form.RadioGroup(); + + widget = this._createChildControl("pointer-selection-tool-button"); + control.add(widget); + radioGroup.add(widget); + + if(this.getUseSelectionTool()) + { + widget = this._createChildControl("text-selection-tool-button"); + control.add(widget); + radioGroup.add(widget); + } + + widget = this._createChildControl("hand-tool-button") + control.add(widget); + radioGroup.add(widget); + break; + + case "pointer-selection-tool-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Use tool to point at content of document.")); + + control = new qx.ui.toolbar.RadioButton(null, "qxe/icon/ui/control/documentviewer/pointer.gif"); + control.setToolTip(tooltip); + control.addListener("execute", this._onPointerSelectionToolButtonClick, this); + break; + + case "text-selection-tool-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Use tool to select text in document.")); + + control = new qx.ui.toolbar.RadioButton(null, "qxe/icon/ui/control/documentviewer/textselect.gif"); + control.setToolTip(tooltip); + control.addListener("execute", this._onTextSelectionToolButtonClick, this); + break; + + case "hand-tool-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Use hand tool to maneuvre document.")); + + control = new qx.ui.toolbar.RadioButton(null, "qxe/icon/ui/control/documentviewer/handtool.gif"); + control.setToolTip(tooltip); + control.addListener("execute", this._onHandToolButtonClick, this); + break; + + case "search-pane": + control = new qx.ui.toolbar.Part(); + control.setEnabled(false); + control.add(this._createChildControl("search-field")); + control.add(this._createChildControl("search-button")); + break; + + case "search-field": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Text to be searched in document.")); + + control = new qx.ui.form.TextField(); + control.setPlaceholder(this.tr("Expression")); + control.setWidth(70); + control.setAlignY("middle"); + control.setToolTip(tooltip); + break; + + case "search-button": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Start the search of text in document.")); + + control = new qx.ui.toolbar.Button(null, "icon/16/actions/edit-find.png"); + control.setToolTip(tooltip); + control.addListener("execute", this._onSearchButtonClick, this); + break; + + case "visual-pane": + var layout = new qx.ui.layout.Grow(); + control = new qx.ui.container.Composite(layout); + + control.add(this._createChildControl("scroll-pane")); + + this._add(control, {flex: 1}); + break; + + case "scroll-pane": + // Scroll container + control = new qx.ui.container.Scroll(); + control.getChildControl("pane").addListener("scrollY", this._onScrollY, this); + break; + + case "flash": + control = new qx.ui.embed.Flash(""); +// control.setId("flashDoc"); + control.setAllowShrinkY(false); + control.setAllowShrinkX(false); + control.setScale("noscale"); + control.setPlay(false); + control.setLoop(false); + control.setAllowScriptAccess("sameDomain"); + control.setLiveConnect(true); +// control.setMayScript(true); + control.setMenu(false); + control.addListener("keyup", this._onKeyUp, this); + control.setLoadTimeout(60000); + control.addListener("loading", function() { + this.debug(control.getPercentLoaded()); + }, this); + break; + + case "initiator": +// control = new qxe.ui.info.LoadIndicator.getInstance(this, "qxe/icon/info/loading_content.gif"); + break; + } + + return control || this.base(arguments, id); + }, + + + /* + --------------------------------------------------------------------------- + BASIC EVENT HANDLERS + --------------------------------------------------------------------------- + */ + + /** + * Listens to the "execute" event to print the document. + * + * @param e {qx.event.type.Execute} execute event + */ + _onPrintButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + if(flashFE.print) + { + // Calling a custom flash method over ExternalInterface which in turn calls + // flash.PrintJob and its dialog. + flashFE.print(); + } + else + { + this.notSupported(); + } + } + }, + + /** + * Listens to the "execute" event to layout pages in a thumb view. + * + * @param e {qx.event.type.Execute} execute event + */ + _onThumbViewButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + if(flashFE.showThumbnails) + { + flashFE.showThumbnails(); + } + else + { + this.notSupported(); + } + } + }, + + /** + * Listens to the "execute" event to fit document to width. + * + * @param e {qx.event.type.Execute} execute event + */ + _onFitWidthButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + flash.getFlashElement().TSetProperty("/", 8, this.getChildControl("scroll-pane").getPaneSize().width); + } + }, + + /** + * Listens to the "execute" event to fit document to whole page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onFitPageButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + flash.getFlashElement().TSetProperty("/", 9, this.getChildControl("scroll-pane").getPaneSize().height); + } + }, + + /** + * Listens to the "execute" event to change to full screen mode. + * + * @param e {qx.event.type.Execute} execute event + */ + _onFullScreenButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + if(flashFE.showFullScreen) + { + flashFE.showFullScreen(); + } + else + { + this.notSupported(); + } + } + }, + + /** + * Listens to the "execute" event to change to zoom in page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onZoomInButtonClick : function(e) + { + this.zoom(100 - this.getZoomFraction()); + }, + + /** + * Listens to the "execute" event to change to zoom page in or out. + * + * @param e {qx.event.type.Execute} execute event + */ + _onZoomChangeValue : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + // Relative change in percent: 50% -> doubles the size, 200% -> halfs the size + flash.getFlashElement().Zoom(e.getData()); + } + }, + + /** + * Listens to the "execute" event to change to zoom out page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onZoomOutButtonClick : function(e) + { + this.zoom(100 + this.getZoomFraction()); + }, + + /** + * Listens to the "execute" event to change to clockwise rotate page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onClockwiseButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + var rotation = flashFE.TGetPropertyAsNumber("/", 10); + + flashFE.TSetProperty("/", 10, rotation + 90); + } + }, + + /** + * Listens to the "execute" event to change to counter clockwise rotate page. + * + * @param e {qx.event.type.Execute} execute event + */ + _onCounterclockwiseButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + var rotation = flashFE.TGetPropertyAsNumber("/", 10); + + flashFE.TSetProperty("/", 10, rotation - 90); + } + }, + + /** + * Listens to the "execute" event to change to select pointer cursor. + * + * @param e {qx.event.type.Execute} execute event + */ + _onPointerSelectionToolButtonClick : function(e) + { + this.getChildControl("scroll-pane").setCursor("default"); + }, + + /** + * Listens to the "execute" event to change to select text selection cursor. + * + * @param e {qx.event.type.Execute} execute event + */ + _onTextSelectionToolButtonClick : function(e) + { + this.getChildControl("scroll-pane").setCursor("text"); + + this.notSupported("text selection tool"); + }, + + /** + * Listens to the "execute" event to change to select hand tool cursor. + * + * @param e {qx.event.type.Execute} execute event + */ + _onHandToolButtonClick : function(e) + { + this.getChildControl("scroll-pane").setCursor("pointer"); + }, + + /** + * Listens to the "execute" event to change to search within document. + * + * @param e {qx.event.type.Execute} execute event + */ + _onSearchButtonClick : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + if(flashFE.search != null) + { + flashFE.search(); + } + else + { + this.notSupported(); + } + } + }, + + + + _onTimeout : function(e) + { + if (qx.core.Environment.get("qx.debug")) + { + this.debug("Flash has timed out."); + } + +// this.getChildControl("initiator").terminate(); + }, + + _onLoaded : function(e) + { + if (qx.core.Environment.get("qx.debug")) + { + this.debug("Flash has been loaded."); + } + + var flash = this.getChildControl("flash"); + var flashFE = flash.getFlashElement(); + + // Set height and width so we get scrollbars + var width = flashFE.TGetPropertyAsNumber("/", 8); + var height = flashFE.TGetPropertyAsNumber("/", 9); +this.debug(width + " " + height); + flash.setWidth(width); + flash.setHeight(height); + + var xScale = flashFE.TGetPropertyAsNumber("/", 2); + var yScale = flashFE.TGetPropertyAsNumber("/", 3); + + this.getChildControl("zoom-page-field").setValue("" + ((xScale + yScale)/2)); + + var currentFrame = flashFE.TGetPropertyAsNumber("/", 4); + var totalFrames = flashFE.TGetPropertyAsNumber("/", 5); + + this.getChildControl("page-control").setValue("" + currentFrame); + this.getChildControl("num-pages-field").setValue("" + totalFrames); + + this.enableAll(); + + this.setScrolledAll(false); + +// this.getChildControl("initiator").terminate(); + }, + + _onScrollY : function(e) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + // Secures that the subscriber scrolls all pages and all lines of the document displayed. + var flashFE = flash.getFlashElement(); + var currentFrame = flashFE.TGetPropertyAsNumber("/", 4); + var totalFrames = flashFE.TGetPropertyAsNumber("/", 5); + + var pane = this.getChildControl("scroll-pane").getChildControl("pane"); + + if(currentFrame == totalFrames && pane.getScrollY() == pane.getScrollMaxY()) + { + this.setScrolledAll(true); + } +// // If 0% zoom then no panning and everything is contained within the scroll area else this: +// alert(flashFE.TGetPropertyAsNumber("/", 1)); + } + }, + + _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.gotoStart(); + 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.gotoEnd(); + 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; + + case "Left": + this.getChildControl("scroll-pane").scrollByX(-1); + break; + + case "Ctrl-Left": + this.scrollLeft(); + break; + + case "Right": + this.getChildControl("scroll-pane").scrollByX(1); + break; + + case "Ctrl-Right": + this.scrollRight(); + break; + } + }, + + /** + * @todo Show user dialog with error message. Negative is that it will be bound to another class. + */ + notSupported : function() + { + var msg = "The " + arguments.callee.caller.name + " function can not be called or is not supported for the flash file."; + this.debug(msg); + }, + + + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + zoom : function(zoomValue) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + // Relative change in percent: 50% -> doubles the size, 200% -> halfs the size + var zoomValue = 100 + this.getZoomFraction(); + flashFE.Zoom(zoomValue); + + this.getChildControl("zoom-page-field").setValue("" + zoomValue); + } + }, + + /** + * 1. go to top of current page + * 2. go to top of first page + */ + gotoPageTop : function() + { + var flashS = this.getChildControl("scroll-pane"); + + if(flashS.getScrollY() == 0) + { + this.gotoPage(0); + } + + flashS.scrollToY(0); + }, + + /** + * 1. go to bottom of current page + * 2. go to bottom of last page + */ + gotoPageBottom : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashS = this.getChildControl("scroll-pane"); + var scrollMaxY = flashS.getChildControl("pane").getScrollMaxY(); + + if(flashS.getScrollY() == scrollMaxY) + { + var totalFrames = flash.getFlashElement().TGetPropertyAsNumber("/", 5); + + this.gotoPage(totalFrames); + } + + flashS.scrollToY(scrollMaxY); + } + }, + + gotoEnd : function() + { + this.gotoPage(this.getChildControl("flash").getFlashElement().TGetPropertyAsNumber("/", 5)); + + var flashS = this.getChildControl("scroll-pane"); + flashS.scrollToY(flashS.getChildControl("pane").getScrollMaxY()); + }, + + goUp : function() + { + var flashS = this.getChildControl("scroll-pane"); + + if(flashS.getScrollY() == 0) + { + this.gotoRelativePage(-1); + + flashS.scrollToY(flashS.getChildControl("pane").getScrollMaxY()); + } + else + { + flashS.scrollByY(-1); + } + }, + + goDown : function() + { + var flashS = this.getChildControl("scroll-pane"); + + if(flashS.getScrollY() == flashS.getChildControl("pane").getScrollMaxY()) + { + this.gotoRelativePage(1); + + flashS.scrollToY(0); + } + else + { + flashS.scrollByY(1); + } + }, + + /** + * + * fieldChange to prevent reentrance to the textfield of current page + * + */ + gotoRelativePage : function(relativeFrame, fieldChange) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var currentFrame = flash.getFlashElement().TGetPropertyAsNumber("/", 4); + + this.gotoPage(currentFrame + relativeFrame, fieldChange); + } + }, + + /** + * Go to page in the document. + * + * @param value {Number} page number + * + * fieldChange to prevent reentrance to the textfield of current page + */ + gotoPage : function(absoluteFrame, fieldChange) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var totalFrames = this.getTotalPages(); + + if(absoluteFrame > 0 && absoluteFrame <= totalFrames) + { + var flashFE = flash.getFlashElement(); + var framesLoaded = flashFE.TGetPropertyAsNumber("/", 12); + + if(absoluteFrame <= framesLoaded) + { + flashFE.GotoFrame(absoluteFrame - 1) + +// this._setLocationButtons(); + + if(typeof(fieldChange) === "undefined" || fieldChange) + { + this.getChildControl("page-control").setValue("" + absoluteFrame); + } + } + else + { + this.debug("Page " + (absoluteFrame + 1) + " has not been loaded yet."); + } + } + else + { + this.debug("Page " + (absoluteFrame + 1) + " is outside page range."); + } + } + }, + + goPageUp : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashS = this.getChildControl("scroll-pane"); + var yPosition = flashS.getScrollY(); + + if(yPosition > 0) + { + var calcPosition = yPosition - flashS.getPaneSize().height; + var newPosition = calcPosition < 0 ? 0 : calcPosition; + + flashS.scrollToY(newPosition); + } + else + { + if(flash.getFlashElement().TGetPropertyAsNumber("/", 4) > 1) + { + this.gotoRelativePage(-1); + flashS.scrollToY(flashS.getChildControl("pane").getScrollMaxY()); + } + } + } + }, + + goPageDown : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashS = this.getChildControl("scroll-pane"); + var yPosition = flashS.getScrollY(); + var maxPosition = flashS.getChildControl("pane").getScrollMaxY(); + + if(yPosition < maxPosition) + { + var calcPosition = yPosition + flashS.getPaneSize().height; + var newPosition = calcPosition > maxPosition ? maxPosition : calcPosition; + + flashS.scrollToY(newPosition); + } + else + { + var flashFE = flash.getFlashElement(); + + if(flashFE.TGetPropertyAsNumber("/", 4) < flashFE.TGetPropertyAsNumber("/", 5)) + { + this.gotoRelativePage(1); + flashS.scrollToY(0); + } + } + } + }, + + scrollLeft : function() + { + var flashS = this.getChildControl("scroll-pane"); + var xPosition = flashS.getScrollX(); + + if(xPosition > 0) + { + var calcPosition = xPosition - flashS.getPaneSize().width; + var newPosition = calcPosition < 0 ? 0 : calcPosition; + + flashS.scrollToX(newPosition); + } + }, + + scrollRight : function() + { + var flashS = this.getChildControl("scroll-pane"); + var xPosition = flashS.getScrollX(); + + if(xPosition < flashS.getChildControl("pane").getScrollMaxX()) + { + var calcPosition = xPosition + flashS.getPaneSize().width; + var newPosition = calcPosition < 0 ? 0 : calcPosition; + + flashS.scrollToX(newPosition); + } + }, + + enableAll : function() + { + this.getChildControl("print-button").setEnabled(true); + this.getChildControl("fit-pane").setEnabled(true); + this.getChildControl("zoom-pane").setEnabled(true); + this.getChildControl("orientation-pane").setEnabled(true); + this.getChildControl("location-pane").setEnabled(true); + this.getChildControl("tool-pane").setEnabled(true); + this.getChildControl("search-pane").setEnabled(true); + }, + + /* + --------------------------------------------------------------------------- + FLASH JAVASCRIPT METHODS + --------------------------------------------------------------------------- + */ + + getSource : function() + { + return this.getChildControl("flash").getSource(); + }, + + setSource : function(source) + { +// this.getChildControl("initiator"); + + // If not created, create it now. + var flash = this.getChildControl("flash"); + + flash.setSource(source); + flash.addListenerOnce("loaded", this._onLoaded, this); + flash.addListenerOnce("timeout", this._onTimeout, this); + + // Add after source has been set. Can not change source after adding to the DOM tree. + var flashS = this.getChildControl("scroll-pane"); + var children = flashS.getChildren(); + + if(children.length) + { + flashS.remove(children[0]); + } + + flashS.add(flash); + }, + + setParam : function(param) + { + this.getChildControl("flash").getContentElement().setParam(param); + }, + + setVariables : function(variables) + { + this.getChildControl("flash").setVariables(variables); + }, +/* + _setLocationButtons : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var flashFE = flash.getFlashElement(); + + var currentFrame = flashFE.TGetPropertyAsNumber("/", 4); + var totalFrames = flashFE.TGetPropertyAsNumber("/", 5); + + if(totalFrames > 0) + { + this.getChildControl("previous-page-button").setEnabled(currentFrame > 1); + this.getChildControl("next-page-button").setEnabled(currentFrame < totalFrames); + } + else + { + this.getChildControl("location-pane").setEnabled(false); + } + } + }, +*/ + + /* + * Get the current page of the document. + * + * As TotalFrames is called differently in different browsers (see below), + * we use the TGetProperty instead. It is the same for any browser. + * + * @return {Number} current page + */ + getCurrentPage : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + return flash.getFlashElement().TGetPropertyAsNumber("/", 4); + } + }, + + /* + * Get the total number of pages of the document. + * + * var flashFE = this.getChildControl("flash").getFlashElement(); + * + * In IE it has to be called like this: + * + * TotalFrames = flashFE.TotalFrames; + * + * in Firefox it has to be called like this: + * + * TotalFrames = flashFE.TotalFrames(); + * + * http://www.macromedia.com/support/flash/ts/documents/activex_script.htm + * + * Note! + * Instead we use the TGetProperty which is the same for any browser. + * + * @return {Number} total number of pages + */ + getTotalPages : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + return flash.getFlashElement().TGetPropertyAsNumber("/", 5); + } + }, + + /* + * twips = 1440 units per inch, 72 points per inch -> x20 = twips + */ + zoomRectangle : function(left, top, right, bottom) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + var pointsToTwips = 20; + + flash.getFlashElement().SetZoomRect(left * pointsToTwips, top * pointsToTwips, right * pointsToTwips, bottom * pointsToTwips); + } + }, + + panPage : function(x, y, mode) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + flash.getFlashElement().Pan(x, y, mode) + } + }, + + sendToFlash : function(data) + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + flash.getFlashElement().SetVariable('/:message', data); + } + }, + + getFromFlash : function() + { + var flash = this.getChildControl("flash"); + + if(flash.isLoaded()) + { + return flash.getFlashElement().GetVariable('/:message'); + } + }, + + collectStatistics : function() + { +/* +Statistics +---------- +1. type of request i.e. new page +2. document name +3. date +4. time +5. pages read +6. viewing time per page +7. paging between pages +8. zoom levels +9. who requested the documents +10. referring web page +11. we browser +12. downloads +13. custom values +*/ + }, + + getFlashElement : function() + { + return this.getChildControl("flash").getFlashElement(); + }, + + getCurrentPage : function() + { + }, + + getNumPages : function() + { + } + } +}); + +/* + invokeFlashMethod : qx.core.Environment.select("engine.name", + { + "mshtml" : function(methodName, args) + { + var new_args = Array.prototype.slice.apply(arguments); + new_args.splice(0, 1); + +// var xmlArgs = window.self.__flash__argumentsToXML(new_args, 0); + + var xml = '<invoke name=\"'; + xml += methodName; + xml += '\" returntype=\"javascript\">'; + xml += "<arguments><string>" + + new_args[0] + + "</string>" + + "<string>" + + new_args[1] + + "</string>" + + "<string>" + + new_args[2] + + "</string></arguments>"; + xml += '</invoke>'; + + var result = null; + + var flashFE = this.getChildControl("flash").getFlashElement(); + + var funcRes = flashFE.callFunction(xml); + + if (funcRes != null && typeof(funcRes) != "undefined") + { + result = eval(funcRes); + } + + return result; + }, + + "default" : function(methodName, args) + { + var new_args = Array.prototype.slice.apply(arguments); + new_args.splice(0, 1); + + var flashFE = this.getChildControl("flash").getFlashElement(); + + var result = flashFE[methodName].apply(flashFE, new_args); + + return result; + } + }), +*/ + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js 2011-12-05 22:18:49 UTC (rev 21629) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/IPageControl.js 2011-12-06 11:58:24 UTC (rev 21630) @@ -33,7 +33,7 @@ USER API --------------------------------------------------------------------------- */ - +/* gotoFirstPage : function() { }, @@ -47,20 +47,20 @@ { this.gotoRelativePage(1); }, - +*/ /** * 1. go to top of current page * 2. go to top of first page */ - gotoPageTop : function() +/* gotoPageTop : function() { }, - +*/ /** * 1. go to bottom of current page * 2. go to bottom of last page */ - gotoPageBottom : function() +/* gotoPageBottom : function() { }, @@ -75,25 +75,26 @@ goDown : function() { }, - +*/ /** * * fieldChange to prevent reentrance to the textfield of current page * */ - gotoRelativePage : function(relativeFrame, fieldChange) +/* gotoRelativePage : function(relativeFrame, fieldChange) { }, - +*/ /** + * Go to page in the document. * - * fieldChange to prevent reentrance to the textfield of current page - * + * @param num {Number} page number */ - gotoPage : function(absoluteFrame, fieldChange) + gotoPage : function(num) { + this.assertInteger(num); }, - +/* goPageUp : function() { }, @@ -101,19 +102,22 @@ goPageDown : function() { }, - - /* - * +*/ + /** + * Get the current page of the document. + * + * @return {Number} current page */ getCurrentPage : function() { }, - /* + /** + * Get the total number of pages of the document. * - * + * @return {Number} total number of pages */ - getNumPages : function() + getTotalPages : function() { } } 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-12-05 22:18:49 UTC (rev 21629) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-12-06 11:58:24 UTC (rev 21630) @@ -38,7 +38,11 @@ qx.Class.define("qxe.ui.control.PageControl", { extend : qx.ui.core.Widget, +// implement : [ +// qxe.ui.control.IPageControl +// ], + /* ***************************************************************************** CONSTRUCTOR @@ -155,7 +159,7 @@ if(this.__pageContainer) { - control.setValue(this.__pageContainer.getNumPages()); + control.setValue(this.__pageContainer.getTotalPages()); } break; @@ -220,7 +224,7 @@ var newPage = e.getData(); var pageContainer = this.__pageContainer; - if(newPage >= 1 && newPage <= pageContainer.getNumPages() && newPage != pageContainer.getCurrentPage()) + if(newPage >= 1 && newPage <= pageContainer.getTotalPages() && newPage != pageContainer.getCurrentPage()) { pageContainer.gotoPage(newPage); this.checkEnable(); @@ -236,7 +240,7 @@ { var pageContainer = this.__pageContainer; - if(pageContainer.getCurrentPage() < pageContainer.getNumPages()) + if(pageContainer.getCurrentPage() < pageContainer.getTotalPages()) { pageContainer.gotoRelativePage(1); } @@ -252,7 +256,7 @@ _onLastPageButtonClick : function(e) { var pageContainer = this.__pageContainer; - pageContainer.gotoPage(pageContainer.getNumPages()); + pageContainer.gotoPage(pageContainer.getTotalPages()); this.checkEnable(); }, @@ -283,7 +287,7 @@ this.getChildControl("previous-page-button").setEnabled(true); } - if(currentPage == pageContainer.getNumPages()) + if(currentPage == pageContainer.getTotalPages()) { this.getChildControl("last-page-button").setEnabled(false); this.getChildControl("next-page-button").setEnabled(false); @@ -293,6 +297,16 @@ this.getChildControl("last-page-button").setEnabled(true); this.getChildControl("next-page-button").setEnabled(true); } + }, + + /** + * Go to page in the document. + * + * @param value {Number} page number + */ + setValue : function(value) + { + this.getChildControl("current-page-field").setValue("" + value) } } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-12-05 22:18:59
|
Revision: 21629 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21629&view=rev Author: sandersson Date: 2011-12-05 22:18:49 +0000 (Mon, 05 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/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/classic/Color.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Color.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Decoration.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/demo/qooxdoo.pdf trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/demo/qooxdoo.swf trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/translation/readme.txt trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/ trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/fitpage.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/fitwidth.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/fullscreen.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/grab.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/grabbing.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/handtool.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/pointer.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/textselect.gif trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/control/documentviewer/thumbnails.gif Added: trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/Manifest.json 2011-12-05 22:18:49 UTC (rev 21629) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe DocumentViewer 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/DocumentViewer/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/config.json 2011-12-05 22:18:49 UTC (rev 21629) @@ -0,0 +1,66 @@ +{ + "name" : "qxe DocumentViewer 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", + "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/DocumentViewer/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/generate.py 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/Application.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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 DocumentViewer" + */ +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 documentViewer = new qxe.ui.control.DocumentViewer("qxe/demo/qooxdoo.swf"); + + doc.add(documentViewer, {left: 50, top: 50}); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/simulation/DemoSimulation.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/test/DemoTest.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Appearance.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Color.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Decoration.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Font.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/class/qxe/demo/theme/Theme.js 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/index.html 2011-12-05 22:18:49 UTC (rev 21629) @@ -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/DocumentViewer/source/resource/qxe/demo/qooxdoo.pdf =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/demo/qooxdoo.pdf (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DocumentViewer/source/resource/qxe/demo/qooxdoo.pdf 2011-12-05 22:18:49 UTC (rev 21629) @@ -0,0 +1,102072 @@ +%PDF-1.4 +%\xD0\xD4\xC5\xD8 +5 0 obj +<< /S /GoTo /D (chapter.1) >> +endobj +8 0 obj +(Introduction) +endobj +9 0 obj +<< /S /GoTo /D (section.1.1) >> +endobj +12 0 obj +(About) +endobj +13 0 obj +<< /S /GoTo /D (section.1.2) >> +endobj +16 0 obj +(Framework) +endobj +17 0 obj +<< /S /GoTo /D (section.1.3) >> +endobj +20 0 obj +(GUI Toolkit) +endobj +21 0 obj +<< /S /GoTo /D (section.1.4) >> +endobj +24 0 obj +(AJAX) +endobj +25 0 obj +<< /S /GoTo /D (section.1.5) >> +endobj +28 0 obj +(More Information \(online\)) +endobj +29 0 obj +<< /S /GoTo /D (chapter.2) >> +endobj +32 0 obj +(Getting Started) +endobj +33 0 obj +<< /S /GoTo /D (section.2.1) >> +endobj +36 0 obj +(Requirements) +endobj +37 0 obj +<< /S /GoTo /D (subsection.2.1.1) >> +endobj +40 0 obj +(Client) +endobj +41 0 obj +<< /S /GoTo /D (subsection.2.1.2) >> +endobj +44 0 obj +(Server) +endobj +45 0 obj +<< /S /GoTo /D (subsection.2.1.3) >> +endobj +48 0 obj +(Tools) +endobj +49 0 obj +<< /S /GoTo /D (section.2.2) >> +endobj +52 0 obj +(Hello World) +endobj +53 0 obj +<< /S /GoTo /D (subsection.2.2.1) >> +endobj +56 0 obj +(Setup the Framework) +endobj +57 0 obj +<< /S /GoTo /D (subsection.2.2.2) >> +endobj +60 0 obj +(Create your Application) +endobj +61 0 obj +<< /S /GoTo /D (subsection.2.2.3) >> +endobj +64 0 obj +(Run your Application) +endobj +65 0 obj +<< /S /GoTo /D (subsection.2.2.4) >> +endobj +68 0 obj +(Write Application Code) +endobj +69 0 obj +<< /S /GoTo /D (subsection.2.2.5) >> +endobj +72 0 obj +(Debugging) +endobj +73 0 obj +<< /S /GoTo /D (subsection.2.2.6) >> +endobj +76 0 obj +(Deployment) +endobj +77 0 obj +<< /S /GoTo /D (subsection.2.2.7) >> +endobj +80 0 obj +(API Reference) +endobj +81 0 obj +<< /S /GoTo /D (subsection.2.2.8) >> +endobj +84 0 obj +(Unit Testing) +endobj +85 0 obj +<< /S /GoTo /D (section.2.3) >> +endobj +88 0 obj +(Troubleshooting) +endobj +89 0 obj +<< /S /GoTo /D (subsection.2.3.1) >> +endobj +92 0 obj +(Python Installation) +endobj +93 0 obj +<< /S /GoTo /D (section.2.4) >> +endobj +96 0 obj +(Tutorials) +endobj +97 0 obj +<< /S /GoTo /D (subsection.2.4.1) >> +endobj +100 0 obj +(Rich Internet Applications \(RIA\)) +endobj +101 0 obj +<< /S /GoTo /D (subsection.2.4.2) >> +endobj +104 0 obj +(Mobile Apps) +endobj +105 0 obj +<< /S /GoTo /D (subsection.2.4.3) >> +endobj +108 0 obj +(Tooling) +endobj +109 0 obj +<< /S /GoTo /D (subsection.2.4.4) >> +endobj +112 0 obj +(Video Tutorials) +endobj +113 0 obj +<< /S /GoTo /D (section.2.5) >> +endobj +116 0 obj +(SDK) +endobj +117 0 obj +<< /S /GoTo /D (subsection.2.5.1) >> +endobj +120 0 obj +(Introduction to the SDK) +endobj +121 0 obj +<< /S /GoTo /D (subsection.2.5.2) >> +endobj +124 0 obj +(Framework Structure) +endobj +125 0 obj +<< /S /GoTo /D (subsection.2.5.3) >> +endobj +128 0 obj +(Application Structure) +endobj +129 0 obj +<< /S /GoTo /D (subsection.2.5.4) >> +endobj +132 0 obj +(Manifest.json) +endobj +133 0 obj +<< /S /GoTo /D (subsection.2.5.5) >> +endobj +136 0 obj +(Code Structure) +endobj +137 0 obj +<< /S /GoTo /D (subsection.2.5.6) >> +endobj +140 0 obj +(Architecture) +endobj +141 0 obj +<< /S /GoTo /D (subsection.2.5.7) >> +endobj +144 0 obj +(Tools beyond the Python SDK) +endobj +145 0 obj +<< /S /GoTo /D (chapter.3) >> +endobj +148 0 obj +(Core Framework) +endobj +149 0 obj +<< /S /GoTo /D (section.3.1) >> +endobj +152 0 obj +(Object Orientation) +endobj +153 0 obj +<< /S /GoTo /D (subsection.3.1.1) >> +endobj +156 0 obj +(Introduction to Object Orientation) +endobj +157 0 obj +<< /S /GoTo /D (subsection.3.1.2) >> +endobj +160 0 obj +(Features of Object Orientation) +endobj +161 0 obj +<< /S /GoTo /D (subsection.3.1.3) >> +endobj +164 0 obj +(Classes) +endobj +165 0 obj +<< /S /GoTo /D (subsection.3.1.4) >> +endobj +168 0 obj +(Interfaces) +endobj +169 0 obj +<< /S /GoTo /D (subsection.3.1.5) >> +endobj +172 0 obj +(Mixins) +endobj +173 0 obj +<< /S /GoTo /D (section.3.2) >> +endobj +176 0 obj +(Properties) +endobj +177 0 obj +<< /S /GoTo /D (subsection.3.2.1) >> +endobj +180 0 obj +(Introduction to Properties) +endobj +181 0 obj +<< /S /GoTo /D (subsection.3.2.2) >> +endobj +184 0 obj +(Properties in more detail) +endobj +185 0 obj +<< /S /GoTo /D (subsection.3.2.3) >> +endobj +188 0 obj +(Initialization Behavior) +endobj +189 0 obj +<< /S /GoTo /D (subsection.3.2.4) >> +endobj +192 0 obj +(Property features summarized) +endobj +193 0 obj +<< /S /GoTo /D (section.3.3) >> +endobj +196 0 obj +(Environment) +endobj +197 0 obj +<< /S /GoTo /D (subsection.3.3.1) >> +endobj +200 0 obj +(Environment) +endobj +201 0 obj +<< /S /GoTo /D (section.3.4) >> +endobj +204 0 obj +(Data Binding) +endobj +205 0 obj +<< /S /GoTo /D (subsection.3.4.1) >> +endobj +208 0 obj +(Data Binding) +endobj +209 0 obj +<< /S /GoTo /D (chapter.4) >> +endobj +212 0 obj +(GUI Toolkit) +endobj +213 0 obj +<< /S /GoTo /D (section.4.1) >> +endobj +216 0 obj +(Overview) +endobj +217 0 obj +<< /S /GoTo /D (subsection.4.1.1) >> +endobj +220 0 obj +(Widgets) +endobj +221 0 obj +<< /S /GoTo /D (subsection.4.1.2) >> +endobj +224 0 obj +(Composites) +endobj +225 0 obj +<< /S /GoTo /D (subsection.4.1.3) >> +endobj +228 0 obj +(Roots) +endobj +229 0 obj +<< /S /GoTo /D (subsection.4.1.4) >> +endobj +232 0 obj +(Applications) +endobj +233 0 obj +<< /S /GoTo /D (section.4.2) >> +endobj +236 0 obj +(Widgets Introduction) +endobj +237 0 obj +<< /S /GoTo /D (subsection.4.2.1) >> +endobj +240 0 obj +(Widget) +endobj +241 0 obj +<< /S /GoTo /D (subsection.4.2.2) >> +endobj +244 0 obj +(Basic Widgets) +endobj +245 0 obj +<< /S /GoTo /D (subsection.4.2.3) >> +endobj +248 0 obj +(Interaction) +endobj +249 0 obj +<< /S /GoTo /D (subsection.4.2.4) >> +endobj +252 0 obj +(Resources) +endobj +253 0 obj +<< /S /GoTo /D (subsection.4.2.5) >> +endobj +256 0 obj +(Selection Handling) +endobj +257 0 obj +<< /S /GoTo /D (subsection.4.2.6) >> +endobj +260 0 obj +(Drag \046 Drop) +endobj +261 0 obj +<< /S /GoTo /D (subsection.4.2.7) >> +endobj +264 0 obj +(Inline Widgets) +endobj +265 0 obj +<< /S /GoTo /D (subsection.4.2.8) >> +endobj +268 0 obj +(Custom Widgets) +endobj +269 0 obj +<< /S /GoTo /D (subsection.4.2.9) >> +endobj +272 0 obj +(Form Handling) +endobj +273 0 obj +<< /S /GoTo /D (subsection.4.2.10) >> +endobj +276 0 obj +(Menu Handling) +endobj +277 0 obj +<< /S /GoTo /D (subsection.4.2.11) >> +endobj +280 0 obj +(Window Management) +endobj +281 0 obj +<< /S /GoTo /D (subsection.4.2.12) >> +endobj +284 0 obj +(HTML Editing) +endobj +285 0 obj +<< /S /GoTo /D (subsection.4.2.13) >> +endobj +288 0 obj +(Table Styling) +endobj +289 0 obj +<< /S /GoTo /D (subsection.4.2.14) >> +endobj +292 0 obj +(Widget Reference) +endobj +293 0 obj +<< /S /GoTo /D (section.4.3) >> +endobj +296 0 obj +(Layouts) +endobj +297 0 obj +<< /S /GoTo /D (subsection.4.3.1) >> +endobj +300 0 obj +(Layouting) +endobj +301 0 obj +<< /S /GoTo /D (section.4.4) >> +endobj +304 0 obj +(Themes) +endobj +305 0 obj +<< /S /GoTo /D (subsection.4.4.1) >> +endobj +308 0 obj +(Theming) +endobj +309 0 obj +<< /S /GoTo /D (subsection.4.4.2) >> +endobj +312 0 obj +(Appearance) +endobj +313 0 obj +<< /S /GoTo /D (subsection.4.4.3) >> +endobj +316 0 obj +(Custom Themes) +endobj +317 0 obj +<< /S /GoTo /D (subsection.4.4.4) >> +endobj +320 0 obj +(Decorators) +endobj +321 0 obj +<< /S /GoTo /D (subsection.4.4.5) >> +endobj +324 0 obj +(Web Fonts) +endobj +325 0 obj +<< /S /GoTo /D (subsection.4.4.6) >> +endobj +328 0 obj +(Using themes of contributions in your application) +endobj +329 0 obj +<< /S /GoTo /D (chapter.5) >> +endobj +332 0 obj +(Low Level Framework) +endobj +333 0 obj +<< /S /GoTo /D (section.5.1) >> +endobj +336 0 obj +(General) +endobj +337 0 obj +<< /S /GoTo /D (subsection.5.1.1) >> +endobj +340 0 obj +(Overview) +endobj +341 0 obj +<< /S /GoTo /D (subsection.5.1.2) >> +endobj +344 0 obj +(Scenarios) +endobj +345 0 obj +<< /S /GoTo /D (section.5.2) >> +endobj +348 0 obj +(Tutorials) +endobj +349 0 obj +<< /S /GoTo /D (subsection.5.2.1) >> +endobj +352 0 obj +(Setting up a low-level library) +endobj +353 0 obj +<< /S /GoTo /D (subsection.5.2.2) >> +endobj +356 0 obj +(Low-Level APIs) +endobj +357 0 obj +<< /S /GoTo /D (subsection.5.2.3) >> +endobj +360 0 obj +(Back-Button and Bookmark Support) +endobj +361 0 obj +<< /S /GoTo /D (subsection.5.2.4) >> +endobj +364 0 obj +(Low-level tutorial for web developers) +endobj +365 0 obj +<< /S /GoTo /D (section.5.3) >> +endobj +368 0 obj +(Technical Topics) +endobj +369 0 obj +<< /S /GoTo /D (subsection.5.3.1) >> +endobj +372 0 obj +(HTML Element Handling) +endobj +373 0 obj +<< /S /GoTo /D (subsection.5.3.2) >> +endobj +376 0 obj +(Image Handling) +endobj +377 0 obj +<< /S /GoTo /D (subsection.5.3.3) >> +endobj +380 0 obj +(The Event Layer) +endobj +381 0 obj +<< /S /GoTo /D (subsection.5.3.4) >> +endobj +384 0 obj +(The Focus Layer) +endobj +385 0 obj +<< /S /GoTo /D (subsection.5.3.5) >> +endobj +388 0 obj +(qooxdoo Animation) +endobj +389 0 obj +<< /S /GoTo /D (chapter.6) >> +endobj +392 0 obj +(Mobile Framework) +endobj +393 0 obj +<< /S /GoTo /D (section.6.1) >> +endobj +396 0 obj +(Introduction) +endobj +397 0 obj +<< /S /GoTo /D (subsection.6.1.1) >> +endobj +400 0 obj +(Overview) +endobj +401 0 obj +<< /S /GoTo /D (subsection.6.1.2) >> +endobj +404 0 obj +(Tutorial: Creating a Twitter Client with qooxdoo mobile) +endobj +405 0 obj +<< /S /GoTo /D (chapter.7) >> +endobj +408 0 obj +(Communication) +endobj +409 0 obj +<< /S /GoTo /D (section.7.1) >> +endobj +412 0 obj +(Low-level requests) +endobj +413 0 obj +<< /S /GoTo /D (section.7.2) >> +endobj +416 0 obj +(Higher-level requests) +endobj +417 0 obj +<< /S /GoTo /D (subsection.7.2.1) >> +endobj +420 0 obj +(Higher-level requests) +endobj +421 0 obj +<< /S /GoTo /D (subsection.7.2.2) >> +endobj +424 0 obj +(AJAX) +endobj +425 0 obj +<< /S /GoTo /D (section.7.3) >> +endobj +428 0 obj +(REST) +endobj +429 0 obj +<< /S /GoTo /D (subsection.7.3.1) >> +endobj +432 0 obj +(REST \(Representational State Transfer\)) +endobj +433 0 obj +<< /S /GoTo /D (section.7.4) >> +endobj +436 0 obj +(Remote Procedure Calls \(RPC\)) +endobj +437 0 obj +<< /S /GoTo /D (subsection.7.4.1) >> +endobj +440 0 obj +(RPC \(Remote Procedure Call\)) +endobj +441 0 obj +<< /S /GoTo /D (subsection.7.4.2) >> +endobj +444 0 obj +(RPC Servers) +endobj +445 0 obj +<< /S /GoTo /D (section.7.5) >> +endobj +448 0 obj +(Specific Widget Communication) +endobj +449 0 obj +<< /S /GoTo /D (subsection.7.5.1) >> +endobj +452 0 obj +(Using the remote table model) +endobj +453 0 obj +<< /S /GoTo /D (chapter.8) >> +endobj +456 0 obj +(Development) +endobj +457 0 obj +<< /S /GoTo /D (section.8.1) >> +endobj +460 0 obj +(Debugging) +endobj +461 0 obj +<< /S /GoTo /D (subsection.8.1.1) >> +endobj +464 0 obj +(Logging System) +endobj +465 0 obj +<< /S /GoTo /D (subsection.8.1.2) >> +endobj +468 0 obj +(Debugging Applications) +endobj +469 0 obj +<< /S /GoTo /D (section.8.2) >> +endobj +472 0 obj +(Performance) +endobj +473 0 obj +<< /S /GoTo /D (subsection.8.2.1) >> +endobj +476 0 obj +(Memory Management) +endobj +477 0 obj +<< /S /GoTo /D (subsection.8.2.2) >> +endobj +480 0 obj +(Profiling Applications) +endobj +481 0 obj +<< /S /GoTo /D (section.8.3) >> +endobj +484 0 obj +(Testing) +endobj +485 0 obj +<< /S /GoTo /D (subsection.8.3.1) >> +endobj +488 0 obj +(Unit Testing) +endobj +489 0 obj +<< /S /GoTo /D (subsection.8.3.2) >> +endobj +492 0 obj +(The qooxdoo Test Runner) +endobj +493 0 obj +<< /S /GoTo /D (subsection.8.3.3) >> +endobj +496 0 obj +(Framework Unit Testing) +endobj +497 0 obj +<< /S /GoTo /D (subsection.8.3.4) >> +endobj +500 0 obj +(Simulator) +endobj +501 0 obj +<< /S /GoTo /D (subsection.8.3.5) >> +endobj +504 0 obj +(Simulator: Locating elements) +endobj +505 0 obj +<< /S /GoTo /D (section.8.4) >> +endobj +508 0 obj +(Parts) +endobj +509 0 obj +<< /S /GoTo /D (subsection.8.4.1) >> +endobj +512 0 obj +(Parts and Packages Overview) +endobj +513 0 obj +<< /S /GoTo /D (subsection.8.4.2) >> +endobj +516 0 obj +(Using Parts) +endobj +517 0 obj +<< /S /GoTo /D (subsection.8.4.3) >> +endobj +520 0 obj +(Further Resources) +endobj +521 0 obj +<< /S /GoTo /D (section.8.5) >> +endobj +524 0 obj +(Internationalization) +endobj +525 0 obj +<< /S /GoTo /D (subsection.8.5.1) >> +endobj +528 0 obj +(Internationalization) +endobj +529 0 obj +<< /S /GoTo /D (section.8.6) >> +endobj +532 0 obj +(Miscellaneous) +endobj +533 0 obj +<< /S /GoTo /D (subsection.8.6.1) >> +endobj +536 0 obj +(Image clipping and combining) +endobj +537 0 obj +<< /S /GoTo /D (subsection.8.6.2) >> +endobj +540 0 obj +(Writing API Documentation) +endobj +541 0 obj +<< /S /GoTo /D (subsection.8.6.3) >> +endobj +544 0 obj +(Reporting Bugs) +endobj +545 0 obj +<< /S /GoTo /D (subsection.8.6.4) >> +endobj +548 0 obj +(An Aspect Template Class) +endobj +549 0 obj +<< /S /GoTo /D (subsection.8.6.5) >> +endobj +552 0 obj +(Internet Explorer specific settings) +endobj +553 0 obj +<< /S /GoTo /D (chapter.9) >> +endobj +556 0 obj +(Tooling) +endobj +557 0 obj +<< /S /GoTo /D (section.9.1) >> +endobj +560 0 obj +(Generator Introduction) +endobj +561 0 obj +<< /S /GoTo /D (subsection.9.1.1) >> +endobj +564 0 obj +(Generator Overview) +endobj +565 0 obj +<< /S /GoTo /D (subsection.9.1.2) >> +endobj +568 0 obj +(Generator Usage) +endobj +569 0 obj +<< /S /GoTo /D (subsection.9.1.3) >> +endobj +572 0 obj +(Generator Script Optimizations) +endobj +573 0 obj +<< /S /GoTo /D (section.9.2) >> +endobj +576 0 obj +(Generator Configuration) +endobj +577 0 obj +<< /S /GoTo /D (subsection.9.2.1) >> +endobj +580 0 obj +(Generator Configuration File) +endobj +581 0 obj +<< /S /GoTo /D (subsection.9.2.2) >> +endobj +584 0 obj +(Generator Configuration Articles) +endobj +585 0 obj +<< /S /GoTo /D (section.9.3) >> +endobj +588 0 obj +(Further Tools) +endobj +589 0 obj +<< /S /GoTo /D (subsection.9.3.1) >> +endobj +592 0 obj +(Source Code Validation) +endobj +593 0 obj +<< /S /GoTo /D (chapter.10) >> +endobj +596 0 obj +(Standard Applications) +endobj +597 0 obj +<< /S /GoTo /D (section.10.1) >> +endobj +600 0 obj +(Demo Applications) +endobj +601 0 obj +<< /S /GoTo /D (subsection.10.1.1) >> +endobj +604 0 obj +(Demobrowser) +endobj +605 0 obj +<< /S /GoTo /D (subsection.10.1.2) >> +endobj +608 0 obj +(Feedreader) +endobj +609 0 obj +<< /S /GoTo /D (subsection.10.1.3) >> +endobj +612 0 obj +(Playground) +endobj +613 0 obj +<< /S /GoTo /D (subsection.10.1.4) >> +endobj +616 0 obj +(Portal) +endobj +617 0 obj +<< /S /GoTo /D (subsection.10.1.5) >> +endobj +620 0 obj +(Showcase) +endobj +621 0 obj +<< /S /GoTo /D (subsection.10.1.6) >> +endobj +624 0 obj +(Widgetbrowser) +endobj +625 0 obj +<< /S /GoTo /D (section.10.2) >> +endobj +628 0 obj +(Developer Tools) +endobj +629 0 obj +<< /S /GoTo /D (subsection.10.2.1) >> +endobj +632 0 obj +(Apiviewer) +endobj +633 0 obj +<< /S /GoTo /D (subsection.10.2.2) >> +endobj +636 0 obj +(Testrunner) +endobj +637 0 obj +<< /S /GoTo /D (subsection.10.2.3) >> +endobj +640 0 obj +(Inspector) +endobj +641 0 obj +<< /S /GoTo /D (subsection.10.2.4) >> +endobj +644 0 obj +(Simulator) +endobj +645 0 obj +<< /S /GoTo /D (subsection.10.2.5) >> +endobj +648 0 obj +(Feature Configuration Editor) +endobj +649 0 obj +<< /S /GoTo /D (chapter.11) >> +endobj +652 0 obj +(Migration) +endobj +653 0 obj +<< /S /GoTo /D (section.11.1) >> +endobj +656 0 obj +(Migration Guide) +endobj +657 0 obj +<< /S /GoTo /D (chapter.12) >> +endobj +660 0 obj +(References) +endobj +661 0 obj +<< /S /GoTo /D (section.12.1) >> +endobj +664 0 obj +(Core) +endobj +665 0 obj +<< /S /GoTo /D (subsection.12.1.1) >> +endobj +668 0 obj +(Class Declaration Quick Ref) +endobj +669 0 obj +<< /S /GoTo /D (subsection.12.1.2) >> +endobj +672 0 obj +(Interfaces Quick Ref) +endobj +673 0 obj +<< /S /GoTo /D (subsection.12.1.3) >> +endobj +676 0 obj +(Mixin Quick Ref) +endobj +677 0 obj +<< /S /GoTo /D (subsection.12.1.4) >> +endobj +680 0 obj +(Properties Quick Reference) +endobj +681 0 obj +<< /S /GoTo /D (subsection.12.1.5) >> +endobj +684 0 obj +(Array Reference) +endobj +685 0 obj +<< /S /GoTo /D (subsection.12.1.6) >> +endobj +688 0 obj +(Framework Generator Jobs) +endobj +689 0 obj +<< /S /GoTo /D (section.12.2) >> +endobj +692 0 obj +(GUI Toolkit) +endobj +693 0 obj +<< /S /GoTo /D (subsection.12.2.1) >> +endobj +696 0 obj +(Widget Reference) +endobj +697 0 obj +<< /S /GoTo /D (subsection.12.2.2) >> +endobj +700 0 obj +(Layout Reference) +endobj +701 0 obj +<< /S /GoTo /D (section.12.3) >> +endobj +704 0 obj +(Tooling) +endobj +705 0 obj +<< /S /GoTo /D (subsection.12.3.1) >> +endobj +708 0 obj +(Default Generator Jobs) +endobj +709 0 obj +<< /S /GoTo /D (subsection.12.3.2) >> +endobj +712 0 obj +(Reference Listing of Config Keys) +endobj +713 0 obj +<< /S /GoTo /D (subsection.12.3.3) >> +endobj +716 0 obj +(Configuration Macro Reference) +endobj +717 0 obj +<< /S /GoTo /D (subsection.12.3.4) >> +endobj +720 0 obj +(Syntax Diagrams) +endobj +721 0 obj +<< /S /GoTo /D (subsection.12.3.5) >> +endobj +724 0 obj +(ASTlets - AST Fragments) +endobj +725 0 obj +<< /S /GoTo /D (section.12.4) >> +endobj +728 0 obj +(Glossary) +endobj +729 0 obj +<< /S /GoTo /D (subsection.12.4.1) >> +endobj +732 0 obj +(Glossary) +endobj +733 0 obj +<< /S /GoTo /D (section.12.5) >> +endobj +736 0 obj +(License) +endobj +737 0 obj +<< /S /GoTo /D (subsection.12.5.1) >> +endobj +740 0 obj +(qooxdoo License) +endobj +741 0 obj +<< /S /GoTo /D (section*.1361) >> +endobj +744 0 obj +(Index) +endobj +745 0 obj +<< /S /GoTo /D [746 0 R /Fit ] >> +endobj +748 0 obj << +/Length 272 +/Filter /FlateDecode +>> +stream +xڽP\xCBN\xC30\xBC\xE7+\xF6\x98Hd\xD9u\xFC\xBC"Ro\x94ܪ\xAA\xC6T\x88\xA4\xA1/\xCF&\xB5h\xEA\xC9\xF6\x8EW3\xE3Y\xAC\x80\xE0!\xA3TYN\xA7d,\xBB\x8CR\xE75#\x94\xF6v\xE7\xD7\xE9\xC9\xE1\xFFY\x9B\x9F\xD4e@m\xF5\x90{6'h\xA43z>FN\xDAz\xA9-<e\x8F\xA7w~M_\xCA\xF8e\x9A\xFF\xA6ή\xEF+J\xA3\xF3\x8E\xA1~\xE8\xD1S\xD6*T\xEC\xA0n`\x96o\xFA\xBE\xA8(\xFFl\xA4\x96\xCA\xF9\xFC\xB6_\xBA\xB8\xDE/\xF6/\xFD\xBA\x98\xD7\xB1q\xC0N$F6j + l\xF4\x92p\xB4\x99\xC66.v\xF1h\xC1h\x92ОKШ +J6\xB5\xE6\x9AX\xB0\xC9\xDFcۿ\xC5\xED |
From: <san...@us...> - 2011-12-03 20:25:56
|
Revision: 21628 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21628&view=rev Author: sandersson Date: 2011-12-03 20:25:49 +0000 (Sat, 03 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/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/theme/modern/Color.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Decoration.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js 2011-12-02 15:18:41 UTC (rev 21627) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js 2011-12-03 20:25:49 UTC (rev 21628) @@ -67,9 +67,383 @@ // Document is the application root var doc = this.getRoot(); - var webDesktop = new qxe.ui.webdesktop.WebDesktop(); + this.createCommands(); - doc.add(webDesktop, {left: 0, top: 0}); + var webDesktop = new qxe.ui.webdesktop.WebDesktop(this.createMenuBar(), this.createTaskBar(), this.createBackground()); + + doc.add(webDesktop, {edge: 0}); + }, + + createCommands : function() + { + this.__newCommand = new qx.ui.core.Command("Ctrl+N"); + this.__newCommand.addListener("execute", this.debugCommand); + + this.__openCommand = new qx.ui.core.Command("Ctrl+O"); + this.__openCommand.addListener("execute", this.debugCommand); + + this.__saveCommand = new qx.ui.core.Command("Ctrl+S"); + this.__saveCommand.addListener("execute", this.debugCommand); + }, + + debugRadio : function(e) { + this.debug("Change selection: " + e.getData()[0].getLabel()); + }, + + debugCommand : function(e) { + this.debug("Execute command: " + this.getShortcut()); + }, + + debugButton : function(e) { + this.debug("Execute button: " + this.getLabel()); + }, + + debugCheckBox : function(e) { + this.debug("Change checked: " + this.getLabel() + " = " + e.getData()); + }, + + createMenuBar : function() + { + var toolbar = new qx.ui.toolbar.ToolBar; +// toolbar.setWidth(600); + + var basicPart = new qx.ui.toolbar.Part; + var menuPart = new qx.ui.toolbar.Part; + var helpPart = new qx.ui.toolbar.Part; + + toolbar.add(basicPart); + toolbar.add(menuPart); + toolbar.addSpacer(); + toolbar.add(helpPart); + + var newButton = new qx.ui.toolbar.Button("New", "icon/16/actions/document-new.png", this.__newCommand); + var openButton = new qx.ui.toolbar.Button("Open", "icon/16/actions/document-open.png", this.__openCommand); + var saveButton = new qx.ui.toolbar.Button("Save", "icon/16/actions/document-save.png", this.__saveCommand); + + newButton.addListener("execute", this.debugButton); + openButton.addListener("execute", this.debugButton); + saveButton.addListener("execute", this.debugButton); + + basicPart.add(newButton); + basicPart.add(openButton); + basicPart.add(saveButton); + + basicPart.setShow("icon"); + + + var fileMenu = new qx.ui.toolbar.MenuButton("File"); + var editMenu = new qx.ui.toolbar.MenuButton("Edit"); + var searchMenu = new qx.ui.toolbar.MenuButton("Search"); + var viewMenu = new qx.ui.toolbar.MenuButton("View"); + var formatMenu = new qx.ui.toolbar.MenuButton("Format"); + + fileMenu.setMenu(this.getFileMenu()); + editMenu.setMenu(this.getEditMenu()); + searchMenu.setMenu(this.getSearchMenu()); + viewMenu.setMenu(this.getViewMenu()); + formatMenu.setMenu(this.getFormatMenu()); + + menuPart.add(fileMenu); + menuPart.add(editMenu); + menuPart.add(searchMenu); + menuPart.add(viewMenu); + menuPart.add(formatMenu); + + + var helpMenu = new qx.ui.toolbar.MenuButton("Help"); + helpMenu.setMenu(this.getHelpMenu()); + helpPart.add(helpMenu); + + return toolbar; + }, + + getFileMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var newButton = new qx.ui.menu.Button("New", "icon/16/actions/document-new.png", this.__newCommand); + var openButton = new qx.ui.menu.Button("Open", "icon/16/actions/document-open.png", this.__openCommand); + var closeButton = new qx.ui.menu.Button("Close"); + var saveButton = new qx.ui.menu.Button("Save", "icon/16/actions/document-save.png", this.__saveCommand); + var saveAsButton = new qx.ui.menu.Button("Save as...", "icon/16/actions/document-save-as.png"); + var printButton = new qx.ui.menu.Button("Print", "icon/16/actions/document-print.png"); + var exitButton = new qx.ui.menu.Button("Exit", "icon/16/actions/application-exit.png"); + + newButton.addListener("execute", this.debugButton); + openButton.addListener("execute", this.debugButton); + closeButton.addListener("execute", this.debugButton); + saveButton.addListener("execute", this.debugButton); + saveAsButton.addListener("execute", this.debugButton); + printButton.addListener("execute", this.debugButton); + exitButton.addListener("execute", this.debugButton); + + menu.add(newButton); + menu.add(openButton); + menu.add(closeButton); + menu.add(saveButton); + menu.add(saveAsButton); + menu.add(printButton); + menu.add(exitButton); + + return menu; + }, + + getEditMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var undoButton = new qx.ui.menu.Button("Undo", "icon/16/actions/edit-undo.png", this.__undoCommand); + var redoButton = new qx.ui.menu.Button("Redo", "icon/16/actions/edit-redo.png", this.__redoCommand); + var cutButton = new qx.ui.menu.Button("Cut", "icon/16/actions/edit-cut.png", this.__cutCommand); + var copyButton = new qx.ui.menu.Button("Copy", "icon/16/actions/edit-copy.png", this.__copyCommand); + var pasteButton = new qx.ui.menu.Button("Paste", "icon/16/actions/edit-paste.png", this.__pasteCommand); + + undoButton.addListener("execute", this.debugButton); + redoButton.addListener("execute", this.debugButton); + cutButton.addListener("execute", this.debugButton); + copyButton.addListener("execute", this.debugButton); + pasteButton.addListener("execute", this.debugButton); + + menu.add(undoButton); + menu.add(redoButton); + menu.addSeparator(); + menu.add(cutButton); + menu.add(copyButton); + menu.add(pasteButton); + + return menu; + }, + + getSearchMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var searchButton = new qx.ui.menu.Button("Search...", "icon/16/actions/system-search.png"); + var nextButton = new qx.ui.menu.Button("Search next..."); + var previousButton = new qx.ui.menu.Button("Search previous..."); + var replaceButton = new qx.ui.menu.Button("Replace"); + var searchFilesButton = new qx.ui.menu.Button("Search in files", "icon/16/actions/system-search.png"); + var replaceFilesButton = new qx.ui.menu.Button("Replace in files"); + + previousButton.setEnabled(false); + + searchButton.addListener("execute", this.debugButton); + nextButton.addListener("execute", this.debugButton); + previousButton.addListener("execute", this.debugButton); + replaceButton.addListener("execute", this.debugButton); + searchFilesButton.addListener("execute", this.debugButton); + replaceFilesButton.addListener("execute", this.debugButton); + + menu.add(searchButton); + menu.add(nextButton); + menu.add(previousButton); + menu.add(replaceButton); + menu.addSeparator(); + menu.add(searchFilesButton); + menu.add(replaceFilesButton); + + return menu; + }, + + getViewMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var panesButton = new qx.ui.menu.Button("Panes", null, null, this.getPanesMenu()); + var syntaxButton = new qx.ui.menu.Button("Syntax", null, null, this.getSyntaxMenu()); + var rulerButton = new qx.ui.menu.CheckBox("Show ruler"); + var numbersButton = new qx.ui.menu.CheckBox("Show line numbers"); + var asciiButton = new qx.ui.menu.Button("ASCII table"); + + rulerButton.addListener("changeValue", this.debugCheckBox); + numbersButton.addListener("changeValue", this.debugCheckBox); + asciiButton.addListener("execute", this.debugButton); + + menu.add(panesButton); + menu.add(syntaxButton); + menu.addSeparator(); + menu.add(rulerButton); + menu.add(numbersButton); + menu.addSeparator(); + menu.add(asciiButton); + + return menu; + }, + + getPanesMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var tabsCheckbox = new qx.ui.menu.CheckBox("Show tabs"); + var statusCheckbox = new qx.ui.menu.CheckBox("Show status bar"); + + var treeCheckbox = new qx.ui.menu.CheckBox("Show tree"); + var macroCheckbox = new qx.ui.menu.CheckBox("Show macros"); + var tagCheckbox = new qx.ui.menu.CheckBox("Show tags"); + var consoleCheckbox = new qx.ui.menu.CheckBox("Show console"); + + tabsCheckbox.setValue(true); + statusCheckbox.setValue(true); + macroCheckbox.setValue(true); + + tabsCheckbox.addListener("changeValue", this.debugCheckBox); + statusCheckbox.addListener("changeValue", this.debugCheckBox); + treeCheckbox.addListener("changeValue", this.debugCheckBox); + macroCheckbox.addListener("changeValue", this.debugCheckBox); + tagCheckbox.addListener("changeValue", this.debugCheckBox); + consoleCheckbox.addListener("changeValue", this.debugCheckBox); + + menu.add(statusCheckbox); + menu.add(tabsCheckbox); + menu.addSeparator(); + menu.add(treeCheckbox); + menu.add(macroCheckbox); + menu.add(tagCheckbox); + menu.add(consoleCheckbox); + + return menu; + }, + + getSyntaxMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var htmlButton = new qx.ui.menu.RadioButton("HTML"); + var xmlButton = new qx.ui.menu.RadioButton("XML"); + var jsButton = new qx.ui.menu.RadioButton("JavaScript"); + var cdialectButton = new qx.ui.menu.Button("C Dialect", null, null, this.getSyntaxCMenu()); + var perlButton = new qx.ui.menu.RadioButton("Perl"); + var pythonButton = new qx.ui.menu.RadioButton("Python"); + + menu.add(htmlButton); + menu.add(xmlButton); + menu.add(jsButton); + menu.add(cdialectButton); + menu.add(perlButton); + menu.add(pythonButton); + + // Configure and fill radio group + var langGroup = new qx.ui.form.RadioGroup; + langGroup.add(htmlButton, xmlButton, jsButton, perlButton, pythonButton); + langGroup.add.apply(langGroup, cdialectButton.getMenu().getChildren()); + + langGroup.addListener("changeSelection", this.debugRadio); + + return menu; + }, + + getSyntaxCMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var cButton = new qx.ui.menu.RadioButton("C"); + var csharpButton = new qx.ui.menu.RadioButton("C Sharp"); + var objcButton = new qx.ui.menu.RadioButton("Objective C"); + var cplusButton = new qx.ui.menu.RadioButton("C Plus Plus"); + + menu.add(cButton); + menu.add(csharpButton); + menu.add(objcButton); + menu.add(cplusButton); + + return menu; + }, + + getFormatMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var paragraphButton = new qx.ui.menu.Button("Paragraph", null, null, this.getParagraphMenu()); + var spacesButton = new qx.ui.menu.Button("Tabs to spaces"); + var tabsButton = new qx.ui.menu.Button("Spaces to tabs"); + var upperButton = new qx.ui.menu.Button("Uppercase"); + var lowerButton = new qx.ui.menu.Button("Lowercase"); + var capitalsButton = new qx.ui.menu.Button("Capitals"); + var ansiButton = new qx.ui.menu.Button("OEM to ANSI"); + var oemButton = new qx.ui.menu.Button("ANSI to OEM"); + + spacesButton.addListener("execute", this.debugButton); + tabsButton.addListener("execute", this.debugButton); + upperButton.addListener("execute", this.debugButton); + lowerButton.addListener("execute", this.debugButton); + capitalsButton.addListener("execute", this.debugButton); + ansiButton.addListener("execute", this.debugButton); + oemButton.addListener("execute", this.debugButton); + + menu.add(paragraphButton) + menu.add(spacesButton); + menu.add(tabsButton); + menu.addSeparator(); + menu.add(upperButton); + menu.add(lowerButton); + menu.add(capitalsButton); + menu.addSeparator(); + menu.add(ansiButton); + menu.add(oemButton); + + return menu; + }, + + getParagraphMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var leftButton = new qx.ui.menu.Button("Left aligned", "icon/16/actions/format-justify-left.png"); + var rightButton = new qx.ui.menu.Button("Right aligned", "icon/16/actions/format-justify-right.png"); + var centeredButton = new qx.ui.menu.Button("Centered", "icon/16/actions/format-justify-center.png"); + var justifyButton = new qx.ui.menu.Button("Justified", "icon/16/actions/format-justify-fill.png"); + + leftButton.addListener("execute", this.debugButton); + rightButton.addListener("execute", this.debugButton); + centeredButton.addListener("execute", this.debugButton); + justifyButton.addListener("execute", this.debugButton); + + menu.add(leftButton); + menu.add(rightButton); + menu.add(centeredButton); + menu.add(justifyButton); + + return menu; + }, + + getHelpMenu : function() + { + var menu = new qx.ui.menu.Menu; + + var topicsButton = new qx.ui.menu.Button("Topics", "icon/16/apps/utilities-help.png"); + var quickButton = new qx.ui.menu.Button("Quickstart"); + var onlineButton = new qx.ui.menu.Button("Online Forum"); + var infoButton = new qx.ui.menu.Button("Info..."); + + topicsButton.addListener("execute", this.debugButton); + quickButton.addListener("execute", this.debugButton); + onlineButton.addListener("execute", this.debugButton); + infoButton.addListener("execute", this.debugButton); + + menu.add(topicsButton); + menu.add(quickButton); + menu.addSeparator(); + menu.add(onlineButton); + menu.addSeparator(); + menu.add(infoButton); + + return menu; + }, + + createTaskBar : function() + { + return null; + }, + + createBackground : function() + { + var bg = new qx.ui.decoration.Background(); + bg.setBackgroundImage("qxe/demo/logo.gif"); + bg.setBackgroundColor("#134275"); + bg.setBackgroundRepeat("no-repeat"); + bg.setBackgroundPosition("center", "center"); + + return bg; } } }); 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-12-02 15:18:41 UTC (rev 21627) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-12-03 20:25:49 UTC (rev 21628) @@ -209,6 +209,28 @@ /* --------------------------------------------------------------------------- + WEBDESKTOP + --------------------------------------------------------------------------- + */ + + "webdesktop" : + { + style : function(states) + { + return { + decorator : "webdesktop" +//, +// allowGrowY : true, +// allowGrowX : true + }; + } + }, + + "webdesktop/desktop-pane" : "desktop", + "webdesktop/desktop-object" : "atom", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ 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-12-02 15:18:41 UTC (rev 21627) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-12-03 20:25:49 UTC (rev 21628) @@ -226,6 +226,28 @@ /* --------------------------------------------------------------------------- + WEBDESKTOP + --------------------------------------------------------------------------- + */ + + "webdesktop" : + { + style : function(states) + { + return { + decorator : "webdesktop" +//, +// allowGrowY : true, +// allowGrowX : true + }; + } + }, + + "webdesktop/desktop-pane" : "desktop", + "webdesktop/desktop-object" : "atom", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Color.js 2011-12-02 15:18:41 UTC (rev 21627) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Color.js 2011-12-03 20:25:49 UTC (rev 21628) @@ -21,5 +21,12 @@ colors : { + /* + --------------------------------------------------------------------------- + WEBDESKTOP + --------------------------------------------------------------------------- + */ + + "webdesktop-background" : "#DFDFDF" // "background-application" } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Decoration.js 2011-12-02 15:18:41 UTC (rev 21627) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Decoration.js 2011-12-03 20:25:49 UTC (rev 21628) @@ -63,6 +63,22 @@ style : { baseImage : "decoration/window/captionbar-inactive.png" } + }, + + /* + --------------------------------------------------------------------------- + WEBDESKTOP + --------------------------------------------------------------------------- + */ + + "webdesktop" : + { + decorator: qx.ui.decoration.Single, + + style : + { + backgroundColor : "webdesktop-background" + } } } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-12-02 15:18:49
|
Revision: 21627 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21627&view=rev Author: sandersson Date: 2011-12-02 15:18:41 +0000 (Fri, 02 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/translation/readme.txt trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/taskbar/ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/webdesktop/ Added: trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/Manifest.json 2011-12-02 15:18:41 UTC (rev 21627) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe WebDesktop 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/WebDesktop/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/config.json 2011-12-02 15:18:41 UTC (rev 21627) @@ -0,0 +1,66 @@ +{ + "name" : "qxe WebDesktop 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", + "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/WebDesktop/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/generate.py 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/Application.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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 WebDesktop" + */ +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 webDesktop = new qxe.ui.webdesktop.WebDesktop(); + + doc.add(webDesktop, {left: 0, top: 0}); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/simulation/DemoSimulation.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/test/DemoTest.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Appearance.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Color.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Decoration.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Font.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/class/qxe/demo/theme/Theme.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/index.html 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/WebDesktop/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/WebDesktop/source/translation/readme.txt 2011-12-02 15:18:41 UTC (rev 21627) @@ -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/ui/statusbar/StatusBar.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-12-01 13:08:12 UTC (rev 21626) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-12-02 15:18:41 UTC (rev 21627) @@ -68,6 +68,13 @@ } }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + members : { /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-12-01 13:08:23
|
Revision: 21626 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21626&view=rev Author: spackers Date: 2011-12-01 13:08:12 +0000 (Thu, 01 Dec 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-11-30 17:17:28 UTC (rev 21625) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-12-01 13:08:12 UTC (rev 21626) @@ -51,7 +51,7 @@ */ _doUpload: function(file) { var iframe = this._createIframe(file.getId()), - form = this._createForm(iframe, file.getId()); + form = this._createForm(iframe, file); form.appendChild(file.getBrowserObject()); @@ -156,7 +156,7 @@ * Creates form, that will be submitted to iframe * @return {DOMElement} the form */ - _createForm: function(iframe, id){ + _createForm: function(iframe, file){ // We can't use the following code in IE6 // var form = document.createElement('form'); // form.setAttribute('method', 'post'); @@ -168,7 +168,7 @@ action: this._getUploader().getUploadUrl(), method: "POST", target: iframe.name, - id: "upload-form-" + id + id: "upload-form-" + file.getId() }); qx.bom.element.Style.setStyles(form, { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-30 17:17:35
|
Revision: 21625 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21625&view=rev Author: sandersson Date: 2011-11-30 17:17:28 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 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-30 17:05:59 UTC (rev 21624) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-30 17:17:28 UTC (rev 21625) @@ -93,7 +93,7 @@ { var label = new qx.ui.basic.Label("Just a label"); - frame = new qxe.ui.window.Frame("Testing frame 1", "qxe/decoration/Modern/dialog/icon/16/information.png"); + frame = this.__frame1 = new qxe.ui.window.Frame("Testing frame 1", "qxe/decoration/Modern/dialog/icon/16/information.png"); frame.setLayout(new qx.ui.layout.Canvas()); frame.setHeight(100); frame.setWidth(100); @@ -112,7 +112,7 @@ var label = new qx.ui.basic.Label("Just a label"); var statusBar = new qxe.ui.statusbar.StatusBar(); - frame = new qxe.ui.window.Frame("Testing frame 2", "qxe/decoration/Modern/dialog/icon/16/information.png"); + frame = this.__frame2 = new qxe.ui.window.Frame("Testing frame 2", "qxe/decoration/Modern/dialog/icon/16/information.png"); frame.setLayout(new qx.ui.layout.Canvas()); frame.setHeight(100); frame.setWidth(100); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-30 17:06:06
|
Revision: 21624 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21624&view=rev Author: sandersson Date: 2011-11-30 17:05:59 +0000 (Wed, 30 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 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-30 14:00:41 UTC (rev 21623) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-30 17:05:59 UTC (rev 21624) @@ -18,6 +18,7 @@ /* ************************************************************************ #asset(qx/icon/${qx.icontheme}/16/apps/office-calendar.png) +#asset(qxe/decoration/Modern/dialog/icon/16/information.png) #asset(qxe/demo/*) 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-30 14:00:41 UTC (rev 21623) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-30 17:05:59 UTC (rev 21624) @@ -122,6 +122,7 @@ "frame/minimize-button" : "window/minimize-button", "frame/restore-button" : "window/restore-button", "frame/maximize-button" : "window/maximize-button", + "frame/statusbar/message" : "statusbar/message", /* --------------------------------------------------------------------------- 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-30 14:00:41 UTC (rev 21623) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-30 17:05:59 UTC (rev 21624) @@ -127,6 +127,7 @@ "frame/minimize-button" : "window/minimize-button", "frame/restore-button" : "window/restore-button", "frame/maximize-button" : "window/maximize-button", + "frame/statusbar/message" : "statusbar/message", /* --------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-30 14:00:47
|
Revision: 21623 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21623&view=rev Author: sandersson Date: 2011-11-30 14:00:41 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 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-30 08:02:14 UTC (rev 21622) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-11-30 14:00:41 UTC (rev 21623) @@ -70,7 +70,7 @@ this._createChildControl("statusbar"); // Update statusbar -// this._updateStatusBar(); + this._updateStatusBar(); }, @@ -201,7 +201,8 @@ check : "Boolean", init : false, apply : "_applyShowStatusbar" - }, + } +/*, statusBar : { @@ -210,6 +211,7 @@ event : "changeStatusBar", nullable : true } +*/ }, @@ -251,8 +253,7 @@ switch(id) { case "statusbar": - control = new qx.ui.container.Composite(new qx.ui.layout.HBox()); - control.add(this.getStatusBar(), {flex: 1}); + control = new qxe.ui.statusbar.StatusBar(); this._add(control); break; @@ -348,9 +349,7 @@ resizeFrame.removeState("showStatusbar"); } */ - var statusbar = this.getStatusBar(); - - if (statusbar) { + if (this.hasChildControl("statusbar")) { this._showChildControl("statusbar"); } else { this._excludeChildControl("statusbar"); @@ -431,14 +430,14 @@ this._excludeChildControl("statusbar"); } }, - +/* // property apply _applyStatusBarChange : function(value, old) { this._updateStatusBar(); }, +*/ - /* --------------------------------------------------------------------------- BASIC EVENT HANDLERS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_w...@us...> - 2011-11-30 08:02:20
|
Revision: 21622 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21622&view=rev Author: d_wagner Date: 2011-11-30 08:02:14 +0000 (Wed, 30 Nov 2011) Log Message: ----------- ignore the data.Github demo since it doesn't run in the demobrowser Modified Paths: -------------- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/demobrowser/test_demobrowser.js Modified: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/demobrowser/test_demobrowser.js =================================================================== --- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/demobrowser/test_demobrowser.js 2011-11-29 23:28:52 UTC (rev 21621) +++ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/demobrowser/test_demobrowser.js 2011-11-30 08:02:14 UTC (rev 21622) @@ -10,7 +10,7 @@ 'simulatorSvn' : '/home/dwagner/workspace/qooxdoo.contrib/Simulator', 'debug' : true, 'logAll' : false, - 'ignore' : 'showcase:Browser,widget:Iframe,test:Serialize,bom:Iframe,progressive:*', + 'ignore' : 'showcase:Browser,widget:Iframe,test:Serialize,bom:Iframe,progressive:*,data:Github', 'sampleGlobalErrorLogging' : false, 'shutdownSample' : false, 'reloadBrowser' : false, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 23:28:58
|
Revision: 21621 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21621&view=rev Author: sandersson Date: 2011-11-29 23:28:52 +0000 (Tue, 29 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/window/Frame.js 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-29 15:38:29 UTC (rev 21620) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-29 23:28:52 UTC (rev 21621) @@ -40,6 +40,9 @@ members : { + __frame1 : null, + __frame2 : null, + /** * This method contains the initial application code and gets called * during startup of the application @@ -69,27 +72,54 @@ // Document is the application root var doc = this.getRoot(); -// var frame = this.createFrame(); + // Button + var button1 = new qx.ui.form.Button("Frame 1!"); + button1.addListener("execute", this.createFrame1, this); + var button2 = new qx.ui.form.Button("Frame 2!"); + button2.addListener("execute", this.createFrame2, this); - // Button -// var button = new qx.ui.form.Button("Click here!"); -// button.addListener("execute", function() { - -// }, this); + doc.add(button1, {left: 50, top: 50}); + doc.add(button2, {left: 150, top: 50}); + doc.add(this.createTable(), {left: 50, top: 100}); + }, -// doc.add(button, {left: 50, top: 50}); - doc.add(this.createTable(), {left: 50, top: 50}); + createFrame1 : function() + { + var frame = this.__frame1; + + if(!frame) + { + var label = new qx.ui.basic.Label("Just a label"); + + frame = new qxe.ui.window.Frame("Testing frame 1", "qxe/decoration/Modern/dialog/icon/16/information.png"); + frame.setLayout(new qx.ui.layout.Canvas()); + frame.setHeight(100); + frame.setWidth(100); + frame.add(label); + frame.moveTo(110, 60); + frame.show(); + } }, - createFrame : function() + createFrame2 : function() { - var statusBar = new qxe.ui.statusbar.StatusBar(); + var frame = this.__frame2; - var frame = new qxe.ui.window.Frame("StatusBar Demo"); -// frame.addStatusBar(statusBar); + if(!frame) + { + var label = new qx.ui.basic.Label("Just a label"); + var statusBar = new qxe.ui.statusbar.StatusBar(); - return frame; + frame = new qxe.ui.window.Frame("Testing frame 2", "qxe/decoration/Modern/dialog/icon/16/information.png"); + frame.setLayout(new qx.ui.layout.Canvas()); + frame.setHeight(100); + frame.setWidth(100); + frame.add(label); + frame.moveTo(110, 60); + frame.show(); + frame.addStatusBar(statusBar); + } }, nextId : 0, @@ -108,8 +138,6 @@ createTable : function() { - var statusBar = new qxe.ui.statusbar.StatusBar(); - // Create the initial data var rowData = this.createRandomRows(20); @@ -123,11 +151,10 @@ // table var table = new qxe.ui.table.Table(tableModel); -// table.addStatusBar(statusbar); table.set({ width: 600, - height: 200, + height: 150, decorator : 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-29 15:38:29 UTC (rev 21620) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-29 23:28:52 UTC (rev 21621) @@ -185,11 +185,29 @@ --------------------------------------------------------------------------- */ - "statusbar" : "widget", - "statusbar/message-pane" : "widget", + "statusbar" : + { + style : function(states) + { + return { + decorator : "inset-thin", + padding : [ 2, 6 ] + }; + } + }, + "statusbar/message" : "label", + /* --------------------------------------------------------------------------- + TABLE + --------------------------------------------------------------------------- + */ + + "table/statusbar/message" : "statusbar/message", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ 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-29 15:38:29 UTC (rev 21620) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-29 23:28:52 UTC (rev 21621) @@ -190,11 +190,41 @@ --------------------------------------------------------------------------- */ - "statusbar" : "widget", - "statusbar/message-pane" : "widget", + "statusbar" : + { + style : function(states) + { + var useCSS = qx.core.Environment.get("css.borderradius") && + qx.core.Environment.get("css.gradients") && + qx.core.Environment.get("css.boxshadow"); + return { + padding : [ 2, 6 ], + decorator : useCSS ? "window-statusbar-css" : "window-statusbar", + minHeight : 18 + }; + } + }, + "statusbar/message" : + { + style : function(states) + { + return { + font : "small" + }; + } + }, + /* --------------------------------------------------------------------------- + TABLE + --------------------------------------------------------------------------- + */ + + "table/statusbar/message" : "statusbar/message", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ 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-29 15:38:29 UTC (rev 21620) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-11-29 23:28:52 UTC (rev 21621) @@ -38,7 +38,7 @@ this._setLayout(new qx.ui.layout.HBox()); - this._createChildControl("message-pane"); + this._createChildControl("message"); }, @@ -83,7 +83,7 @@ switch(id) { - case "message-pane": + case "message": control = new qxe.ui.statusbar.Message(); this._add(control); @@ -160,7 +160,7 @@ */ setValue : function(text) { - var child = this.getChildControl("message-pane"); + var child = this.getChildControl("message"); if(child) { 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-29 15:38:29 UTC (rev 21620) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-11-29 23:28:52 UTC (rev 21621) @@ -20,8 +20,9 @@ Revision: 28835-> * Stefan Andersson (sand) + - change of statusbar implementing qxe.ui.statusbar.StatusBar + - added addStatusBar function - removed status text - - added functionality for a real statusbar, which can be added - removed DEFAULT_WINDOW_MANAGER to Desktop to make Desktop independent Window and open up for different window manager classes. ! Try to remove Table's dependence on Window This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 15:38:42
|
Revision: 21620 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21620&view=rev Author: sandersson Date: 2011-11-29 15:38:29 +0000 (Tue, 29 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 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-29 12:56:16 UTC (rev 21619) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/StatusBar/source/class/qxe/demo/Application.js 2011-11-29 15:38:29 UTC (rev 21620) @@ -111,7 +111,7 @@ var statusBar = new qxe.ui.statusbar.StatusBar(); // Create the initial data - var rowData = this.createRandomRows(50); + var rowData = this.createRandomRows(20); // table model var tableModel = this._tableModel = new qx.ui.table.model.Simple(); @@ -123,11 +123,11 @@ // table var table = new qxe.ui.table.Table(tableModel); - table.addStatusBar(statusbar); +// table.addStatusBar(statusbar); table.set({ width: 600, - height: 400, + height: 200, decorator : 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-29 12:56:16 UTC (rev 21619) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-29 15:38:29 UTC (rev 21620) @@ -181,6 +181,15 @@ /* --------------------------------------------------------------------------- + STATUSBAR + --------------------------------------------------------------------------- + */ + + "statusbar" : "widget", + "statusbar/message-pane" : "widget", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ 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-29 12:56:16 UTC (rev 21619) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-29 15:38:29 UTC (rev 21620) @@ -186,6 +186,15 @@ /* --------------------------------------------------------------------------- + STATUSBAR + --------------------------------------------------------------------------- + */ + + "statusbar" : "widget", + "statusbar/message-pane" : "widget", + + /* + --------------------------------------------------------------------------- WIZARD --------------------------------------------------------------------------- */ 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-29 12:56:16 UTC (rev 21619) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/StatusBar.js 2011-11-29 15:38:29 UTC (rev 21620) @@ -144,6 +144,28 @@ { var layout = this._getLayout(); value == null ? layout.resetSpacing() : layout.setSpacing(value); + }, + + + /* + --------------------------------------------------------------------------- + USER API + --------------------------------------------------------------------------- + */ + + /** + * Sets the value of the default message pane. + * + * @param text {string} The text. + */ + setValue : function(text) + { + var child = this.getChildControl("message-pane"); + + if(child) + { + child.setValue(text); + } } } }); 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-29 12:56:16 UTC (rev 21619) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/table/Table.js 2011-11-29 15:38:29 UTC (rev 21620) @@ -31,7 +31,7 @@ * 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 statusbar {qxe.ui.statusbar.StatusBar} 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", @@ -1936,7 +1936,7 @@ text = this.trn("one of one row", "%1 of %2 rows", rowCount, selectedRowCount, rowCount); } - this.getChildControl("statusbar").getChildControl("message-pane").setValue(text); + this.getChildControl("statusbar").setValue(text); } } }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 12:56:27
|
Revision: 21619 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21619&view=rev Author: sandersson Date: 2011-11-29 12:56:16 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js 2011-11-29 12:14:17 UTC (rev 21618) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js 2011-11-29 12:56:16 UTC (rev 21619) @@ -102,7 +102,8 @@ control.setFocusable(false); control.setKeepFocus(true); control.setTextAlign("right"); - control.setWidth(35); + control.setWidth(50); + control.setAllowGrowX(false); control.setToolTip(tooltip); break; @@ -114,9 +115,11 @@ case "date-field": tooltip = new qx.ui.tooltip.ToolTip(this.tr("Last date visit.")); - control = new qx.ui.form.DateField(); + // Should be DateTimeTextField! + control = new qx.ui.form.TextField(); control.setFocusable(false); control.setKeepFocus(true); + control.setWidth(200); control.setToolTip(tooltip); break; } @@ -124,11 +127,26 @@ return control || this.base(arguments, id); }, + + /* + --------------------------------------------------------------------------- + BASIC EVENT HANDLERS + --------------------------------------------------------------------------- + */ + + /** + * Update counter on appear event of widget. + * + * @param e {qx.event.type.Event} appear event + */ _onAppearCounter : function() { this.__updateCounter(); }, + /** + * Update counter of widget. + */ __updateCounter : function() { var oldCounter = qx.bom.Cookie.get("visitCount"); @@ -147,9 +165,9 @@ var newDate = date.toGMTString(); qx.bom.Cookie.set("visitCount", counter, newDate); - qx.bom.Cookie.set("lastVisit", counter, newDate); + qx.bom.Cookie.set("lastVisit", date, newDate); - this.getChildControl("num-field").setValue(counter); + this.getChildControl("num-field").setValue("" + counter); this.getChildControl("date-field").setValue(lastDate); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 12:14:24
|
Revision: 21618 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21618&view=rev Author: sandersson Date: 2011-11-29 12:14:17 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/test/ui/selection/Wizard.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ButtonPane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/DecoratedWindow.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/test/ui/selection/Wizard.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/test/ui/selection/Wizard.js 2011-11-29 11:34:33 UTC (rev 21617) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/test/ui/selection/Wizard.js 2011-11-29 12:14:17 UTC (rev 21618) @@ -63,7 +63,7 @@ _getChildren : function() { - if (this._widget != null) + if (this._widget) { return this._widget.getChildren(); } 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-29 11:34:33 UTC (rev 21617) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-29 12:14:17 UTC (rev 21618) @@ -153,7 +153,10 @@ control.setAlignY("middle"); control.setToolTip(tooltip); - control.setValue(this.__pageContainer.getNumPages()); + if(this.__pageContainer) + { + control.setValue(this.__pageContainer.getNumPages()); + } break; case "next-page-button": Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js 2011-11-29 11:34:33 UTC (rev 21617) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js 2011-11-29 12:14:17 UTC (rev 21618) @@ -255,7 +255,7 @@ this.getChildControl("image").setSource(image || null); this.getChildControl("message").setValue(message || null); - if(buttonPane != null) + if(buttonPane) { this.getChildControl("button-pane").set(buttonPane); } Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js 2011-11-29 11:34:33 UTC (rev 21617) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js 2011-11-29 12:14:17 UTC (rev 21618) @@ -79,13 +79,13 @@ switch(id) { case "pane": - control = new qx.ui.container.Composite(new qx.ui.layout.Grid()); + control = new qx.ui.container.Composite(new qx.ui.layout.Grid(4, 2)); control.addListener("appear", this._onAppearCounter, this); - control.add(this._getChildControl("num-label"), {column: 0, row: 0}); - control.add(this._getChildControl("num-field"), {column: 1, row: 0}); - control.add(this._getChildControl("date-label"), {column: 0, row: 1}); - control.add(this._getChildControl("date-field"), {column: 1, row: 1}); + control.add(this.getChildControl("num-label"), {column: 0, row: 0}); + control.add(this.getChildControl("num-field"), {column: 1, row: 0}); + control.add(this.getChildControl("date-label"), {column: 0, row: 1}); + control.add(this.getChildControl("date-field"), {column: 1, row: 1}); this._add(control); break; @@ -102,9 +102,7 @@ control.setFocusable(false); control.setKeepFocus(true); control.setTextAlign("right"); - control.setReadOnly(true); control.setWidth(35); -// control.setAlignY("middle"); control.setToolTip(tooltip); break; @@ -119,9 +117,6 @@ control = new qx.ui.form.DateField(); control.setFocusable(false); control.setKeepFocus(true); - control.setReadOnly(true); -// control.setWidth(35); -// control.setAlignY("middle"); control.setToolTip(tooltip); break; } @@ -136,9 +131,11 @@ __updateCounter : function() { - var counter = parseInt(qx.bom.Cookie.get("visitCount")); - var lastDate = parseInt(qx.bom.Cookie.get("lastVisit")); + var oldCounter = qx.bom.Cookie.get("visitCount"); + var counter = parseInt(oldCounter ? oldCounter : 0); + var lastDate = qx.bom.Cookie.get("lastVisit"); + ++counter; var date = new Date(); Modified: 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 2011-11-29 11:34:33 UTC (rev 21617) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/mobile/form/ButtonPane.js 2011-11-29 12:14:17 UTC (rev 21618) @@ -58,7 +58,7 @@ { this.base(arguments); - if(orientation != null) + if(orientation) { this.setOrientation(orientation); } @@ -67,7 +67,7 @@ this.initOrientation(); } - if(spacing != null) + if(spacing) { this.setSpacing(spacing); } Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/DecoratedWindow.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/DecoratedWindow.js 2011-11-29 11:34:33 UTC (rev 21617) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/DecoratedWindow.js 2011-11-29 12:14:17 UTC (rev 21618) @@ -72,11 +72,11 @@ this._createChildControl("captionbar"); // apply constructor parameters - if (icon != null) { + if (icon) { this.setIcon(icon); } - if (caption != null) { + if (caption) { this.setCaption(caption); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 11:34:41
|
Revision: 21617 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21617&view=rev Author: sandersson Date: 2011-11-29 11:34:33 +0000 (Tue, 29 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/source/class/qxe/ui/info/Counter.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-29 11:10:51 UTC (rev 21616) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-29 11:34:33 UTC (rev 21617) @@ -78,6 +78,14 @@ /* --------------------------------------------------------------------------- + COUNTER + --------------------------------------------------------------------------- + */ + + "counter" : "widget", + + /* + --------------------------------------------------------------------------- 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-29 11:10:51 UTC (rev 21616) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-29 11:34:33 UTC (rev 21617) @@ -83,6 +83,14 @@ /* --------------------------------------------------------------------------- + COUNTER + --------------------------------------------------------------------------- + */ + + "counter" : "widget", + + /* + --------------------------------------------------------------------------- DECORATED WINDOW --------------------------------------------------------------------------- */ Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Counter.js 2011-11-29 11:34:33 UTC (rev 21617) @@ -0,0 +1,160 @@ +/* **************************************************************************** + + 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 visit counter of the page. + */ +qx.Class.define("qxe.ui.info.Counter", +{ + extend : qx.ui.core.Widget, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + this._setLayout(new qx.ui.layout.Canvas()); + + this._createChildControl("pane"); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "counter" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + + // overridden + _createChildControlImpl : function(id) + { + var control; + var tooltip; + + switch(id) + { + case "pane": + control = new qx.ui.container.Composite(new qx.ui.layout.Grid()); + control.addListener("appear", this._onAppearCounter, this); + + control.add(this._getChildControl("num-label"), {column: 0, row: 0}); + control.add(this._getChildControl("num-field"), {column: 1, row: 0}); + control.add(this._getChildControl("date-label"), {column: 0, row: 1}); + control.add(this._getChildControl("date-field"), {column: 1, row: 1}); + + this._add(control); + break; + + case "num-label": + control = new qx.ui.basic.Label("Number of visits"); + control.setAlignY("middle"); + break; + + case "num-field": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Total number of visits.")); + + 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 "date-label": + control = new qx.ui.basic.Label("Last visit"); + control.setAlignY("middle"); + break; + + case "date-field": + tooltip = new qx.ui.tooltip.ToolTip(this.tr("Last date visit.")); + + control = new qx.ui.form.DateField(); + control.setFocusable(false); + control.setKeepFocus(true); + control.setReadOnly(true); +// control.setWidth(35); +// control.setAlignY("middle"); + control.setToolTip(tooltip); + break; + } + + return control || this.base(arguments, id); + }, + + _onAppearCounter : function() + { + this.__updateCounter(); + }, + + __updateCounter : function() + { + var counter = parseInt(qx.bom.Cookie.get("visitCount")); + var lastDate = parseInt(qx.bom.Cookie.get("lastVisit")); + + ++counter; + + var date = new Date(); + + var expdate = date.getTime(); + expdate += 3600000 * 24 *30; + + date.setTime(expdate); + var newDate = date.toGMTString(); + + qx.bom.Cookie.set("visitCount", counter, newDate); + qx.bom.Cookie.set("lastVisit", counter, newDate); + + this.getChildControl("num-field").setValue(counter); + this.getChildControl("date-field").setValue(lastDate); + } + } +}); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 11:11:00
|
Revision: 21616 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21616&view=rev Author: sandersson Date: 2011-11-29 11:10:51 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json 2011-11-29 11:05:48 UTC (rev 21615) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json 2011-11-29 11:10:51 UTC (rev 21616) @@ -5,9 +5,6 @@ [ { "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" - }, - { - "path" : "image.json" } ], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-29 11:05:59
|
Revision: 21615 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21615&view=rev Author: sandersson Date: 2011-11-29 11:05:48 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/generate.py trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/simulation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/simulation/DemoSimulation.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/test/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/test/DemoTest.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Theme.js trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/index.html trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/resource/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/resource/qxe/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/resource/qxe/demo/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/resource/qxe/demo/test.png trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/translation/ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/translation/readme.txt Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/resource/qxe/demo/info/ 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-29 10:40:11 UTC (rev 21614) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -24,7 +24,7 @@ ************************************************************************ */ /** - * This is the main application class of your custom application "qxe Clock indicator" + * This is the main application class of your custom application "qxe Clock" */ qx.Class.define("qxe.demo.Application", { Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/Manifest.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/Manifest.json 2011-11-29 11:05:48 UTC (rev 21615) @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "qxe Counter 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/Counter/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/config.json 2011-11-29 11:05:48 UTC (rev 21615) @@ -0,0 +1,69 @@ +{ + "name" : "qxe Counter 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/Counter/generate.py =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/generate.py (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/generate.py 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/generate.py ___________________________________________________________________ Added: svn:executable + * Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/Application.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -0,0 +1,78 @@ +/* ************************************************************************ + + 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/info/LED.jpg) + +#asset(qxe/demo/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "qxe Counter" + */ +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 counter = new qxe.ui.info.Counter(); + + doc.add(counter, {left: 50, top: 50}); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/simulation/DemoSimulation.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/simulation/DemoSimulation.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/simulation/DemoSimulation.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/class/qxe/demo/test/DemoTest.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/test/DemoTest.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/test/DemoTest.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Appearance.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Appearance.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Color.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Color.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Decoration.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Decoration.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Font.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Font.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/class/qxe/demo/theme/Theme.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Theme.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/class/qxe/demo/theme/Theme.js 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/index.html =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/index.html (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/index.html 2011-11-29 11:05:48 UTC (rev 21615) @@ -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/Counter/source/resource/qxe/demo/test.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/resource/qxe/demo/test.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/translation/readme.txt =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/translation/readme.txt (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Counter/source/translation/readme.txt 2011-11-29 11:05:48 UTC (rev 21615) @@ -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-29 10:40:22
|
Revision: 21614 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21614&view=rev Author: sandersson Date: 2011-11-29 10:40:11 +0000 (Tue, 29 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/ui/info/BinaryClock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/AnalogClock.js 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-28 17:49:22 UTC (rev 21613) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-29 10:40:11 UTC (rev 21614) @@ -69,7 +69,7 @@ // Document is the application root var doc = this.getRoot(); -// var analogClock = new qxe.ui.info.AnalogClock(); + var analogClock = new qxe.ui.info.AnalogClock(); var binaryClock = new qxe.ui.info.BinaryClock(); var ledClock1 = new qxe.ui.info.LEDClock(); @@ -80,7 +80,7 @@ var digitalClock = new qxe.ui.info.DigitalClock(); var internetClock = new qxe.ui.info.InternetClock(); -// doc.add(analogClock, {left: 50, top: 50}); + doc.add(analogClock, {left: 50, top: 50}); doc.add(binaryClock, {left: 50, top: 150}); doc.add(ledClock1, {left: 50, top: 275}); doc.add(ledClock2, {left: 50, top: 300}) Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/AnalogClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/AnalogClock.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/AnalogClock.js 2011-11-29 10:40:11 UTC (rev 21614) @@ -0,0 +1,394 @@ +/* ************************************************************************ + + 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 analog clock. + */ +qx.Class.define("qxe.ui.info.AnalogClock", +{ + extend : qxe.ui.info.Clock, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + +// this.setMinHeight(100); +// this.setMinWidth(100); + + this._dial = []; + this._dots = []; + + this._hours = []; + this._minutes = []; + this._seconds = []; + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "analog-clock" + }, + + /* + --------------------------------------------------------------------------- + FEATURES + --------------------------------------------------------------------------- + */ + + manualDial : + { + check : "Object", + nullable : true, + init : null + }, + + /** + * The face colour. + */ + faceColor : + { + check : "Color", + init : "#00ff00" + }, + + /** + * The dot colour. + */ + dotColor : + { + check : "Color", + init : "#ffffff" + }, + + /** + * The hour colour. + */ + hourColor : + { + check : "Color", + init : "#ff0000" + }, + + /** + * The minute colour. + */ + minuteColor : + { + check : "Color", + init : "#ffffff" + }, + + /** + * The second colour. + */ + secondColor : + { + check : "Color", + init : "#00ff00" + } + }, + + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + + // overridden + _createChildControlImpl : function(id) + { + var control; + + switch(id) + { + case "image-pane": + control = new qx.ui.basic.Image(); + + this._add(control); + break; + } + + return control || this.base(arguments, id); + }, + + _applyElementData : function(el) + { + this.error(el); + var image = this.getManualDial(); + + if(image) + { + this.add(image); + } + else + { + this._createDial(el); + this._createHands(el); + } + }, + + // Face and dial dial[i] + __createFace :function(dial, i) + { + var face = qx.bom.Element.create("div"); + face.value = dial; + + var faceStyle = { + position : "absolute", + top : "0px", + left : "0px", + width : "15px", + height : "15px", + fontFamily : "arial,sans-serif", + fontSize : "10px", + color : this.getFaceColor().getValue(), + textAlign : "center" + }; + + qx.bom.element.Style.setStyles(face, faceStyle); + + var e = 360/dial.length; + + this._dial[i] = faceStyle; + this._dial[i].top = this.getHeight()/2 - 6 + 30 * 1.4 * Math.sin(i*e*Math.PI/180) + "px"; + this._dial[i].left = this.getWidth()/2 - 6 + 30 * 1.4 * Math.cos(i*e*Math.PI/180) + "px"; + + return face; + }, + + __createDots : function(i) + { + var dot = qx.bom.Element.create("div"); + var dotStyle = { + position : "absolute", + top : "0px", + left : "0px", + width : "2px", + height : "2px", + fontSize : "2px", + backgroundColor : this.getDotColor().getValue() + }; + + qx.bom.element.Style.setStyles(dot, dotStyle); + + var e = 360/dial.length; + + this._dots[i] = dotStyle; + this._dots[i].top = this.getHeight()/2 + 30 * Math.sin(e*i*Math.PI/180) + "px"; + this._dots[i].left = this.getWidth()/2 + 30 * Math.cos(e*i*Math.PI/180) + "px"; + + return dot; + }, + + _createDial : function(el) + { + var dial = "3 4 5 6 7 8 9 10 11 12 1 2"; + dial = dial.split(" "); + + for (var i=0, l=dial.length; i<l; i++) + { + el.appendChild(this.__createFace(dial[i], i)); + el.appendChild(this.__createDots(i)); + } + }, + + _createHands : function(el) + { + this._createHourHand(el); + this._createMinuteHand(el); + this._createSecondHand(el); + }, + + _createHourHand : function(el) + { + var h = 3; + + for (var i=0; i < h; i++) + { + var hourHand = qx.bom.Element.create("div"); + var hourHandStyle = { + position : "absolute", + top : "0px", + left : "0px", + width : "2px", + height : "2px", + fontSize : "2px", + backgroundColor : this.getHourColor().getValue() + }; + + qx.bom.element.Style.setStyles(hourHand, hourHandStyle); + + el.appendChild(hourHand); + + this._hours[i] = hourHandStyle; + } + }, + + _createMinuteHand : function(el) + { + var m = 4; + + for (var i=0; i < m; i++) + { + var minuteHand = qx.bom.Element.create("div"); + var minuteHandStyle = { + position : "absolute", + top : "0px", + left : "0px", + width : "2px", + height : "2px", + fontSize : "2px", + backgroundColor : this.getMinuteColor().getValue() + }; + + qx.bom.element.Style.setStyles(minuteHand, minuteHandStyle); + + el.appendChild(minuteHand); + + this._minutes[i] = minuteHandStyle; + } + }, + + _createSecondHand : function(el) + { + var s = 5; + + for (var i=0; i < s; i++) + { + var secondHand = qx.bom.Element.create("div"); + var secondHandStyle = { + position : "absolute", + top : "0px", + left : "0px", + width : "2px", + height : "2px", + fontSize : "2px", + backgroundColor : this.getSecondColor().getValue() + }; + + qx.bom.element.Style.setStyles(secondHand, secondHandStyle); + + el.appendChild(secondHand); + + this._seconds[i] = secondHandStyle; + } + }, + + display : function(hours, minutes, seconds) + { + var halfHeight = this.getHeight()/2; + var halfWidth = this.getWidth()/2; + var cyx = 30/4; + + // Second calculations + var secondOffSet = seconds - 15; + + if (seconds < 15) + { + secondOffSet = seconds + 45; + } + + var second = Math.PI * (secondOffSet/30); + + // Render second + for (var i=0; i < second; i++) + { + this._seconds[i].top = halfheight + (i*cyx) * Math.sin(second) + pix; + this._seconds[i].left = halfWidth + (i*cyx) * Math.cos(second) + pix; + } + + // Minute calculations + var minuteOffSet = minutes - 15; + + if (minutes < 15) + { + minuteOffSet = minutes + 45; + } + + var minute = Math.PI * (minuteOffSet/30); + + // Render minute + for (var i=0; i < minute; i++) + { + this._minutes[i].top = halfHeight + (i*cyx) * Math.sin(minute) + pix; + this._minutes[i].left = halfWidth + (i*cyx) * Math.cos(minute) + pix; + } + + // Hour calculations + if (hours > 12) + { + hours -= 12; + } + + var hourOffSet = hours - 3; + + if (hours < 3) + { + hourOffSet = hours + 9; + } + + var hour = Math.PI * (hourOffSet/6) + Math.PI * minutes/360; + + // Render hour + for (var i=0; i < hour; i++) + { + this._hours[i].top = halfHeight + (i*cyx) * Math.sin(hour) + pix; + this._hours[i].left = halfWidth + (i*cyx) * Math.cos(hour) + pix; + } + } + }, + + + /* + ***************************************************************************** + DESTRUCTOR + ***************************************************************************** + */ + + destruct : function() + { + this.disposeObject("_dial", "_dots"); + this.disposeArray("_hours", "_minutes", "_seconds"); + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js 2011-11-28 17:49:22 UTC (rev 21613) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js 2011-11-29 10:40:11 UTC (rev 21614) @@ -112,6 +112,9 @@ } }, + /** + * Creates the binary dots or turns off all binary dots if already created. + */ __resetPane : function() { var setup = [ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js 2011-11-28 17:49:22 UTC (rev 21613) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/statusbar/IPane.js 2011-11-29 10:40:11 UTC (rev 21614) @@ -15,10 +15,6 @@ **************************************************************************** */ -/* **************************************************************************** - -**************************************************************************** */ - /** * A status bar pane. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-28 17:49:31
|
Revision: 21613 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21613&view=rev Author: sandersson Date: 2011-11-28 17:49:22 +0000 (Mon, 28 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/BinaryClock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 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-28 15:48:02 UTC (rev 21612) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-28 17:49:22 UTC (rev 21613) @@ -69,7 +69,6 @@ // Document is the application root var doc = this.getRoot(); - var internetClock = new qxe.ui.info.InternetClock(); // var analogClock = new qxe.ui.info.AnalogClock(); var binaryClock = new qxe.ui.info.BinaryClock(); @@ -79,13 +78,14 @@ ledClock2.setImagePath("qxe/demo/info/"); var digitalClock = new qxe.ui.info.DigitalClock(); + var internetClock = new qxe.ui.info.InternetClock(); - doc.add(internetClock, {left: 50, top: 50}); // doc.add(analogClock, {left: 50, top: 50}); doc.add(binaryClock, {left: 50, top: 150}); doc.add(ledClock1, {left: 50, top: 275}); doc.add(ledClock2, {left: 50, top: 300}) doc.add(digitalClock, {left: 50, top: 325}); + doc.add(internetClock, {left: 50, top: 350}); } } }); 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-28 15:48:02 UTC (rev 21612) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-28 17:49:22 UTC (rev 21613) @@ -29,6 +29,14 @@ { /* --------------------------------------------------------------------------- + ANALOG CLOCK + --------------------------------------------------------------------------- + */ + + "analog-clock" : "widget", + + /* + --------------------------------------------------------------------------- BINARY CLOCK --------------------------------------------------------------------------- */ 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-28 15:48:02 UTC (rev 21612) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-28 17:49:22 UTC (rev 21613) @@ -34,6 +34,14 @@ { /* --------------------------------------------------------------------------- + ANALOG CLOCK + --------------------------------------------------------------------------- + */ + + "analog-clock" : "widget", + + /* + --------------------------------------------------------------------------- BINARY CLOCK --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js 2011-11-28 15:48:02 UTC (rev 21612) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js 2011-11-28 17:49:22 UTC (rev 21613) @@ -23,7 +23,13 @@ ************************************************************************ */ /** - * ThinkGeek's Binary LED Clock + * ThinkGeek's Binary LED Clock displays the time in a graphical binary format. + * The following grid is laid out: + * 8 8 8 + * 4 4 4 4 4 + * 2 2 2 2 2 2 + * 1 1 1 1 1 1 + * H H M M S S */ qx.Class.define("qxe.ui.info.BinaryClock", { @@ -42,8 +48,6 @@ // configure internal layout this._setLayout(new qx.ui.layout.Grid(2, 2)); - - this.__loadImages(); }, @@ -71,14 +75,7 @@ members : { - __images : null, - - __loadImages : function() - { - qx.io.ImageLoader.load("qxe/icon/ui/info/binary/on.gif"); - qx.io.ImageLoader.load("qxe/icon/ui/info/binary/off.gif"); - }, - + // overridden display : function(hours, minutes, seconds) { this.__resetPane(); @@ -103,7 +100,7 @@ for (var j = 8; j >= 1; j = j / 2) { - var widget = layout.getCellWidget(4 - Math.floor(j/2), i - 1); + var widget = layout.getCellWidget(3 - Math.log(j)/Math.log(2), i - 1); if (num - j >= 0 && widget) { @@ -123,12 +120,6 @@ [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1] ]; -/* - 28 48 68 - 24 34 44 54 64 -12 22 32 42 52 62 -11 21 31 41 51 61 -*/ var cols = 6 - !this.getShowSeconds() * 2; var layout = this._getLayout(); @@ -152,18 +143,6 @@ } } } - }, - - - /* - ***************************************************************************** - DESTRUCTOR - ***************************************************************************** - */ - - destruct : function() - { - this.disposeArray("__images"); - } + } }); 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-28 15:48:02 UTC (rev 21612) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-28 17:49:22 UTC (rev 21613) @@ -117,7 +117,7 @@ // overriden display : function(hours, minutes, seconds) { - var am_pm = ""; + var am_pm = " "; if(this.getShowHours() == 12) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-28 15:48:08
|
Revision: 21612 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21612&view=rev Author: sandersson Date: 2011-11-28 15:48:02 +0000 (Mon, 28 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/ui/info/LEDClock.js 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-28 15:27:31 UTC (rev 21611) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-28 15:48:02 UTC (rev 21612) @@ -17,7 +17,7 @@ /* ************************************************************************ -#asset(qxe/demo/info/LED.jpg) +# asset(qxe/demo/info/LED.jpg) #asset(qxe/demo/*) Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js 2011-11-28 15:27:31 UTC (rev 21611) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js 2011-11-28 15:48:02 UTC (rev 21612) @@ -17,7 +17,7 @@ /* ************************************************************************ -#asset(qxe/icon/ui/info/led/LED.jpg) +#asset(qxe/icon/ui/info/led/*) ************************************************************************ */ @@ -193,6 +193,10 @@ { children[8].setSource(path + am_pm + ".gif"); } + else + { + children[8].setSource(path + "blank.gif"); + } } } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-28 15:27:43
|
Revision: 21611 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21611&view=rev Author: sandersson Date: 2011-11-28 15:27:31 +0000 (Mon, 28 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/ui/info/LEDClock.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/led/ Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/icon/ui/info/digital/ 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-28 12:15:54 UTC (rev 21610) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-28 15:27:31 UTC (rev 21611) @@ -17,6 +17,8 @@ /* ************************************************************************ +#asset(qxe/demo/info/LED.jpg) + #asset(qxe/demo/*) ************************************************************************ */ @@ -70,12 +72,20 @@ var internetClock = new qxe.ui.info.InternetClock(); // var analogClock = new qxe.ui.info.AnalogClock(); var binaryClock = new qxe.ui.info.BinaryClock(); + + var ledClock1 = new qxe.ui.info.LEDClock(); + + var ledClock2 = new qxe.ui.info.LEDClock(); + ledClock2.setImagePath("qxe/demo/info/"); + var digitalClock = new qxe.ui.info.DigitalClock(); doc.add(internetClock, {left: 50, top: 50}); // doc.add(analogClock, {left: 50, top: 50}); doc.add(binaryClock, {left: 50, top: 150}); - doc.add(digitalClock, {left: 50, top: 300}); + doc.add(ledClock1, {left: 50, top: 275}); + doc.add(ledClock2, {left: 50, top: 300}) + doc.add(digitalClock, {left: 50, top: 325}); } } }); 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-28 12:15:54 UTC (rev 21610) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-28 15:27:31 UTC (rev 21611) @@ -117,6 +117,14 @@ /* --------------------------------------------------------------------------- + LED CLOCK + --------------------------------------------------------------------------- + */ + + "led-clock" : "widget", + + /* + --------------------------------------------------------------------------- MULTI STATE BUTTON --------------------------------------------------------------------------- */ 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-28 12:15:54 UTC (rev 21610) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-28 15:27:31 UTC (rev 21611) @@ -122,6 +122,14 @@ /* --------------------------------------------------------------------------- + LED CLOCK + --------------------------------------------------------------------------- + */ + + "led-clock" : "widget", + + /* + --------------------------------------------------------------------------- MULTI STATE BUTTON --------------------------------------------------------------------------- */ 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-28 12:15:54 UTC (rev 21610) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-28 15:27:31 UTC (rev 21611) @@ -71,6 +71,15 @@ { check : [12, 24], init : 12 + }, + + /* + * Show a leading zero for one digit hours. + */ + leadingHourZero : + { + check : "Boolean", + init : true } }, @@ -120,7 +129,8 @@ var padZeros = qxe.util.format.StringFormat.padZeros; - var time = padZeros(hours, 2) + ':' + padZeros(minutes, 2); + var time = (hours < 10 && !this.getLeadingHourZero() ? " " + padZeros(hours, 1) : padZeros(hours, 2)); + time += ':' + padZeros(minutes, 2); if(this.getShowSeconds()) { Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js 2011-11-28 12:15:54 UTC (rev 21610) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js 2011-11-28 15:27:31 UTC (rev 21611) @@ -15,8 +15,14 @@ ************************************************************************ */ +/* ************************************************************************ + +#asset(qxe/icon/ui/info/led/LED.jpg) + +************************************************************************ */ + /** - * An LED clock. + * A LED clock. */ qx.Class.define("qxe.ui.info.LEDClock", { @@ -34,12 +40,9 @@ this.base(arguments); // configure internal layout - this._setLayout(new qx.ui.layout.HBox()); + this._setLayout(new qx.ui.layout.Canvas()); this._createChildControl("pane"); - - this.__digits = []; - this._loadFigures(this.getImagePath() + this.getTemplate() + "/"); }, @@ -67,10 +70,10 @@ /* * Image to use if no font possible. */ - image : + imagePath : { check : "Image", - init : "" + init : "qxe/icon/ui/info/led/" }, /* @@ -80,6 +83,15 @@ { check : [12, 24], init : 12 + }, + + /* + * Show a leading zero for one digit hours. + */ + leadingHourZero : + { + check : "Boolean", + init : true } }, @@ -91,17 +103,6 @@ members : { - __digits : null, - - __hour1I : null, - __hour2I : null, - __divisor1I : null, - __minute1I : null, - __minute2I : null, - __divisor2I : null, - __second1I : null, - __second2I : null, - /* --------------------------------------------------------------------------- WIDGET API @@ -116,119 +117,83 @@ switch(id) { case "pane": - this.__hour1I = new qx.ui.basic.Image(); - this.__hour2I = new qx.ui.basic.Image(); - this.__divisor1I = new qx.ui.basic.Image(); - this.__minute1I = new qx.ui.basic.Image(); - this.__minute2I = new qx.ui.basic.Image(); - this.__divisor2I = new qx.ui.basic.Image(); - this.__second1I = new qx.ui.basic.Image(); - this.__second2I = new qx.ui.basic.Image(); + control = new qx.ui.container.Composite(new qx.ui.layout.HBox()); - this._add(this._hour1I, this._hour2I, this._divisor1I, this._minute1I, this._minute2I, this._divisor2I, this._second1I, this._second2I); + control.add(new qx.ui.basic.Image()); + control.add(new qx.ui.basic.Image()); + + control.add(new qx.ui.basic.Image()); + + control.add(new qx.ui.basic.Image()); + control.add(new qx.ui.basic.Image()); + + control.add(new qx.ui.basic.Image()); + + control.add(new qx.ui.basic.Image()); + control.add(new qx.ui.basic.Image()); + + control.add(new qx.ui.basic.Image()); + this._add(control); break; } return control || this.base(arguments, id); }, - _loadFigures : function(imagePath) - { - for(var i=0; i<10; i++) { - this._figures[i] = new QxImagePreloader(imagePath + i + ".png"); - } - - this._figures[10] = new QxImagePreloader(imagePath + "blank.png"); - this._figures[11] = new QxImagePreloader(imagePath + "divisor.png"); - }, - + // overridden 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); } - var time = ((hours < 10) ? "0" + hours : hours) + '' + ((minutes < 10) ? "0"+minutes : minutes) + '' + ((seconds < 10) ? "0"+seconds : seconds); + var padZeros = qxe.util.format.StringFormat.padZeros; - if(this.getShowHours() == 12) - { - this._hour1I.setSource(this._figures[time.charAt(0)].getSource()); - } - else - { - this._hour1I.setSource(this._figures[10].getSource()); - } + var time = padZeros(hours, 2) + padZeros(minutes, 2); - this._hour2I.setSource(this._figures[time.charAt(1)].getSource()); - this._divisor1I.setSource(this._figures[11].getSource()); - this._minute1I.setSource(this._figures[time.charAt(2)].getSource()); - this._minute2I.setSource(this._figures[time.charAt(3)].getSource()); - this._divisor2I.setSource(this._figures[11].getSource()); - this._second1I.setSource(this._figures[time.charAt(4)].getSource()); - this._second2I.setSource(this._figures[time.charAt(5)].getSource()); - } - }, + if(this.getShowSeconds()) + { + time += padZeros(seconds, 2); + } + var children = this.getChildControl("pane").getChildren(); + var path = this.getImagePath(); - /* - ***************************************************************************** - DESTRUCTOR - ***************************************************************************** - */ + if(this.getLeadingHourZero()) + { + children[0].setSource(path + "digit_" + time.charAt(0) + ".gif"); + } + else + { + children[0].setSource(path + "blank.gif"); + } - destruct : function() - { - if(this._hour1I) - { - this._hour1I.dispose(); - this._hour1I = null; - } + children[1].setSource(path + "digit_" + time.charAt(1) + ".gif"); - if(this._hour2I) - { - this._hour2I.dispose(); - this._hour2I = null; - } + children[2].setSource(path + "colon.gif"); - if(this._divisor1I) - { - this._divisor1I.dispose(); - this._divisor1I = null; - } + children[3].setSource(path + "digit_" + time.charAt(2) + ".gif"); + children[4].setSource(path + "digit_" + time.charAt(3) + ".gif"); - if(this._minute1I) - { - this._minute1I.dispose(); - this._minute1I = null; - } + if(this.getShowSeconds()) + { + children[5].setSource(path + "colon.gif"); - if(this._minute2I) - { - this._minute2I.dispose(); - this._minute2I = null; - } + children[6].setSource(path + "digit_" + time.charAt(4) + ".gif"); + children[7].setSource(path + "digit_" + time.charAt(5) + ".gif"); + } - if(this._divisor2I) - { - this._divisor2I.dispose(); - this._divisor2I = null; + if(am_pm != "") + { + children[8].setSource(path + am_pm + ".gif"); + } + } } - - if(this._second1I) - { - this._second1I.dispose(); - this._second1I = null; - } - - if(this._second2I) - { - this._second2I.dispose(); - this._second2I = null; - } - - this._figures = null; - } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-28 12:16:01
|
Revision: 21610 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21610&view=rev Author: sandersson Date: 2011-11-28 12:15:54 +0000 (Mon, 28 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/ui/info/DigitalClock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js 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-28 11:34:05 UTC (rev 21609) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-28 12:15:54 UTC (rev 21610) @@ -72,7 +72,7 @@ var binaryClock = new qxe.ui.info.BinaryClock(); var digitalClock = new qxe.ui.info.DigitalClock(); -// doc.add(internetClock, {left: 50, top: 50}); + doc.add(internetClock, {left: 50, top: 50}); // doc.add(analogClock, {left: 50, top: 50}); doc.add(binaryClock, {left: 50, top: 150}); doc.add(digitalClock, {left: 50, top: 300}); 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-28 11:34:05 UTC (rev 21609) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-28 12:15:54 UTC (rev 21610) @@ -37,7 +37,7 @@ this.base(arguments); // configure internal layout - this._setLayout(new qx.ui.layout.HBox()); + this._setLayout(new qx.ui.layout.Canvas()); this._createChildControl("pane"); }, Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js 2011-11-28 11:34:05 UTC (rev 21609) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js 2011-11-28 12:15:54 UTC (rev 21610) @@ -37,7 +37,7 @@ this.base(arguments); // configure internal layout - this._setLayout(new qx.ui.layout.HBox()); + this._setLayout(new qx.ui.layout.Canvas()); this._createChildControl("pane"); }, @@ -93,13 +93,13 @@ display : function(hours, minutes, seconds) { // Biel MeanTime (BMT) is the universal reference for Internet Time. - var bmt = (now.getTimezoneOffset() + 60); + var bmt = (new Date().getTimezoneOffset() + 60); var total = ((60 * hours + minutes + seconds/60 + bmt) * (1000 / 1440)); var time = Math.floor(total); time = (time < 0) ? time + 1000 : time; - time = qxe.util.format.StringFormat.padZeros(time, 4) + time = qxe.util.format.StringFormat.padZeros(time, 3) this.getChildControl("pane").setValue("@" + time); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-11-28 11:34:16
|
Revision: 21609 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21609&view=rev Author: sandersson Date: 2011-11-28 11:34:05 +0000 (Mon, 28 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/control/MPageControl.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 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/source/class/qxe/ui/info/BinaryClock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js 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-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Clock/source/class/qxe/demo/Application.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -67,10 +67,12 @@ // Document is the application root var doc = this.getRoot(); + var internetClock = new qxe.ui.info.InternetClock(); // var analogClock = new qxe.ui.info.AnalogClock(); var binaryClock = new qxe.ui.info.BinaryClock(); var digitalClock = new qxe.ui.info.DigitalClock(); +// doc.add(internetClock, {left: 50, top: 50}); // doc.add(analogClock, {left: 50, top: 50}); 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-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -109,6 +109,14 @@ /* --------------------------------------------------------------------------- + INTERNET CLOCK + --------------------------------------------------------------------------- + */ + + "internet-clock" : "widget", + + /* + --------------------------------------------------------------------------- MULTI STATE BUTTON --------------------------------------------------------------------------- */ 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-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -114,6 +114,14 @@ /* --------------------------------------------------------------------------- + INTERNET CLOCK + --------------------------------------------------------------------------- + */ + + "internet-clock" : "widget", + + /* + --------------------------------------------------------------------------- MULTI STATE BUTTON --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js 2011-11-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/MPageControl.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -174,11 +174,6 @@ */ getTotalPages : function() { - }, - - enableAll : function() - { -// this.getChildControl("search-pane").setEnabled(true); } } }); 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-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/control/PageControl.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -152,6 +152,8 @@ control.setWidth(35); control.setAlignY("middle"); control.setToolTip(tooltip); + + control.setValue(this.__pageContainer.getNumPages()); break; case "next-page-button": Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/BinaryClock.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -0,0 +1,169 @@ +/* ************************************************************************ + + 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/info/binary/on.gif) +#asset(qxe/icon/ui/info/binary/off.gif) + +************************************************************************ */ + +/** + * ThinkGeek's Binary LED Clock + */ +qx.Class.define("qxe.ui.info.BinaryClock", +{ + extend : qxe.ui.info.Clock, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + // configure internal layout + this._setLayout(new qx.ui.layout.Grid(2, 2)); + + this.__loadImages(); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "binary-clock" + } + }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + __images : null, + + __loadImages : function() + { + qx.io.ImageLoader.load("qxe/icon/ui/info/binary/on.gif"); + qx.io.ImageLoader.load("qxe/icon/ui/info/binary/off.gif"); + }, + + display : function(hours, minutes, seconds) + { + this.__resetPane(); + + // Convert current time to binary + // Get current time, return as 6-digit string: HHMMSS + var padZeros = qxe.util.format.StringFormat.padZeros; + var time = padZeros(hours, 2) + padZeros(minutes, 2); + + if(this.getShowSeconds()) + { + time += padZeros(seconds, 2); + } + + var num; + var layout = this._getLayout(); + + //i=col, j=row + for (var i = 1, l = time.length; i<=l; i++) + { + num = time.charAt(i - 1); + + for (var j = 8; j >= 1; j = j / 2) + { + var widget = layout.getCellWidget(4 - Math.floor(j/2), i - 1); + + if (num - j >= 0 && widget) + { + widget.setSource("qxe/icon/ui/info/binary/on.gif"); + + num = num - j; + } + } + } + }, + + __resetPane : function() + { + var setup = [ + [0, 1, 0, 1, 0, 1], + [0, 1, 1, 1, 1, 1], + [1, 1, 1, 1, 1, 1], + [1, 1, 1, 1, 1, 1] + ]; +/* + 28 48 68 + 24 34 44 54 64 +12 22 32 42 52 62 +11 21 31 41 51 61 +*/ + var cols = 6 - !this.getShowSeconds() * 2; + var layout = this._getLayout(); + + for(var y=0; y<4; y++) + { + for(var x=0; x<cols; x++) + { + if(setup[y][x] == 1) + { + var widget = layout.getCellWidget(y, x); + + if(widget) + { + widget.setSource("qxe/icon/ui/info/binary/off.gif"); + } + else + { + this._add(new qx.ui.basic.Image("qxe/icon/ui/info/binary/off.gif"), {column: x, row: y}); + } + } + } + } + } + }, + + + /* + ***************************************************************************** + DESTRUCTOR + ***************************************************************************** + */ + + destruct : function() + { + this.disposeArray("__images"); + } +}); + 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-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/Clock.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -17,6 +17,8 @@ /** * An abstract class for all info clock classes. + * + * - integrate internet time */ qx.Class.define("qxe.ui.info.Clock", { @@ -142,34 +144,7 @@ /** Timer id */ __timerId : null, - /* - * 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); - - intTime = (intTime < 0) ? intTime + 1000 : intTime; - intTime = (intTime < 10) ? "00" + intTime : intTime; - intTime = (intTime < 100) ? "0" + intTime : intTime; - - return intTime; - }, - - /* --------------------------------------------------------------------------- BASIC EVENT HANDLERS 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-28 10:46:14 UTC (rev 21608) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/DigitalClock.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -17,6 +17,9 @@ /** * A digital clock. + * + * - adapt to dst worldwide + * - adapt to local (browser) respective remote (server) time */ qx.Class.define("qxe.ui.info.DigitalClock", { Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/InternetClock.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -0,0 +1,108 @@ +/* ************************************************************************ + + 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) + +************************************************************************ */ + +/** + * This class 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. + */ +qx.Class.define("qxe.ui.info.InternetClock", +{ + 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 : "internet-clock" + } + }, + + /* + ***************************************************************************** + 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) + { + // Biel MeanTime (BMT) is the universal reference for Internet Time. + var bmt = (now.getTimezoneOffset() + 60); + + var total = ((60 * hours + minutes + seconds/60 + bmt) * (1000 / 1440)); + + var time = Math.floor(total); + time = (time < 0) ? time + 1000 : time; + time = qxe.util.format.StringFormat.padZeros(time, 4) + + this.getChildControl("pane").setValue("@" + time); + } + } +}); + Added: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/info/LEDClock.js 2011-11-28 11:34:05 UTC (rev 21609) @@ -0,0 +1,234 @@ +/* ************************************************************************ + + 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 LED clock. + */ +qx.Class.define("qxe.ui.info.LEDClock", +{ + extend : qxe.ui.info.Clock, + + + /* + ***************************************************************************** + CONSTRUCTOR + ***************************************************************************** + */ + + construct : function() + { + this.base(arguments); + + // configure internal layout + this._setLayout(new qx.ui.layout.HBox()); + + this._createChildControl("pane"); + + this.__digits = []; + this._loadFigures(this.getImagePath() + this.getTemplate() + "/"); + }, + + + /* + ***************************************************************************** + PROPERTIES + ***************************************************************************** + */ + + properties : + { + // overridden + appearance : + { + refine : true, + init : "led-clock" + }, + + /* + --------------------------------------------------------------------------- + FEATURES + --------------------------------------------------------------------------- + */ + + /* + * Image to use if no font possible. + */ + image : + { + check : "Image", + init : "" + }, + + /* + * Show a 12 or 24 hour clock. + */ + showHours : + { + check : [12, 24], + init : 12 + } + }, + + /* + ***************************************************************************** + MEMBERS + ***************************************************************************** + */ + + members : + { + __digits : null, + + __hour1I : null, + __hour2I : null, + __divisor1I : null, + __minute1I : null, + __minute2I : null, + __divisor2I : null, + __second1I : null, + __second2I : null, + + /* + --------------------------------------------------------------------------- + WIDGET API + --------------------------------------------------------------------------- + */ + + // overridden + _createChildControlImpl : function(id, hash) + { + var control; + + switch(id) + { + case "pane": + this.__hour1I = new qx.ui.basic.Image(); + this.__hour2I = new qx.ui.basic.Image(); + this.__divisor1I = new qx.ui.basic.Image(); + this.__minute1I = new qx.ui.basic.Image(); + this.__minute2I = new qx.ui.basic.Image(); + this.__divisor2I = new qx.ui.basic.Image(); + this.__second1I = new qx.ui.basic.Image(); + this.__second2I = new qx.ui.basic.Image(); + + this._add(this._hour1I, this._hour2I, this._divisor1I, this._minute1I, this._minute2I, this._divisor2I, this._second1I, this._second2I); + break; + } + + return control || this.base(arguments, id); + }, + + _loadFigures : function(imagePath) + { + for(var i=0; i<10; i++) { + this._figures[i] = new QxImagePreloader(imagePath + i + ".png"); + } + + this._figures[10] = new QxImagePreloader(imagePath + "blank.png"); + this._figures[11] = new QxImagePreloader(imagePath + "divisor.png"); + }, + + display : function(hours, minutes, seconds) + { + if(this.getShowHours() == 12) + { + hours = (hours > 12) ? hours - 12 : hours; + hours = (hours == 0) ? 12 : hours; + } + + var time = ((hours < 10) ? "0" + hours : hours) + '' + ((minutes < 10) ? "0"+minutes : minutes) + '' + ((seconds < 10) ? "0"+seconds : seconds); + + if(this.getShowHours() == 12) + { + this._hour1I.setSource(this._figures[time.charAt(0)].getSource()); + } + else + { + this._hour1I.setSource(this._figures[10].getSource()); + } + + this._hour2I.setSource(this._figures[time.charAt(1)].getSource()); + this._divisor1I.setSource(this._figures[11].getSource()); + this._minute1I.setSource(this._figures[time.charAt(2)].getSource()); + this._minute2I.setSource(this._figures[time.charAt(3)].getSource()); + this._divisor2I.setSource(this._figures[11].getSource()); + this._second1I.setSource(this._figures[time.charAt(4)].getSource()); + this._second2I.setSource(this._figures[time.charAt(5)].getSource()); + } + }, + + + /* + ***************************************************************************** + DESTRUCTOR + ***************************************************************************** + */ + + destruct : function() + { + if(this._hour1I) + { + this._hour1I.dispose(); + this._hour1I = null; + } + + if(this._hour2I) + { + this._hour2I.dispose(); + this._hour2I = null; + } + + if(this._divisor1I) + { + this._divisor1I.dispose(); + this._divisor1I = null; + } + + if(this._minute1I) + { + this._minute1I.dispose(); + this._minute1I = null; + } + + if(this._minute2I) + { + this._minute2I.dispose(); + this._minute2I = null; + } + + if(this._divisor2I) + { + this._divisor2I.dispose(); + this._divisor2I = null; + } + + if(this._second1I) + { + this._second1I.dispose(); + this._second1I = null; + } + + if(this._second2I) + { + this._second2I.dispose(); + this._second2I = null; + } + + this._figures = null; + } +}); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spa...@us...> - 2011-11-28 10:46:23
|
Revision: 21608 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21608&view=rev Author: spackers Date: 2011-11-28 10:46:14 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Added per-file parameters, deprecated upload handler parameters (moved to UploadMgr), and fixed bug when cancelling pending uploads Modified Paths: -------------- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/AbstractHandler.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/File.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-11-28 09:48:38 UTC (rev 21607) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/demo/default/source/class/uploadmgr/demo/Application.js 2011-11-28 10:46:14 UTC (rev 21608) @@ -71,18 +71,32 @@ var btn = new com.zenesis.qx.upload.UploadButton("Add File(s)", "com/zenesis/qx/upload/test.png"); var lst = new qx.ui.form.List(); + var uploadCount = 0; // Uploader controls the upload process; btn is the widget that will have the input[type=file] // attached, and "/demoupload" is the path files will be uploaded to (i.e. it's the value used // for the form's action attribute) // var uploader = new com.zenesis.qx.upload.UploadMgr(btn, "http://www.zenesis.com/demoupload"); - uploader.getUploadHandler().addParam("myParam", "test"); + + // Parameter tp be added to all uploads (can be overridden by individual files) + uploader.setParam("myGlobalParam", "global123"); + + // Optionally restrict the max number of simultaneous uploads (default is 5) + //uploader.getUploadHandler().setMaxConnections(1); + uploader.addListener("addFile", function(evt) { var file = evt.getData(), item = new qx.ui.form.ListItem(file.getFilename() + " (queued for upload)", null, file); lst.add(item); - + + // Set a parameter - each uploaded file has their own set, which can override those set + // globally against the upload manager + ++uploadCount; + file.setParam("myParam_" + uploadCount, "test"); + if (uploadCount % 2 == 0) + file.setParam("myGlobalParam", "overridden-global-value"); + // On modern browsers (ie not IE) we will get progress updates var progressListenerId = file.addListener("changeProgress", function(evt) { this.debug("Upload " + file.getFilename() + ": " + evt.getData() + " / " + file.getSize() + " - " + @@ -123,13 +137,13 @@ var sel = evt.getData(), item = sel.length ? sel[0] : null, file = item ? item.getModel() : null; - btnCancel.setEnabled(file != null && file.getState() == "uploading"); + btnCancel.setEnabled(file != null && (file.getState() == "uploading" || file.getState() == "not-started")); }, this); btnCancel.addListener("execute", function(evt) { var sel = lst.getSelection(), item = sel[0], file = item.getModel(); - if (file.getState() == "uploading") + if (file.getState() == "uploading" || file.getState() == "not-started") uploader.cancel(file); }, this); Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/AbstractHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/AbstractHandler.js 2011-11-28 09:48:38 UTC (rev 21607) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/AbstractHandler.js 2011-11-28 10:46:14 UTC (rev 21608) @@ -111,24 +111,11 @@ * @param file {com.zenesis.qx.upload.File} the file to cancel */ cancel: function(file) { + var wasUploading = this.__current.length > 0; this.debug("cancelled: id=" + file.getId() + ", fileName=" + file.getFilename()); - var inCurrent = false; - for (var current = this.__current, i = 0; i < current.length; i++) - if (current[i] == file) { - current.splice(i, 1); - inCurrent = true; - break; - } - if (inCurrent) { - this._cancel(file); - } else { - for (var queue = this.__queue, i = 0; i < queue.length; i++) - if (queue[i] == file) { - queue.splice(i, 1); - break; - } - } - this.beginUploads(); + this._cancel(file); + if (wasUploading && this.__uploader.getAutoUpload()) + this.beginUploads(); }, /** @@ -146,8 +133,21 @@ * @param file {com.zenesis.qx.upload.File} the file to cancel */ _cancel: function(file) { + var inCurrent = false; + for (var current = this.__current, i = 0; i < current.length; i++) + if (current[i] == file) { + current.splice(i, 1); + inCurrent = true; + break; + } + for (var queue = this.__queue, i = 0; i < queue.length; i++) + if (queue[i] == file) { + queue.splice(i, 1); + break; + } file.setState("cancelled"); - this._doCancel(file); + if (inCurrent) + this._doCancel(file); this.__uploader.fireDataEvent("cancelUpload", file); }, @@ -197,20 +197,58 @@ * Adds a parameter to send to the client * @param key {String} the name of the parameter * @param value {String} the value of the parameter + * @deprecated see com.zenesis.qx.upload.UploadMgr.setParam or com.zenesis.qx.upload.File.setParam */ addParam: function(key, value) { + qx.log.Logger.deprecatedMethodWarning(arguments.callee, "see com.zenesis.qx.upload.UploadMgr.setParam or com.zenesis.qx.upload.File.setParam"); this.__params[key] = value; }, /** * Returns the paramaters map * @returns {Map} + * @deprecated see com.zenesis.qx.upload.File.getParam */ getParams: function() { + qx.log.Logger.deprecatedMethodWarning(arguments.callee, "see com.zenesis.qx.upload.UploadMgr.getParam or com.zenesis.qx.upload.File.getParam"); return this.__params; }, /** + * Helper method that produces a final list of parameter values, by merging those + * set in this with those in the file. + * @param file {File} the file object + * @returns {Map} map of parameters to sent to the server + */ + _getMergedParams: function(file) { + var result = {}; + for (var name in this.__params) { + var value = this.__params[name]; + if (value !== null) + result[name] = value; + } + var names = this.__uploader.getParamNames(); + for (var i = 0; i < names.length; i++) { + var name = names[i], + value = this.__uploader.getParam(name); + if (value !== null) + result[name] = value; + else + delete result[name]; + } + var names = file.getParamNames(); + for (var i = 0; i < names.length; i++) { + var name = names[i], + value = file.getParam(name); + if (value !== null) + result[name] = value; + else + delete result[name]; + } + return result; + }, + + /** * Implementation must create a com.zenesis.qx.upload.File or array of com.zenesis.qx.upload.File * @param input {DOM} the DOM input[type=file] * @return {com.zenesis.qx.upload.File|com.zenesis.qx.upload.File[]} Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/File.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/File.js 2011-11-28 09:48:38 UTC (rev 21607) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/File.js 2011-11-28 10:46:14 UTC (rev 21608) @@ -109,8 +109,43 @@ members: { __browserObject: null, - + __params: null, + /** + * Sets a parameter value to be sent with the file + * @param name {String} name of the parameter + * @param value {String} the value of the parameter, or null to delete a previous parameter + */ + setParam: function(name, value) { + if (value !== null && typeof value != "string") + value ="" + value; + if (!this.__params) + this.__params = {}; + this.__params[name] = value; + }, + + /** + * Returns a parameter value to be sent with the file + * @param name + * @returns {Boolean} + */ + getParam: function(name) { + return this.__params && this.__params[name]; + }, + + /** + * Returns a list of parameter names + * @returns {Array} + */ + getParamNames: function() { + var result = []; + if (this.__params) + for (var name in this.__params) + result.push(name); + return result; + }, + + /** * Returns the browser object * @returns {DOM} */ @@ -126,7 +161,7 @@ _applyState: function(value, oldValue) { qx.core.Assert.assertTrue( (!oldValue && value == "not-started") || - (oldValue == "not-started" && value == "uploading") || + (oldValue == "not-started" && (value == "cancelled" || value == "uploading")) || (oldValue == "uploading" && (value == "cancelled" || value == "uploaded")) ); } Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-11-28 09:48:38 UTC (rev 21607) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/FormHandler.js 2011-11-28 10:46:14 UTC (rev 21608) @@ -174,7 +174,7 @@ qx.bom.element.Style.setStyles(form, { display: 'none' }); - var params = this.getParams(); + var params = this._getMergedParams(file); for (var name in params) { var el = qx.bom.Element.create('input', { type: "hidden", Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-11-28 09:48:38 UTC (rev 21607) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/UploadMgr.js 2011-11-28 10:46:14 UTC (rev 21608) @@ -128,6 +128,7 @@ __widgetsData: null, __inputSerial: 0, __uploadHandler: null, + __params: null, /** * Adds a widget which is to have an input[type=file] attached; this would typically be an @@ -179,6 +180,44 @@ } }, + /** + * Sets a parameter value to be sent with the file + * @param name {String} name of the parameter + * @param value {String} the value of the parameter, or null to delete a previous parameter + */ + setParam: function(name, value) { + if (value !== null && typeof value != "string") + value ="" + value; + if (!this.__params) + this.__params = {}; + this.__params[name] = value; + }, + + /** + * Returns a parameter value to be sent with the file + * @param name + * @returns {Boolean} + */ + getParam: function(name) { + return this.__params && this.__params[name]; + }, + + /** + * Returns a list of parameter names + * @returns {Array} + */ + getParamNames: function() { + var result = []; + if (this.__params) + for (var name in this.__params) + result.push(name); + return result; + }, + + /** + * Helper method that corrects the size of the input element to match the size of the widget + * @param widget + */ __fixupSize: function(widget) { var data = this.__widgetsData[widget.toHashCode()]; if (data && data.inputElement) { Modified: trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js =================================================================== --- trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-11-28 09:48:38 UTC (rev 21607) +++ trunk/qooxdoo-contrib/UploadMgr/trunk/source/class/com/zenesis/qx/upload/XhrHandler.js 2011-11-28 10:46:14 UTC (rev 21608) @@ -96,7 +96,7 @@ // build query string var action = this._getUploader().getUploadUrl(), - params = this.getParams(); + params = this._getMergedParams(file); for (var name in params) fd.append(name, encodeURIComponent(params[name])); fd.append("file", file.getBrowserObject()); @@ -110,7 +110,7 @@ var boundary = "--------FormData" + Math.random(), body = "", action = this._getUploader().getUploadUrl(), - params = this.getParams(); + params = this._getMergedParams(file); for (var name in params) { body += "--" + boundary + "\r\n"; body += "Content-Disposition: form-data; name=\""+ name +"\";\r\n\r\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_w...@us...> - 2011-11-28 09:48:48
|
Revision: 21607 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21607&view=rev Author: d_wagner Date: 2011-11-28 09:48:38 +0000 (Mon, 28 Nov 2011) Log Message: ----------- SVN ignore .project file (Eclipse) Property Changed: ---------------- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/ Property changes on: trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser ___________________________________________________________________ Modified: svn:ignore - build cache + build cache .project This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_w...@us...> - 2011-11-28 09:39:14
|
Revision: 21606 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21606&view=rev Author: d_wagner Date: 2011-11-28 09:39:04 +0000 (Mon, 28 Nov 2011) Log Message: ----------- removed unused stylesheet Modified Paths: -------------- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/Application.js Modified: trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/Application.js =================================================================== --- trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/Application.js 2011-11-28 09:38:23 UTC (rev 21605) +++ trunk/qooxdoo-contrib/qooxdoo/contribDemobrowser/source/class/contribdemobrowser/Application.js 2011-11-28 09:39:04 UTC (rev 21606) @@ -27,8 +27,8 @@ this.base(arguments); // Include CSS files - qx.bom.Stylesheet.includeFile("demobrowser/css/style.css"); - qx.bom.Stylesheet.includeFile("demobrowser/css/sourceview.css"); + qx.bom.Stylesheet.includeFile( + qx.util.ResourceManager.getInstance().toUri("demobrowser/css/style.css")); }, /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |