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-10-09 19:36:03
|
Revision: 21530 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21530&view=rev Author: sandersson Date: 2011-10-09 19:35:56 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Window/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/dialog/Dialog.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/DecoratedWindow.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/ trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Window/Manifest.json 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/Manifest.json 2011-10-09 19:35:56 UTC (rev 21530) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe Window Demo", + "name" : "qxe DecoratedWindow Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/config.json 2011-10-09 19:35:56 UTC (rev 21530) @@ -1,5 +1,5 @@ { - "name" : "qxe Window Demo", + "name" : "qxe DecoratedWindow Demo", "include" : [ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/DecoratedWindow/source/class/qxe/demo/Application.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -17,6 +17,8 @@ /* ************************************************************************ +#asset(qxe/decoration/Modern/dialog/icon/16/information.png) + #asset(qxe/demo/*) ************************************************************************ */ @@ -67,16 +69,22 @@ // Document is the application root var doc = this.getRoot(); + var decoratedWindow; + var button = new qx.ui.form.Button("Press!"); button.addListener("execute", function(e) { - var label = new qx.ui.basic.Label("Just a label"); + if(!decoratedWindow) + { + var label = new qx.ui.basic.Label("Just a label"); - var window = new qxe.ui.window.Window("Testing window"); - window.setSize(100, 100); - window.add(label); - window.show(); - - this.getApplicationRoot().add(window); + decoratedWindow = new qxe.ui.window.DecoratedWindow("Testing window", "qxe/decoration/Modern/dialog/icon/16/information.png"); + decoratedWindow.setLayout(new qx.ui.layout.Basic()); + decoratedWindow.setHeight(100); + decoratedWindow.setWidth(100); + decoratedWindow.add(label); + decoratedWindow.moveTo(110, 60); + decoratedWindow.show(); + } }, this); doc.add(button, {left: 100, top: 50}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -67,16 +67,22 @@ // Document is the application root var doc = this.getRoot(); + var dialog; + var button = new qx.ui.form.Button("Press!"); button.addListener("execute", function(e) { - var label = new qx.ui.basic.Label("Just a label"); + if(!dialog) + { + var label = new qx.ui.basic.Label("Just a label"); - var dialog = new qxe.ui.dialog.Dialog("Testing dialog"); - dialog.setSize(100, 100); - dialog.add(label); - dialog.show(); - - this.getApplicationRoot().add(dialog); + dialog = new qxe.ui.dialog.Dialog("Testing dialog"); + dialog.setLayout(new qx.ui.layout.Basic()); + dialog.setHeight(100); + dialog.setWidth(100); + dialog.add(label); + dialog.moveTo(110, 60); + dialog.show(); + } }, this); doc.add(button, {left: 100, top: 50}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/Manifest.json 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/Manifest.json 2011-10-09 19:35:56 UTC (rev 21530) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe Dialog Demo", + "name" : "qxe Frame Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/config.json 2011-10-09 19:35:56 UTC (rev 21530) @@ -1,5 +1,5 @@ { - "name" : "qxe Dialog Demo", + "name" : "qxe Frame Demo", "include" : [ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Frame/source/class/qxe/demo/Application.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -67,16 +67,22 @@ // Document is the application root var doc = this.getRoot(); + var frame; + var button = new qx.ui.form.Button("Press!"); button.addListener("execute", function(e) { - var label = new qx.ui.basic.Label("Just a label"); + if(!frame) + { + var label = new qx.ui.basic.Label("Just a label"); - var dialog = new qxe.ui.dialog.Dialog("Testing dialog"); - dialog.setSize(100, 100); - dialog.add(label); - dialog.show(); - - this.getApplicationRoot().add(dialog); + frame = new qxe.ui.window.Frame("Testing frame"); + frame.setLayout(new qx.ui.layout.Basic()); + frame.setHeight(100); + frame.setWidth(100); + frame.add(label); + frame.moveTo(110, 60); + frame.show(); + } }, this); doc.add(button, {left: 100, top: 50}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -67,16 +67,22 @@ // Document is the application root var doc = this.getRoot(); + var window; + var button = new qx.ui.form.Button("Press!"); button.addListener("execute", function(e) { - var label = new qx.ui.basic.Label("Just a label"); + if(!window) + { + var label = new qx.ui.basic.Label("Just a label"); - var window = new qxe.ui.window.Window("Testing window"); - window.setSize(100, 100); - window.add(label); - window.show(); - - this.getApplicationRoot().add(window); + window = new qxe.ui.window.Window(); + window.setLayout(new qx.ui.layout.Basic()); + window.setHeight(100); + window.setWidth(100); + window.add(label); + window.moveTo(110, 60); + window.show(); + } }, this); doc.add(button, {left: 100, top: 50}); 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-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -41,84 +41,30 @@ --------------------------------------------------------------------------- */ - "decorated-window/captionbar" : - { - style : function(states) - { - return { - padding : 1, - backgroundColor : states.active ? "dialog-active-caption" : "dialog-inactive-caption", - textColor : states.active ? "dialog-active-caption-text" : "dialog-inactive-caption-text" - }; - } - }, + "decorated-window" : "window", + "decorated-window/captionbar" : "window/captionbar", + "decorated-window/icon" : "window/icon", + "decorated-window/title" : "window/title", + "decorated-window/close-button" : "window/close-button", - "decorated-window/title" : - { - style : function(states) - { - return { - cursor : "default", - font : "bold", - margin : states.rtl ? [ 0, 0, 0, 20] : [ 0, 20, 0, 0], - alignY: "middle" - }; - } - }, - - "decorated-window/close-button" : - { - include : "button", - alias : "button", - - style : function(states) - { - var rtl = states.rtl; - - return { - margin : rtl ? [ 0, 2, 0, 0 ] : [ 0, 0, 0, 2 ], - icon : "decoration/window/close.gif", - padding : states.pressed || states.abandoned ? (rtl ? [ 2, 3, 0, 1] : [ 2, 1, 0, 3]) : [ 1, 2 ] - }; - } - }, - /* --------------------------------------------------------------------------- DIALOG --------------------------------------------------------------------------- */ - "dialog" : - { - style : function(states) - { - return { - contentPadding : [ 10, 10, 10, 10 ], - backgroundColor : "background", - decorator : states.maximized ? undefined : "outset", - shadow : states.maximized ? undefined : "shadow-small" - }; - } - }, + "dialog" : "window", - "dialog/pane" : {}, - /* --------------------------------------------------------------------------- FRAME --------------------------------------------------------------------------- */ - "frame/icon" : - { - style : function(states) - { - return { - margin : states.rtl ? [ 0, 0, 0, 4] : [ 0, 4, 0, 0] - }; - } - }, + "frame" : "window", + "frame/minimize-button" : "window/minimize-button", + "frame/restore-button" : "window/restore-button", + "frame/maximize-button" : "window/maximize-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-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -46,88 +46,30 @@ --------------------------------------------------------------------------- */ - "decorated-window/captionbar" : - { - style : function(states) - { - return { - decorator : states.active ? "decorated-window-captionbar-active" : "decorated-window-captionbar-inactive", - textColor : states.active ? "white" : "text-gray", - minHeight : 26, - padding : states.rtl ? [ 0, 0, 0, 2 ] : [ 0, 2, 0, 0 ] - }; - } - }, + "decorated-window" : "window", + "decorated-window/captionbar" : "window/captionbar", + "decorated-window/icon" : "window/icon", + "decorated-window/title" : "window/title", + "decorated-window/close-button" : "window/close-button", - "decorated-window/title" : - { - style : function(states) - { - return { - alignY : "middle", - font : "bold", - margin : states.rtl ? [ 0, 6, 0, 12] : [ 0, 12, 0, 6] - }; - } - }, - - "decorated-window/close-button" : - { - alias : "atom", - - style : function(states) - { - return { - icon : states.active ? states.hovered ? "decoration/window/close-active-hovered.png" : - "decoration/window/close-active.png" : - "decoration/window/close-inactive.png", - margin : states.rtl ? [ 4, 0, 2, 8 ] : [ 4, 8, 2, 0 ] - }; - } - }, - /* --------------------------------------------------------------------------- DIALOG --------------------------------------------------------------------------- */ - "dialog" : - { - style : function(states) - { - return { - shadow : "shadow-window", - contentPadding : [ 10, 10, 10, 10 ] - }; - } - }, + "dialog" : "window", - "dialog/pane" : - { - style : function(states) - { - return { - decorator : "dialog" - }; - } - }, - /* --------------------------------------------------------------------------- FRAME --------------------------------------------------------------------------- */ - "frame/icon" : - { - style : function(states) - { - return { - margin : states.rtl ? [ 5, 6, 3, 0 ] : [ 5, 0, 3, 6 ] - }; - } - }, + "frame" : "window", + "frame/minimize-button" : "window/minimize-button", + "frame/restore-button" : "window/restore-button", + "frame/maximize-button" : "window/maximize-button", /* --------------------------------------------------------------------------- Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -69,14 +69,6 @@ event : "changeUndecorated" }, - /** Should the dialog be resizable */ - resizable : - { - check : "Boolean", - init : false, - event : "changeResizable" - }, - /** Should the window be modal (this disables minimize and maximize buttons) */ modal : { @@ -117,6 +109,28 @@ { /* --------------------------------------------------------------------------- + BASIC EVENT HANDLERS + --------------------------------------------------------------------------- + */ + + /** + * Listens to the "focusout" event to deactivate the window (if the + * currently focused widget is not a child of the window) + * + * @param e {qx.event.type.Focus} focus event + */ + _onWindowFocusOut : function(e) { + // only needed for non-modal windows + if (this.getModal()) + { + return; + } + + this.base(arguments, e); + }, + + /* + --------------------------------------------------------------------------- WIDGET API --------------------------------------------------------------------------- */ 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-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/DecoratedWindow.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -39,6 +39,7 @@ * @state active Whether the window is activated * * @childControl captionbar {qx.ui.container.Composite} Container for all widgets inside the captionbar + * @childControl icon {qx.ui.basic.Image} icon at the left of the captionbar * @childControl title {qx.ui.basic.Label} caption of the window * @childControl close-button {qx.ui.form.Button} button to close the window */ @@ -69,7 +70,6 @@ // force creation of captionbar this._createChildControl("captionbar"); - this._createChildControl("pane"); // apply constructor parameters if (icon != null) { @@ -83,7 +83,7 @@ // Update captionbar this._updateCaptionBar(); - // change the reszie frames appearance + // change the resize frames appearance this._getResizeFrame().setAppearance("window-resize-frame"); }, @@ -116,14 +116,6 @@ --------------------------------------------------------------------------- */ - /** Should the window be always on top */ - alwaysOnTop : - { - check : "Boolean", - init : false, - event : "changeAlwaysOnTop" - }, - /** The text of the caption */ caption : { @@ -202,7 +194,7 @@ layout.setRowFlex(0, 1); layout.setColumnFlex(1, 1); control = new qx.ui.container.Composite(layout); - this._add(control); + this._addBefore(control, this.getChildControl("pane")); // captionbar events control.addListener("dblclick", this._onCaptionMouseDblClick, this); @@ -211,13 +203,17 @@ this._activateMoveHandle(control); break; + case "icon": + control = new qx.ui.basic.Image(this.getIcon()); + this.getChildControl("captionbar").add(control, {row: 0, column:0}); + break; + case "title": control = new qx.ui.basic.Label(this.getCaption()); control.setWidth(0); control.setAllowGrowX(true); - var captionBar = this.getChildControl("captionbar"); - captionBar.add(control, {row: 0, column:1}); + this.getChildControl("captionbar").add(control, {row: 0, column:1}); break; case "close-button": @@ -235,6 +231,18 @@ /* --------------------------------------------------------------------------- + PROPERTY APPLY ROUTINES + --------------------------------------------------------------------------- + */ + + // property apply + _applyCaptionBarChange : function(value, old) { + this._updateCaptionBar(); + }, + + + /* + --------------------------------------------------------------------------- CAPTIONBAR INTERNALS --------------------------------------------------------------------------- */ @@ -246,6 +254,14 @@ { var btn; + var icon = this.getIcon(); + if (icon) { + this.getChildControl("icon").setSource(icon); + this._showChildControl("icon"); + } else { + this._excludeChildControl("icon"); + } + var caption = this.getCaption() if (caption) { this.getChildControl("title").setValue(caption); @@ -281,9 +297,6 @@ */ _onCaptionMouseDblClick : function(e) { - if (this.getAllowMaximize()) { - this.isMaximized() ? this.restore() : this.maximize(); - } }, 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-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Frame.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -38,7 +38,6 @@ * * @state maximized Whether the window is maximized * - * @childControl icon {qx.ui.basic.Image} icon at the left of the captionbar * @childControl minimize-button {qx.ui.form.Button} button to minimize the window * @childControl restore-button {qx.ui.form.Button} button to restore the window * @childControl maximize-button {qx.ui.form.Button} button to maximize the window @@ -168,6 +167,30 @@ /* --------------------------------------------------------------------------- + DISABLE CAPTIONBAR FEATURES + --------------------------------------------------------------------------- + */ + + /** Should the user have the ability to maximize the window */ + allowMaximize : + { + check : "Boolean", + init : true, + apply : "_applyCaptionBarChange" + }, + + + /** Should the user have the ability to minimize the window */ + allowMinimize : + { + check : "Boolean", + init : true, + apply : "_applyCaptionBarChange" + }, + + + /* + --------------------------------------------------------------------------- STATUSBAR CONFIG --------------------------------------------------------------------------- */ @@ -190,6 +213,12 @@ members : { + /** {Integer} Original top value before maximation had occoured */ + __restoredTop : null, + + /** {Integer} Original left value before maximation had occoured */ + __restoredLeft : null, + // overridden /** * @lint ignoreReferenceField(_forwardStates) @@ -213,11 +242,6 @@ switch(id) { - case "icon": - control = new qx.ui.basic.Image(this.getIcon()); - this.getChildControl("captionbar").add(control, {row: 0, column:0}); - break; - case "statusbar": control = new qx.ui.container.Composite(new qx.ui.layout.HBox()); control.add(this.getStatusBar(), {flex: 1}); @@ -266,14 +290,6 @@ { var btn; - var icon = this.getIcon(); - if (icon) { - this.getChildControl("icon").setSource(icon); - this._showChildControl("icon"); - } else { - this._excludeChildControl("icon"); - } - if (this.getShowMinimize()) { this._showChildControl("minimize-button"); @@ -320,6 +336,54 @@ } }, + /** + * Set the window's position relative to its parent + * + * @param left {Integer} The left position + * @param top {Integer} The top position + */ + moveTo : function(left, top) + { + if (this.isMaximized()) { + return; + } + + this.base(arguments, left, top); + }, + + /** + * Return <code>true</code> if the window is in maximized state, + * but note that the window in maximized state could also be invisible, this + * is equivalent to minimized. So use the {@link qx.ui.window.Window#getMode} + * to get the window mode. + * + * @return {Boolean} <code>true</code> if the window is maximized, + * <code>false</code> otherwise. + */ + isMaximized : function() + { + return this.hasState("maximized"); + }, + + /** + * Return the window mode as <code>String</code>: + * <code>"maximized"</code>, <code>"normal"</code> or <code>"minimized"</code>. + * + * @return {String} The window mode as <code>String</code> value. + */ + getMode : function() + { + if(!this.isVisible()) { + return "minimized"; + } else { + if(this.isMaximized()) { + return "maximized"; + } else { + return "normal"; + } + } + }, + /* --------------------------------------------------------------------------- PROPERTY APPLY ROUTINES @@ -332,8 +396,28 @@ this._updateStatusBar(); }, + /* --------------------------------------------------------------------------- + BASIC EVENT HANDLERS + --------------------------------------------------------------------------- + */ + + /** + * Maximizes the window or restores it if it is already + * maximized. + * + * @param e {qx.event.type.Mouse} double click event + */ + _onCaptionMouseDblClick : function(e) + { + if (this.getAllowMaximize()) { + this.isMaximized() ? this.restore() : this.maximize(); + } + }, + + /* + --------------------------------------------------------------------------- EVENTS FOR CAPTIONBAR BUTTONS --------------------------------------------------------------------------- */ Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js 2011-10-09 10:41:46 UTC (rev 21529) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/window/Window.js 2011-10-09 19:35:56 UTC (rev 21530) @@ -65,6 +65,8 @@ // configure internal layout this._setLayout(new qx.ui.layout.VBox()); + this._createChildControl("pane"); + // Activation listener this.addListener("mousedown", this._onWindowMouseDown, this, true); @@ -90,6 +92,7 @@ statics : { + /** {Class} The default window manager class. */ DEFAULT_MANAGER_CLASS : qx.ui.window.Manager }, @@ -190,13 +193,6 @@ members : { - /** {Integer} Original top value before maximation had occoured */ - __restoredTop : null, - - /** {Integer} Original left value before maximation had occoured */ - __restoredLeft : null, - - /* --------------------------------------------------------------------------- WIDGET API @@ -350,16 +346,13 @@ */ moveTo : function(left, top) { - if (this.isMaximized()) { - return; - } - this.setLayoutProperties({ left : left, top : top }); }, + /* --------------------------------------------------------------------------- PROPERTY APPLY ROUTINES @@ -420,12 +413,6 @@ * @param e {qx.event.type.Focus} focus event */ _onWindowFocusOut : function(e) { - // only needed for non-modal windows - if (this.getModal()) - { - return; - } - // get the current focused widget and check if it is a child var current = e.getRelatedTarget(); if (current != null && !qx.ui.core.Widget.contains(this, current)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-09 10:41:54
|
Revision: 21529 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21529&view=rev Author: sandersson Date: 2011-10-09 10:41:46 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Window/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Window/ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/Manifest.json 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/Manifest.json 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe OptionPane Demo", + "name" : "qxe Dialog Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/config.json 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,5 +1,5 @@ { - "name" : "qxe OptionPane Demo", + "name" : "qxe Dialog Demo", "include" : [ Deleted: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,78 +0,0 @@ -/* ************************************************************************ - - qxe - qooxdoo extension framework - - Copyright: - 2010-2011 Cost Savers, http://www.cost-savers.net - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Stefan Andersson (sand) - -************************************************************************ */ - -/* ************************************************************************ - -#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) - -#asset(qxe/demo/*) - -************************************************************************ */ - -/** - * This is the main application class of your custom application "qxe" - */ -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 optionPane = new qxe.ui.dialog.OptionPane(); - - doc.add(optionPane); - } - } -}); - Copied: trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js (from rev 21528, trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js) =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Dialog/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -0,0 +1,86 @@ +/* ************************************************************************ + + 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 OptionPane" + */ +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 button = new qx.ui.form.Button("Press!"); + button.addListener("execute", function(e) { + var label = new qx.ui.basic.Label("Just a label"); + + var dialog = new qxe.ui.dialog.Dialog("Testing dialog"); + dialog.setSize(100, 100); + dialog.add(label); + dialog.show(); + + this.getApplicationRoot().add(dialog); + }, this); + + doc.add(button, {left: 100, top: 50}); + } + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/Manifest.json 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/Manifest.json 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe OptionPane Demo", + "name" : "qxe OptionDialog Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/config.json 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,5 +1,5 @@ { - "name" : "qxe OptionPane Demo", + "name" : "qxe OptionDialog Demo", "include" : [ Deleted: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,78 +0,0 @@ -/* ************************************************************************ - - qxe - qooxdoo extension framework - - Copyright: - 2010-2011 Cost Savers, http://www.cost-savers.net - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Stefan Andersson (sand) - -************************************************************************ */ - -/* ************************************************************************ - -#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) - -#asset(qxe/demo/*) - -************************************************************************ */ - -/** - * This is the main application class of your custom application "qxe" - */ -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 optionPane = new qxe.ui.dialog.OptionPane(); - - doc.add(optionPane); - } - } -}); - Copied: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js (from rev 21528, trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js) =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionDialog/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -0,0 +1,86 @@ +/* ************************************************************************ + + 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 OptionPane" + */ +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 button = new qx.ui.form.Button("Press!"); + button.addListener("execute", function(e) { + var label = new qx.ui.basic.Label("Just a label"); + + var optionDialog = new qxe.ui.dialog.OptionDialog("Testing option dialog"); + optionDialog.setSize(100, 100); + optionDialog.add(label); + optionDialog.show(); + + this.getApplicationRoot().add(optionDialog); + }, this); + + doc.add(button, {left: 100, top: 50}); + } + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-09 09:58:17 UTC (rev 21528) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -17,8 +17,6 @@ /* ************************************************************************ -#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) - #asset(qxe/demo/*) ************************************************************************ */ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Window/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/Manifest.json 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/Manifest.json 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe OptionPane Demo", + "name" : "qxe Window Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/config.json 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,5 +1,5 @@ { - "name" : "qxe OptionPane Demo", + "name" : "qxe Window Demo", "include" : [ Deleted: trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -1,78 +0,0 @@ -/* ************************************************************************ - - qxe - qooxdoo extension framework - - Copyright: - 2010-2011 Cost Savers, http://www.cost-savers.net - - License: - LGPL: http://www.gnu.org/licenses/lgpl.html - EPL: http://www.eclipse.org/org/documents/epl-v10.php - See the LICENSE file in the project's top-level directory for details. - - Authors: - * Stefan Andersson (sand) - -************************************************************************ */ - -/* ************************************************************************ - -#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) - -#asset(qxe/demo/*) - -************************************************************************ */ - -/** - * This is the main application class of your custom application "qxe" - */ -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 optionPane = new qxe.ui.dialog.OptionPane(); - - doc.add(optionPane); - } - } -}); - Copied: trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js (from rev 21528, trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js) =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js (rev 0) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Window/source/class/qxe/demo/Application.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -0,0 +1,86 @@ +/* ************************************************************************ + + 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 OptionPane" + */ +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 button = new qx.ui.form.Button("Press!"); + button.addListener("execute", function(e) { + var label = new qx.ui.basic.Label("Just a label"); + + var window = new qxe.ui.window.Window("Testing window"); + window.setSize(100, 100); + window.add(label); + window.show(); + + this.getApplicationRoot().add(window); + }, this); + + doc.add(button, {left: 100, top: 50}); + } + } +}); + Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js 2011-10-09 09:58:17 UTC (rev 21528) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/Dialog.js 2011-10-09 10:41:46 UTC (rev 21529) @@ -70,7 +70,7 @@ }, /** Should the dialog be resizable */ - resizabe : + resizable : { check : "Boolean", init : false, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-09 09:58:24
|
Revision: 21528 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21528&view=rev Author: sandersson Date: 2011-10-09 09:58:17 +0000 (Sun, 09 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-08 19:39:58 UTC (rev 21527) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-09 09:58:17 UTC (rev 21528) @@ -69,9 +69,9 @@ // Document is the application root var doc = this.getRoot(); - var optionPane = new qxe.ui.dialog.OptionPane("This is a warning!", qxe.ui.dialog.OptionPane.WARN, qxe.ui.form.ButtonPane.OK); + var optionPane = new qxe.ui.dialog.OptionPane("This is a warning!", qxe.ui.dialog.OptionPane.WARN, {OK : qxe.ui.form.ButtonPane.OK}); - doc.add(optionPane); + doc.add(optionPane, {left: 100, top: 50}); } } }); 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-10-08 19:39:58 UTC (rev 21527) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js 2011-10-09 09:58:17 UTC (rev 21528) @@ -46,6 +46,7 @@ /** * @param message {String} The message to display * @param messageType {qx.core.Object} The message type definition + * @param optionType {qx.core.Object} The option type definition */ construct : function(message, messageType, optionType) { @@ -55,24 +56,8 @@ this._setLayout(new qx.ui.layout.VBox()); this._createChildControl("pane"); -/* - if(message != null) - { - this.setMessage(message); - } -*/ + this._createPane(message, messageType, optionType); -/* - // Configure type - if (messageType != null) - { - this.setMessageType(messageType); - } - else - { - this.initMessageType(); - } -*/ }, @@ -256,6 +241,12 @@ --------------------------------------------------------------------------- */ + /** + * Create option pane. + * + * @param value {boolean} The new value. + * @param old {boolean} The old value. + */ _createPane : function(message, messageType, optionType) { if (qx.core.Environment.get("qx.debug")) @@ -271,7 +262,7 @@ if(optionType != null) { - this.getChildControl("button-pane").set(optionType); + this.getChildControl("button-pane")._import(optionType); } }, @@ -302,13 +293,33 @@ */ /** + * Setting the image. + * + * @param image {qx.ui.basic.Image} The image used. + */ + setImage : function(value) + { + this.getChildControl("image").setSource(value); + }, + + /** * Setting the message. * * @param message {String} The message to set. */ - setMessage : function(message) + setMessage : function(value) { -// this.getChildControl("message").setValue(message); + this.getChildControl("message").setValue(value || ""); + }, + + /** + * Setting the message. + * + * @param optionType {Object} The json object of buttons for a button pane. + */ + setOptionType : function(value) + { + this.getChildControl("button-pane")._import(value); } } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 19:39:58 UTC (rev 21527) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-09 09:58:17 UTC (rev 21528) @@ -155,20 +155,8 @@ { var button; var buttonPane = new qxe.ui.form.ButtonPane(json.orientation, json.spacing); + buttonPane._import(json); - for(var key in json) - { - if(json[key]) - { - button = new qx.ui.form.Button(); - button.setUserData("name", key); - button.set(json[key]); - // The set() function does not take functions with >1 parameter - // Bug: http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 - buttonPane.add(button, json[key].userData ? json[key].userData[1] : null); - } - } - return buttonPane; } }, @@ -462,6 +450,29 @@ /** * Get all constrained buttons. * + * @param json {Object} The json definition of button pane. + */ + _import : function(json) + { + var button; + + for(var key in json) + { + if(json[key]) + { + button = new qx.ui.form.Button(); + button.setUserData("name", key); + button.set(json[key]); + // The set() function does not take functions with >1 parameter + // Bug: http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 + this.add(button, json[key].userData ? json[key].userData[1] : null); + } + } + }, + + /** + * Get all constrained buttons. + * * @return {Array#map} the constrained buttons. */ _getConstraints : function() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-08 19:40:04
|
Revision: 21527 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21527&view=rev Author: sandersson Date: 2011-10-08 19:39:58 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/decoration/Modern/dialog/icon/16/message.png trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/decoration/Modern/dialog/icon/48/message.png Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-08 12:30:51 UTC (rev 21526) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-08 19:39:58 UTC (rev 21527) @@ -24,7 +24,7 @@ ************************************************************************ */ /** - * This is the main application class of your custom application "qxe" + * This is the main application class of your custom application "qxe OptionPane" */ qx.Class.define("qxe.demo.Application", { @@ -69,7 +69,7 @@ // Document is the application root var doc = this.getRoot(); - var optionPane = new qxe.ui.dialog.OptionPane(); + var optionPane = new qxe.ui.dialog.OptionPane("This is a warning!", qxe.ui.dialog.OptionPane.WARN, qxe.ui.form.ButtonPane.OK); doc.add(optionPane); } 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-10-08 12:30:51 UTC (rev 21526) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js 2011-10-08 19:39:58 UTC (rev 21527) @@ -32,7 +32,7 @@ * The following features are included in the option pane: * - predefined panes; information, warning, error and message. * - predefined buttons can be added. - * - customize label, icon message and buttons easily. + * - customize icon, label, image, message and buttons easily. * * @childControl pane {qx.ui.container.Composite} a pane which holds the content * @childControl image {qx.ui.basic.Image} an image for the pane @@ -47,7 +47,7 @@ * @param message {String} The message to display * @param messageType {qx.core.Object} The message type definition */ - construct : function(message, messageType) + construct : function(message, messageType, optionType) { this.base(arguments); @@ -55,12 +55,14 @@ this._setLayout(new qx.ui.layout.VBox()); this._createChildControl("pane"); - +/* if(message != null) { this.setMessage(message); } - +*/ + this._createPane(message, messageType, optionType); +/* // Configure type if (messageType != null) { @@ -70,6 +72,7 @@ { this.initMessageType(); } +*/ }, @@ -81,13 +84,12 @@ statics : { - // Panes + // Predefined message types /** The information pane */ INFO : { icon : "qxe/decoration/Modern/dialog/icon/16/information.png", caption : qx.locale.Manager.marktr("Information Message"), image : "qxe/decoration/Modern/dialog/icon/48/information.png", - message : null, buttons : qxe.ui.form.ButtonPane.OK }, @@ -96,7 +98,6 @@ icon : "qxe/decoration/Modern/dialog/icon/16/warning.png", caption : qx.locale.Manager.marktr("Warning Message"), image : "qxe/decoration/Modern/dialog/icon/48/warning.png", - message : null, buttons : qxe.ui.form.ButtonPane.OK }, @@ -105,7 +106,6 @@ icon : "qxe/decoration/Modern/dialog/icon/16/error.png", caption : qx.locale.Manager.marktr("Error Message"), image : "qxe/decoration/Modern/dialog/icon/48/error.png", - message : null, buttons : qxe.ui.form.ButtonPane.OK }, @@ -114,8 +114,42 @@ icon : "qxe/decoration/Modern/dialog/icon/16/message.png", caption : qx.locale.Manager.marktr("Message"), image : "qxe/decoration/Modern/dialog/icon/48/message.png", - message : null, buttons : qxe.ui.form.ButtonPane.OK + }, + + // Predefined option types + OK_HELP : { + OK : qxe.ui.form.ButtonPane.OK, + HELP : qxe.ui.form.ButtonPane.HELP + }, + + /** + * Get an instance of a button pane by definition through json. + * + * The json structure looks like this: + * { + * <option pane name> : { + * icon : "icon/16/actions/dialog-ok.png", + * caption : "Warning", + * image : qx.locale.Manager.marktr("Submit"), + * message : "", + * buttons : qxe.ui.form.ButtonPane.OK + * }, + * <option pane name> : { + * ... + * }, + * ... + * } + * + * @param json {object} The new value. + * @return {qxe.ui.dialog.OptionPane} The newly created option pane. + */ + getInstance : function(json) + { + var optionPane = new qxe.ui.dialog.OptionPane(); + optionPane.set(json); + + return optionPane; } }, @@ -169,13 +203,13 @@ var control; var layout; var widget; - var rtl = (qx.locale.Manager.getInstance().getDirection() == "right-to-left"); +//rtl var rtl = (qx.locale.Manager.getInstance().getDirection() == "right-to-left"); switch(id) { case "pane": layout = new qx.ui.layout.HBox(); - layout.setReversed(rtl); +//rtl layout.setReversed(rtl); control = new qx.ui.container.Composite(layout); @@ -206,7 +240,7 @@ break; case "button-pane": - control = new qxe.ui.form.ButtonPane(qxe.ui.form.ButtonPane.CUSTOM); + control = new qxe.ui.form.ButtonPane(); control.setMargin(5); control._getLayout().setAlignX("center"); break; @@ -218,6 +252,32 @@ /* --------------------------------------------------------------------------- + INTERNAL ROUTINES + --------------------------------------------------------------------------- + */ + + _createPane : function(message, messageType, optionType) + { + if (qx.core.Environment.get("qx.debug")) + { + if (!(messageType instanceof Object)) + { + throw new Error("No message type defined!"); + } + } + + this.getChildControl("image").setSource(messageType.image); + this.getChildControl("message").setValue(message || ""); + + if(optionType != null) + { + this.getChildControl("button-pane").set(optionType); + } + }, + + + /* + --------------------------------------------------------------------------- APPLY ROUTINES --------------------------------------------------------------------------- */ @@ -231,7 +291,7 @@ _applyMessageType : function(value, old) { this.getChildControl("image").setSource(value.image); - this.getChildControl("buttons").setType(value.buttons); + this.getChildControl("button-pane").setType(value.buttons); }, @@ -248,7 +308,7 @@ */ setMessage : function(message) { - this.getChildControl("message").setValue(message); +// this.getChildControl("message").setValue(message); } } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 12:30:51 UTC (rev 21526) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 19:39:58 UTC (rev 21527) @@ -282,7 +282,7 @@ if (value === "horizontal") { var layout = new qx.ui.layout.HBox(this.getSpacing()); - layout.setReversed(qx.locale.Manager.getInstance().getDirection() == "right-to-left"); +//rtl layout.setReversed(qx.locale.Manager.getInstance().getDirection() == "right-to-left"); this._setLayout(layout); this.setAllowStretchX(true); @@ -403,7 +403,7 @@ if(this.getConstraint()) { - index = this._constrainButton(button, constrain); + index = this._constrainButton(button, constraint); } } Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/decoration/Modern/dialog/icon/16/message.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/decoration/Modern/dialog/icon/16/message.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/decoration/Modern/dialog/icon/48/message.png =================================================================== (Binary files differ) Property changes on: trunk/qooxdoo-contrib/qxe/trunk/source/resource/qxe/decoration/Modern/dialog/icon/48/message.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-08 12:30:57
|
Revision: 21526 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21526&view=rev Author: sandersson Date: 2011-10-08 12:30:51 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-08 12:12:23 UTC (rev 21525) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-08 12:30:51 UTC (rev 21526) @@ -26,7 +26,7 @@ ************************************************************************ */ /** - * This is the main application class of your custom application "qxe" + * This is the main application class of your custom application "qxe ButtonPane" */ qx.Class.define("qxe.demo.Application", { 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-10-08 12:12:23 UTC (rev 21525) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/dialog/OptionPane.js 2011-10-08 12:30:51 UTC (rev 21526) @@ -27,8 +27,13 @@ ************************************************************************ */ /** - * An option pane. + * An option pane is an easy way of popping up a message. * + * The following features are included in the option pane: + * - predefined panes; information, warning, error and message. + * - predefined buttons can be added. + * - customize label, icon message and buttons easily. + * * @childControl pane {qx.ui.container.Composite} a pane which holds the content * @childControl image {qx.ui.basic.Image} an image for the pane * @childControl message {qx.ui.form.Label} a message for the pane This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-08 12:12:29
|
Revision: 21525 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21525&view=rev Author: sandersson Date: 2011-10-08 12:12:23 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 12:11:02 UTC (rev 21524) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 12:12:23 UTC (rev 21525) @@ -500,17 +500,15 @@ var children = this._getChildren(); var index = children.length; - if(index > 0) - { - // Then add the button to the new position according to the standard of the OS - var win = (qx.core.Environment.get("os.name") == "win"); + // Then add the button to the new position according to the standard of the OS + var win = (qx.core.Environment.get("os.name") == "win"); - if(constraint == "affirmative") - { - this._addAt(button, win ? index : 0); - } - else - { + if(constraint == "affirmative") + { + this._addAt(button, win ? index : 0); + } + else + { var constraints = this._getConstraints(); var affirmative = constraints["affirmative"]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-08 12:11:09
|
Revision: 21524 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21524&view=rev Author: sandersson Date: 2011-10-08 12:11:02 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 11:20:07 UTC (rev 21523) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 12:11:02 UTC (rev 21524) @@ -360,7 +360,7 @@ */ /** - * Adds button to buttonpane with specified constraint. + * Add button to a button pane with specified constraint. * The valid constraints are "affirmative", "cancel" and "help". * * The main purpose of the constraints is to determine how the buttons are @@ -386,8 +386,7 @@ this.__buttonOrder.push(button); } - var children = this._getChildren(); - var index = children.length; + var index = this._getChildren().length; if(constraint != null) { @@ -404,30 +403,7 @@ if(this.getConstraint()) { - var win = (qx.core.Environment.get("os.name") == "win"); - - if(constraint == "affirmative") - { - win || index == 0 ? this._addAt(button, index) : this._addBefore(button, children[0]); - } - else - { - var affirmative = constraints["affirmative"]; - - if(constraint == "cancel") - { - win && !affirmative ? this._addAt() : this._addBefore(button, win ? index - !!affirmative - 1 : index - !!affirmative - 1); - } - else - { - var cancel = (constraints["cancel"] ? 1 : 0); - - if(constraint == "help") - { - index = win ? index - affirmative - cancel - 1 : 0; - } - } - } + index = this._constrainButton(button, constrain); } } @@ -441,7 +417,9 @@ */ remove : function(button) { -// this.__buttonOrder[button] = null; + var buttonOrder = this.__buttonOrder; + buttonOrder.splice(buttonOrder.indexOf(button), 1); + this._remove(button); }, @@ -511,49 +489,59 @@ * Windows, affirmative button appears on the right hand side of cancel button. * On Mac OS X, affirmative button will appear on the left hand side of cancel button. * - * @param constraint {[ "affirmative" | "cancel" | "help" | "other" ]} The constraint for buttons. + * @param button {qx.ui.form.Button} The button to constrain. + * @param constraint {[ "affirmative" | "cancel" | "help" | "other" ]} The constraint for the button. */ - _constrainButtons : function() + _constrainButton : function(button, constraint) { -/* - var item = 0; + // First remove the button if it has been added + this.remove(button); - // Windows versions - // affirm button to the right of the cancel button. - if(qx.core.Environment.get("os.name") == "win") + var children = this._getChildren(); + var index = children.length; + + if(index > 0) { - var affirmative = constraints["affirmative"]; + // Then add the button to the new position according to the standard of the OS + var win = (qx.core.Environment.get("os.name") == "win"); - if(children.indexOf(affirmative) > 0) - { - this._remove(affirmative); - this._addAt(affirmative, 0); - } + if(constraint == "affirmative") + { + this._addAt(button, win ? index : 0); + } + else + { + var constraints = this._getConstraints(); + var affirmative = constraints["affirmative"]; - var cancel = constraints["cancel"]; - - if(children.indexOf(cancel) != -1 && children.indexOf(cancel) != 1) + if(constraint == "cancel") + { + win ? this._addAfter(button, children[index - !!affirmative]) : this._addBefore(button, children[!!affirmative]); + } + else + { + var cancel = (constraints["cancel"] ? 1 : 0); + + if(constraint == "help") { - this._remove(cancel); - this._addAt(cancel, 1 - (affirmative ? 1 : 0)); + win ? this._addAfter(button, children[index - !!affirmative - !!cancel]) : this._addBefore(button, children[!!affirmative + !!cancel]); } + } + } + }, - var help = constraints["help"]; + /** + * Re-constrain all buttons. + */ + _constrainButtons : function() + { + var children = this._getChildren(); + var l = children.length; - if(children.indexOf(help) != -1 && children.indexOf(help) != 1) - { - this._remove(help); - this._addAt(help, 2 - (affirmative ? 1 : 0) - (cancel ? 1 : 0)); - } - } - // All others osx, linux etc. - // affirm button to the left of the cancel button. - else + for(var i = 0; i < l; i++) { + this._constrainButton(children[i], children[i].getUserData("constraint")); } - - return item; -*/ }, /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-08 11:20:13
|
Revision: 21523 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21523&view=rev Author: sandersson Date: 2011-10-08 11:20:07 +0000 (Sat, 08 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-08 11:17:23 UTC (rev 21522) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-08 11:20:07 UTC (rev 21523) @@ -230,6 +230,15 @@ }; var buttonPane = new qxe.ui.form.ButtonPane.getInstance(def); + buttonPane.getButtonByName("OK").addListener("execute", function() { + alert("You pressed the OK button!"); + }, this); + buttonPane.getButtonByName("CANCEL").addListener("execute", function() { + alert("You pressed the Cancel button!"); + }, this); + buttonPane.getButtonByName("HELP").addListener("execute", function() { + alert("You pressed the Help button!"); + }, this); return buttonPane; }, Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 11:17:23 UTC (rev 21522) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-08 11:20:07 UTC (rev 21523) @@ -28,6 +28,17 @@ * A button pane is a pane with a number of buttons. It can be a standardised * button pane with preset combinations of buttons. It can also be totally customised. * All buttons are kept together in a Widget container with preset spacing. + * + * A button pane has the following features: + * - horizontal and vertical orientation + * - create from json objects + * - predefined buttons like ok, cancel, help, yes and no + * - button spacing + * - buttons kept together + * - individual button access + * - button constrain for Windows and OS/X respectively and default none (original button order) + * - button size constraint + * - add spacer between buttons */ qx.Class.define("qxe.ui.form.ButtonPane", { @@ -635,7 +646,7 @@ */ destruct : function() { - this._disposeObjects("__buttonOrder"); + this._disposeArray("__buttonOrder"); } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-10-08 11:17:30
|
Revision: 21522 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21522&view=rev Author: cboulanger Date: 2011-10-08 11:17:23 +0000 (Sat, 08 Oct 2011) Log Message: ----------- More access-related fixes Modified Paths: -------------- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Controller.php trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Service.php trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/SessionController.php Added Paths: ----------- trunk/qooxdoo-contrib/qcl-php/trunk/.buildpath trunk/qooxdoo-contrib/qcl-php/trunk/.project trunk/qooxdoo-contrib/qcl-php/trunk/.settings/ trunk/qooxdoo-contrib/qcl-php/trunk/.settings/org.eclipse.php.core.prefs Added: trunk/qooxdoo-contrib/qcl-php/trunk/.buildpath =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/.buildpath (rev 0) +++ trunk/qooxdoo-contrib/qcl-php/trunk/.buildpath 2011-10-08 11:17:23 UTC (rev 21522) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<buildpath> + <buildpathentry kind="src" path=""/> + <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/> +</buildpath> Added: trunk/qooxdoo-contrib/qcl-php/trunk/.project =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/.project (rev 0) +++ trunk/qooxdoo-contrib/qcl-php/trunk/.project 2011-10-08 11:17:23 UTC (rev 21522) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>qcl-php</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.dltk.core.scriptbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.php.core.PHPNature</nature> + </natures> +</projectDescription> Added: trunk/qooxdoo-contrib/qcl-php/trunk/.settings/org.eclipse.php.core.prefs =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/.settings/org.eclipse.php.core.prefs (rev 0) +++ trunk/qooxdoo-contrib/qcl-php/trunk/.settings/org.eclipse.php.core.prefs 2011-10-08 11:17:23 UTC (rev 21522) @@ -0,0 +1,5 @@ +#Sat Aug 21 22:19:48 CEST 2010 +eclipse.preferences.version=1 +include_path=0;/qcl-php +phpVersion=php5.3 +use_asp_tags_as_php=false Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Controller.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Controller.php 2011-10-07 22:01:14 UTC (rev 21521) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Controller.php 2011-10-08 11:17:23 UTC (rev 21522) @@ -589,48 +589,67 @@ /** * Logs out the the active user. If the user is anonymous, delete its record * in the user table. + * @param int $userId Optional user id + * @param bool $deleteAnonymous Optional flag to delete anonymous users + * after logout, defaults to true * @return bool success */ - public function logout() + public function logout( $userId, $deleteAnonymous=true ) { - /* - * check whether anyone is logged in + * get user instance */ - $activeUser = $this->getActiveUser(); - - if ( ! $activeUser ) + if ( $userId ) { - $this->log("No need to log out, nobody is logged in.", QCL_LOG_ACCESS); - return false; + $activeUser = $this->getUserModel()->load( $userId ); } + else + { + $activeUser = $this->getActiveUser(); + if ( ! $activeUser ) + { + $this->warn("Cannot log out, nobody is logged in."); + return false; + } + } $username = $activeUser->username(); $userId = $activeUser->getId(); - $sessionId = $this->getSessionId(); - - $this->log("Logging out: user '$username' user #$userId, session #$sessionId.",QCL_LOG_ACCESS ); /* * delete user data if anonymous guest */ - if ( $activeUser->isAnonymous() ) + if ( $deleteAnonymous and $activeUser->isAnonymous() ) { $activeUser->delete(); } /* - * unset active user + * if active user is concerned */ - $this->log("Deleting active user ...",QCL_LOG_ACCESS ); - $this->setActiveUser(null); - - /* - * destroy php session - */ - $this->log("Destroying session ...",QCL_LOG_ACCESS ); - $this->destroySession(); - + if ( is_null( $userId) or $userId == $this->getActiveUser()->id() ) + { + + $sessionId = $this->getSessionId(); + $this->log("Logging out: user '$username' user #$userId, session #$sessionId.",QCL_LOG_ACCESS ); + + /* + * unset active user + */ + $this->log("Deleting active user ...",QCL_LOG_ACCESS ); + $this->setActiveUser(null); + + /* + * destroy php session + */ + $this->log("Destroying session ...",QCL_LOG_ACCESS ); + $this->destroySession(); + } + else + { + $this->log("Logging out: user '$username' user #$userId",QCL_LOG_ACCESS ); + } + return true; } @@ -685,7 +704,7 @@ if ( $activeUser->getId() != $userId ) { $this->warn(sprintf( - "User %s (#%s) is already logged in, although we're about to login in user with id #%s. This should normally not be the case", + "User %s (#%s) is logged in, although we're about to login in user #%s. This should normally not be the case, log out previous user first!", $activeUser, $activeUser->id(), $userId ) ); } Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Service.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Service.php 2011-10-07 22:01:14 UTC (rev 21521) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/Service.php 2011-10-08 11:17:23 UTC (rev 21522) @@ -187,20 +187,24 @@ $accessController->registerSession(); /* - * inform subscribers + * set online status */ $activeUser= $this->getActiveUser(); - if( ! $activeUser->isAnonymous() ) + if( ! $activeUser->get("online") ) { - $this->broadcastClientMessage("qcl/access/login", array( - "fullname" => $activeUser->getName() - ), true ); + $activeUser->set("online", true)->save(); + /* + * inform subscribers + */ + if( ! $activeUser->isAnonymous() ) + { + $this->broadcastClientMessage("qcl/access/login", array( + "name" => $activeUser->getName(), + "id" => $activeUser->id() + ), true ); + } } - /* - * set online status - */ - $activeUser->set("online", true)->save(); /* * Save the IP of the user in the session to allow to check for @@ -533,21 +537,23 @@ $sessionModel = $accessController->getSessionModel(); $sessionCount = $sessionModel->countLinksWithModel( $activeUser ); $this->log( "User $activeUser has $sessionCount sessions."); - if( $sessionCount == 1 ) - { - $activeUser->set("online", false)->save(); - $this->log( "Setting user $activeUser to offline."); - } /* - * inform subscribers + * if only one user session exists, this is the final logout */ - if( ! $activeUser->isAnonymous() ) + if( $sessionCount == 1 ) { - $this->broadcastClientMessage("qcl/access/logout", array( - "fullname" => $activeUser->getName() - ), true ); - } + /* + * inform subscribers + */ + if( ! $activeUser->isAnonymous() ) + { + $this->broadcastClientMessage("qcl/access/logout", array( + "name" => $activeUser->getName(), + "id" => $activeUser->id() + ), true ); + } + } /* * handle all other logout action Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/SessionController.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/SessionController.php 2011-10-07 22:01:14 UTC (rev 21521) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/access/SessionController.php 2011-10-08 11:17:23 UTC (rev 21522) @@ -101,20 +101,26 @@ /** * Logs out a user + * @param $userId Optional id of user to logout * @return void */ - public function logout() + public function logout($userId=null) { - + /* + * logout + */ + $this->unregisterSession( $userId ); + /* * mark user as offline if no more sessions exist */ - $this->checkOnlineStatus( $this->getActiveUser()->id() ); + if ( is_null($userId) ) $userId = $this->getActiveUser()->id(); + $sessionsLeft = $this->checkOnlineStatus( $userId ); /* * logout */ - parent::logout(); + parent::logout( $userId, !$sessionsLeft ); } //------------------------------------------------------------- @@ -166,9 +172,32 @@ /** * Unregisters the current session and deletes all messages + * @param int $userId + * Optional id of user. If given and different from active user id, + * delete all of this user's sessions */ - public function unregisterSession() + public function unregisterSession( $userId=null ) { + /* + * if user is given + */ + if( ! is_null( $userId ) ) + { + try + { + $sessionModel = $this->getSessionModel(); + $sessionModel->findLinked( $this->getUserModel()->load($userId) ); + while( $sessionModel->loadNext() ) + { + $sessionModel->delete(); + } + } + catch(qcl_data_model_RecordNotFoundException $e ) + { + // + } + return; + } $sessionId = $this->getSessionId(); $this->log("Unregistering session #$sessionId.", QCL_LOG_ACCESS ); $this->getSessionModel()->unregisterSession( $sessionId ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-10-07 22:01:20
|
Revision: 21521 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21521&view=rev Author: cboulanger Date: 2011-10-07 22:01:14 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Simplified server start -> moved configuration into default settings & bootstrap Modified Paths: -------------- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/bootstrap.php trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/server/Server.php trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/config.php trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/server.php trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/test.php Removed Paths: ------------- trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/global_settings.php Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/bootstrap.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/bootstrap.php 2011-10-07 19:51:39 UTC (rev 21520) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/bootstrap.php 2011-10-07 22:01:14 UTC (rev 21521) @@ -91,6 +91,20 @@ } /* + * set include paths + */ +ini_set('include_path', implode( + PATH_SEPARATOR, + array( + RPCPHP_SERVER_PATH, + QCL_CLASS_PATH, + APPLICATION_CLASS_PATH, + ini_get("include_path") + ) +) ); + + +/* * load core functions */ require_once "qcl/core/functions.php"; Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/server/Server.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/server/Server.php 2011-10-07 19:51:39 UTC (rev 21520) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/class/qcl/server/Server.php 2011-10-07 22:01:14 UTC (rev 21521) @@ -16,7 +16,14 @@ * * Christian Boulanger (cboulanger) */ -require_once "qcl/bootstrap.php"; +/* + * bootstrap the library + */ +require_once dirname( dirname(__FILE__) ) . "/bootstrap.php"; + +/* + * import all dependencies + */ qcl_import("qcl_core_Object"); /** @@ -56,14 +63,21 @@ /** * Start a server that handles the request type (JSONRPC, POST, ...). - * @param array $servicePaths An array of paths to the services used - * by the server + * @param array $additionalServicePaths An array of paths to the services used + * by the server in addition to the qcl and application classes * @param string|null $testData If provided, use the string data as the input * request for test purposes * @return void */ - public function start( $servicePaths=array(), $testData = null ) + public function start( $additionalServicePaths = null, $testData = null ) { + if( is_array($additionalServicePaths) and count( $additionalServicePaths ) ) + { + $servicePaths = array_merge( + array( QCL_CLASS_PATH, APPLICATION_CLASS_PATH ), $additionalServicePaths + ); + } + /* * if this is a file upload, call upload method and exit */ @@ -83,7 +97,7 @@ } /* - * if POST request, use post request server extension + * if GET request, use post request server extension */ elseif ( isset( $_REQUEST['service'] ) ) { @@ -101,7 +115,7 @@ } /* - * in all cases, use qcl jsonrpc server extension + * in all other cases, use qcl jsonrpc server extension */ else { Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/config.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/config.php 2011-10-07 19:51:39 UTC (rev 21520) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/config.php 2011-10-07 22:01:14 UTC (rev 21521) @@ -65,16 +65,23 @@ */ //define( "QCL_LOG_MAX_FILESIZE" , 1024 * 500 ); +/** + * Global settings for the JSON-RPC server + */ + /* - * don't touch anything beyong this point + * accessibility needed for test.php - change to "domain" before production use */ -ini_set('include_path', implode( - PATH_SEPARATOR, - array( - RPCPHP_SERVER_PATH, - QCL_CLASS_PATH, - APPLICATION_CLASS_PATH, - ini_get("include_path") - ) -) ); +define( "defaultAccessibility", "public" ); + +/* + * whether the server should log the request + * You need this only for debugging + */ +define("JsonRpcDebug", false ); + +/* + * which file the server should log to + */ +define( "JsonRpcDebugFile", "log/server.log" ); ?> \ No newline at end of file Deleted: trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/global_settings.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/global_settings.php 2011-10-07 19:51:39 UTC (rev 21520) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/global_settings.php 2011-10-07 22:01:14 UTC (rev 21521) @@ -1,22 +0,0 @@ -<?php -/** - * Global settings for the JSON-RPC server - */ - -/* - * accessibility needed for test.php - change to "domain" before production use - */ -define( "defaultAccessibility", "public" ); - -/* - * whether the server should log the request - * You need this only for debugging - */ -define("JsonRpcDebug", false ); - -/* - * which file the server should log to - */ -define( "JsonRpcDebugFile", "log/server.log" ); - -?> \ No newline at end of file Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/server.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/server.php 2011-10-07 19:51:39 UTC (rev 21520) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/server.php 2011-10-07 22:01:14 UTC (rev 21521) @@ -32,11 +32,7 @@ require_once "qcl/server/Server.php"; /* - * Start server with paths to the service classes, i.e. - * qcl and application classes + * Start server */ -qcl_server_Server::run( array( - QCL_CLASS_PATH, - APPLICATION_CLASS_PATH -) ); +qcl_server_Server::run(); ?> \ No newline at end of file Modified: trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/test.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/test.php 2011-10-07 19:51:39 UTC (rev 21520) +++ trunk/qooxdoo-contrib/qcl-php/trunk/services/test/services/test.php 2011-10-07 22:01:14 UTC (rev 21521) @@ -54,9 +54,6 @@ * qcl and application classes */ -qcl_server_Server::run( array( - QCL_CLASS_PATH, - APPLICATION_CLASS_PATH -), $testData ); +qcl_server_Server::run(null, $testData ); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-10-07 19:51:46
|
Revision: 21520 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21520&view=rev Author: cboulanger Date: 2011-10-07 19:51:39 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Fixes Bug #5562 Modified Paths: -------------- trunk/qooxdoo-contrib/Dialog/trunk/config.json trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Confirm.js trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Form.js trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Login.js trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Select.js trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Wizard.js Modified: trunk/qooxdoo-contrib/Dialog/trunk/config.json =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/config.json 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/config.json 2011-10-07 19:51:39 UTC (rev 21520) @@ -34,7 +34,7 @@ "QOOXDOO_PATH" : "../../qooxdoo/1.5", //"QXTHEME" : "dialog.theme.modern.Theme", "QXTHEME" : "qx.theme.Modern", - "API_EXCLUDE" : ["qx.test.*", "dialog.demo.*"], + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.demo.*", "${APPLICATION}.theme.*"], "LOCALES" : [ "en","de","fr" ], "CACHE" : "${TMPDIR}/cache", "ROOT" : "." Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Confirm.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Confirm.js 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Confirm.js 2011-10-07 19:51:39 UTC (rev 21520) @@ -47,6 +47,9 @@ */ properties : { + /** + * Label used for the "yes button" + */ yesButtonLabel : { check : "String", @@ -55,6 +58,9 @@ event : "changeYesButtonLabel" }, + /** + * Icon used for the "yes button" + */ yesButtonIcon : { check : "String", @@ -63,6 +69,9 @@ event : "changeYesButtonIcon" }, + /** + * Label used for the "no button" + */ noButtonLabel : { check : "String", @@ -71,6 +80,9 @@ event : "changeNoButtonLabel" }, + /** + * Icon used for the "no button" + */ noButtonIcon : { check : "String", @@ -79,6 +91,9 @@ event : "changeNoButtonIcon" }, + /** + * This property controls the display of a cancel button + */ allowCancel : { refine : true, @@ -98,7 +113,7 @@ --------------------------------------------------------------------------- PRIVATE MEMBERS --------------------------------------------------------------------------- - */ + */ _yesButton : null, _noButton : null, @@ -143,8 +158,6 @@ this._message.setAllowStretchX(true); hbox.add( this._message, {flex:1} ); - var _this = this; - /* * Yes button */ Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Dialog.js 2011-10-07 19:51:39 UTC (rev 21520) @@ -51,7 +51,7 @@ /** * Returns a dialog instance by type - * @param type {String} + * @param type {String} The dialog type to get * @return dialog.Dialog */ getInstanceByType : function(type) @@ -92,9 +92,9 @@ /** * Shortcut for alert dialog - * @param message {String} - * @param callback {Function} - * @param context {Object} + * @param message {String} The message to display + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function */ alert : function( message, callback, context ) { @@ -106,6 +106,12 @@ })).show(); }, + /** + * Shortcut for error dialog + * @param message {String} The message to display + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function + */ error : function( message, callback, context ) { (new dialog.Alert({ @@ -116,6 +122,12 @@ })).show(); }, + /** + * Shortcut for warning dialog + * @param message {String} The message to display + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function + */ warning : function( message, callback, context ) { (new dialog.Alert({ @@ -128,9 +140,9 @@ /** * Shortcut for confirm dialog - * @param message {String} - * @param callback {Function} - * @param context {Object} + * @param message {String} The message to display + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function */ confirm : function( message, callback, context ) { @@ -146,10 +158,10 @@ * The value argument was forgotten in the initial implementation and * comes last for backwards compatibility. This might change in a future * release. - * @param message {String} - * @param callback {Function} - * @param context {Object} - * @param value {String} + * @param message {String} The message to display + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function + * @param value {String} The default value of the prompt textfield */ prompt : function( message, callback, context, value ) { @@ -163,10 +175,10 @@ /** * Shortcut for select dialog - * @param message {String} - * @param options {Array} - * @param callback {Function} - * @param context {Object} + * @param message {String} The message to display + * @param options {Array} Options to select from + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function * @param allowCancel {Boolean} Default: true */ select : function( message, options, callback, context, allowCancel ) @@ -182,10 +194,10 @@ /** * Shortcut for form dialog - * @param message {String} - * @param formData {Map} - * @param callback {Function} - * @param context {Object} + * @param message {String} The message to display + * @param formData {Map} Map of form data. See {@link dialog.Form.formData} + * @param callback {Function} The callback function + * @param context {Object} The context to use with the callback function */ form : function( message, formData, callback, context ) { @@ -426,6 +438,7 @@ */ __container : null, + __previousFocus : null, /* --------------------------------------------------------------------------- Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Form.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Form.js 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Form.js 2011-10-07 19:51:39 UTC (rev 21520) @@ -208,9 +208,10 @@ /** * Constructs the form on-the-fly - * @param formData - * @param old - * @return + * @param formData The form data map + * @param old The old value + * + * @lint ignoreDeprecated(alert,eval) */ _applyFormData : function ( formData, old ) { @@ -331,7 +332,7 @@ { formElement.setUserData("orientation", fieldData.orientation ); } - var selected = null; + //var selected = null; fieldData.options.forEach( function( item ) { var radioButton = new qx.ui.form.RadioButton( item.label ); @@ -393,7 +394,7 @@ var selectables = this.getSelectables(); selectables.forEach( function( selectable ) { - var key = this.getUserData("key"); + //var key = this.getUserData("key"); //console.warn( key +": '" + value + "' looking at '" + selectable.getLabel() + "' => " + selectable.getModel().getValue() ); if ( selectable.getModel().getValue() === value ) { @@ -413,7 +414,7 @@ "converter" : qx.lang.Function.bind( function( selection ) { var value = selection[0].getModel().getValue(); - var key = this.getUserData("key"); + //var key = this.getUserData("key"); //console.warn("Selection is " + ( selection.length ? selection[0].getLabel() : "none" ) + " -> Setting value for " + key +": " + value ); return value; }, formElement) @@ -619,8 +620,7 @@ * Default behavior: bind the enabled state of the "OK" button to the * validity of the current form. * - * @param form {qx.ui.form.Form} - * @return {void} + * @param form {qx.ui.form.Form} The form to bind */ _onFormReady : function( form ) { Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Login.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Login.js 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Login.js 2011-10-07 19:51:39 UTC (rev 21520) @@ -99,12 +99,21 @@ --------------------------------------------------------------------------- */ + /** + * Apply function used by proterty {@link #text} + * @param value {String} New value + * @param old {String} Old value + */ _applyText : function( value, old ) { this._text.setValue( value ); this._text.setVisibility( value ? "visible" : "excluded" ); }, + /** + * Apply function used by proterty {@link #textFont} + * @param value {String} New value + */ _applyTextFont : function( value ) { this._text.setFont( value ); @@ -257,10 +266,9 @@ /** * Handler function called with the result of the authentication * process. - * @param result {Boolean} + * @param result {Boolean} The state of login success * @param message {String|Null} Optional HTML message that might contain * error information, such as "Wrong password". - * @return */ _handleCheckLogin : function( result, message ) { Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Select.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Select.js 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Select.js 2011-10-07 19:51:39 UTC (rev 21520) @@ -135,6 +135,7 @@ /** * Handle click on a button. Calls callback with * the value set in the options map. + * @param value {var} The passed value */ _handleSelection : function( value ) { Modified: trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Wizard.js =================================================================== --- trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Wizard.js 2011-10-07 18:34:42 UTC (rev 21519) +++ trunk/qooxdoo-contrib/Dialog/trunk/source/class/dialog/Wizard.js 2011-10-07 19:51:39 UTC (rev 21520) @@ -214,8 +214,7 @@ /** * Add bindings to the validation manager to control the state of * the wizard buttons. - * @param form {qx.ui.form.Form} - * @return {void} + * @param form {qx.ui.form.Form} The form to bind */ _onFormReady : function( form ) { @@ -251,8 +250,8 @@ /** * Apply the page data. This initializes the response * data model - * @param pageData - * @param old + * @param pageData {Array} The new page data + * @param old {Array} The old page data * @return */ _applyPageData : function ( pageData, old ) @@ -290,9 +289,8 @@ /** * Go to a given wizard page. This recreates the * form. - * @param page {Integer} - * @param old {Integer} - * @return + * @param page {Integer} The new page + * @param old {Integer} The old page */ _applyPage : function ( page, old ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 18:34:49
|
Revision: 21519 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21519&view=rev Author: sandersson Date: 2011-10-07 18:34:42 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 18:23:59 UTC (rev 21518) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 18:34:42 UTC (rev 21519) @@ -152,7 +152,7 @@ button = new qx.ui.form.Button(); button.setUserData("name", key); button.set(json[key]); - // set does not take functions with >1 parameter + // The set() function does not take functions with >1 parameter // Bug: http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 buttonPane.add(button, json[key].userData ? json[key].userData[1] : null); } @@ -306,10 +306,22 @@ */ _applyConstraint : function(value, old) { - if(value != old) + if(value) { this._constrainButtons(); } + else + { + this.removeAll(); + + var buttonOrder = this.__buttonOrder; + + // Restore initial button order + for(var i = 0, l = this._getChildren().length; i < l; i++) + { + this.add(buttonOrder[i]); + } + } }, /** @@ -490,7 +502,7 @@ * * @param constraint {[ "affirmative" | "cancel" | "help" | "other" ]} The constraint for buttons. */ - _constrainButtons : function(constraint) + _constrainButtons : function() { /* var item = 0; @@ -615,22 +627,15 @@ } return button; - }, + } + }, - /** - * Add a spacer to the button pane. The spacer has a flex - * value of one and will stretch to the available space. - * - * @return {qx.ui.core.Spacer} The newly added spacer object. A reference - * to the spacer is needed to remove this spacer from the layout. - */ - addSpacer : function() - { - var spacer = new qx.ui.core.Spacer; - this._add(spacer, {flex : 1}); - - return spacer; - } + /** + * Destruct function. + */ + destruct : function() + { + this._disposeObjects("__buttonOrder"); } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 18:24:06
|
Revision: 21518 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21518&view=rev Author: sandersson Date: 2011-10-07 18:23:59 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-07 18:02:24 UTC (rev 21517) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-07 18:23:59 UTC (rev 21518) @@ -18,6 +18,8 @@ /* ************************************************************************ #asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-cancel.png) +#asset(qx/icon/${qx.icontheme}/16/actions/help-about.png) #asset(qxe/demo/*) @@ -82,16 +84,18 @@ doc.add(new qx.ui.basic.Label("Yes and No predefined buttons"), {left: 100, top: 185}); doc.add(this.createButtonPane4(), {left: 100, top: 200}); + doc.add(new qx.ui.basic.Label("JSON definition"), {left: 100, top: 235}); + doc.add(this.createButtonPane5(), {left: 100, top: 250}); + doc.add(new qx.ui.basic.Label("Vertical predefined buttons same width"), {left: 350, top: 35}); - doc.add(this.createButtonPane5(), {left: 350, top: 50}); + doc.add(this.createButtonPane6(), {left: 350, top: 50}); doc.add(new qx.ui.basic.Label("Vertical predefined buttons and optimized width"), {left: 350, top: 135}); - doc.add(this.createButtonPane6(), {left: 350, top: 150}); + doc.add(this.createButtonPane7(), {left: 350, top: 150}); }, createButtonPane1 : function() { - // Normal horizontal button pane var buttonPane = new qxe.ui.form.ButtonPane(); var sendB = new qx.ui.form.Button("Send", "icon/16/actions/dialog-ok.png"); @@ -122,7 +126,6 @@ createButtonPane2 : function() { - // Normal horizontal button pane with double spacing var buttonPane = new qxe.ui.form.ButtonPane(null, 8); var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); @@ -153,7 +156,6 @@ createButtonPane3 : function() { - // Horizontal button pane with constraints var buttonPane = new qxe.ui.form.ButtonPane(); buttonPane.setSizeConstraint(false); @@ -185,7 +187,6 @@ createButtonPane4 : function() { - // Horizontal button pane with constraints var buttonPane = new qxe.ui.form.ButtonPane(); var yesB = new qx.ui.form.Button(); @@ -209,7 +210,32 @@ createButtonPane5 : function() { - // Normal vertical button pane + var def = { + OK : qxe.ui.form.ButtonPane.OK, + CANCEL : { + label : qx.locale.Manager.marktr("Cancel"), + icon : "icon/16/actions/dialog-cancel.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Cancel the dialog."), + userData : [ "constraint" , "cancel" ] + }, + HELP : { + label : qx.locale.Manager.marktr("Help"), + icon : "icon/16/actions/help-about.png", + toolTip : null, + toolTipIcon : "icon/16/actions/help-about.png", + toolTipText : qx.locale.Manager.marktr("Get help about the dialog.") + } + }; + + var buttonPane = new qxe.ui.form.ButtonPane.getInstance(def); + + return buttonPane; + }, + + createButtonPane6 : function() + { var buttonPane = new qxe.ui.form.ButtonPane("vertical"); var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); @@ -238,9 +264,8 @@ return buttonPane; }, - createButtonPane6 : function() + createButtonPane7 : function() { - // Normal vertical button pane var buttonPane = new qxe.ui.form.ButtonPane("vertical"); buttonPane.setSizeConstraint(false); Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 18:02:24 UTC (rev 21517) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 18:23:59 UTC (rev 21518) @@ -123,13 +123,13 @@ * The json structure looks like this: * { * <button name> : { - * name : "SUBMIT", - * constraint : "affirm", + * constraint : "affirmative", * label : qx.locale.Manager.marktr("Submit"), * icon : "icon/16/actions/dialog-ok.png", * toolTip : null, * toolTipIcon : "icon/16/actions/help-about.png", - * toolTipText : qx.locale.Manager.marktr("Submit the dialog.") + * toolTipText : qx.locale.Manager.marktr("Submit the dialog."), + * userData : ["constraint", "affirmative"] // http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 * }, * <button name> : { * ... @@ -147,10 +147,15 @@ for(var key in json) { - button = new qx.ui.form.Button(); - button.set(json.key); - - buttonPane.add(button/*, json.key.name*/); + if(json[key]) + { + button = new qx.ui.form.Button(); + button.setUserData("name", key); + button.set(json[key]); + // set does not take functions with >1 parameter + // Bug: http://bugzilla.qooxdoo.org/show_bug.cgi?id=5692 + buttonPane.add(button, json[key].userData ? json[key].userData[1] : null); + } } return buttonPane; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cbo...@us...> - 2011-10-07 18:02:31
|
Revision: 21517 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21517&view=rev Author: cboulanger Date: 2011-10-07 18:02:24 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Backport from trunk: updated Upload script Modified Paths: -------------- trunk/qooxdoo-contrib/qcl-php/0.2/services/class/qcl/server/Upload.php Modified: trunk/qooxdoo-contrib/qcl-php/0.2/services/class/qcl/server/Upload.php =================================================================== --- trunk/qooxdoo-contrib/qcl-php/0.2/services/class/qcl/server/Upload.php 2011-10-07 16:32:24 UTC (rev 21516) +++ trunk/qooxdoo-contrib/qcl-php/0.2/services/class/qcl/server/Upload.php 2011-10-07 18:02:24 UTC (rev 21517) @@ -76,7 +76,7 @@ if ( ! is_writable( QCL_UPLOAD_PATH ) ) { $this->logError( sprintf( - "Upload path '%s' is not writeable." + "Upload path '%s' is not writeable.", QCL_UPLOAD_PATH ) ); $this->abort("Upload path is not writable"); } @@ -84,13 +84,13 @@ /* * authentication */ - if ( ! isset( $_REQUEST['sessionId'] ) ) + if ( ! isset( $_REQUEST['sessionId'] ) and ! isset( $_REQUEST['QCLSESSID'] ) ) { - $this->abort("Missing paramenter 'sessionId'"); + $this->abort("Missing session id"); } $application = $this->getApplication(); $accessController = $application->getAccessController(); - $sessionId = $_REQUEST['sessionId']; + $sessionId = either($_REQUEST['sessionId'], $_REQUEST['QCLSESSID']); try { @@ -142,10 +142,25 @@ ) ); /* - * handle all received files + * handle all received fields */ - foreach ( $_FILES as $fieldName => $file ) + $files = $_FILES; + foreach ( $files as $fieldName => $file ) { + /* + * convert string fields into array + */ + if ( ! is_array( $file['name']) ) + { + foreach( $file as $key => $value ) + { + $file[$key] = array( $value ); + } + } + + /* + * handle all received files + */ for( $i=0; $i<count( $file['name'] ); $i++ ) { @@ -306,10 +321,9 @@ $input = parent::getInput(); $input->params[] = $this->filePaths; $input->params[] = $this->fileNames; + $input->params[] = $this->error; return $input; } - - /** * Echo a HTML reply, ignored if jsonrpc request @@ -333,15 +347,14 @@ { if( $this->rpcRequest ) { - $error = new JsonRpcError($msg); - $error->sendAndExit(); - exit; + $this->error = $msg; + parent::start(); } else { echo "<span qcl_error='true'>$msg</span>"; + exit; } - } /** @@ -351,9 +364,16 @@ */ public function abort ( $msg ) { - $this->logError( $msg ); - $this->echoWarning( $msg ); - exit; + if( $this->rpcRequest ) + { + $this->error = $msg; + parent::start(); + } + else + { + echo "<span qcl_error='true'>$msg</span>"; + exit; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 16:32:30
|
Revision: 21516 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21516&view=rev Author: sandersson Date: 2011-10-07 16:32:24 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/Manifest.json 2011-10-07 16:28:12 UTC (rev 21515) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/Manifest.json 2011-10-07 16:32:24 UTC (rev 21516) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe Wizard Demo", + "name" : "qxe OptionPane Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json 2011-10-07 16:28:12 UTC (rev 21515) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/config.json 2011-10-07 16:32:24 UTC (rev 21516) @@ -1,5 +1,5 @@ { - "name" : "qxe Demo Wizard", + "name" : "qxe OptionPane Demo", "include" : [ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/source/class/qxe/demo/Application.js 2011-10-07 16:28:12 UTC (rev 21515) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/OptionPane/source/class/qxe/demo/Application.js 2011-10-07 16:32:24 UTC (rev 21516) @@ -69,21 +69,9 @@ // Document is the application root var doc = this.getRoot(); - var wizard = new qxe.ui.wizard.Wizard(); + var optionPane = new qxe.ui.dialog.OptionPane(); - var page1 = new qxe.ui.wizard.Page(); - var page2 = new qxe.ui.wizard.Page(); - var page3 = new qxe.ui.wizard.Page(); - var page4 = new qxe.ui.wizard.Page(); - var page5 = new qxe.ui.wizard.Page(); - - wizard.add(page1); - wizard.add(page2); - wizard.add(page3); - wizard.add(page4); - wizard.add(page5); - - doc.add(wizard); + doc.add(optionPane); } } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json 2011-10-07 16:28:12 UTC (rev 21515) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json 2011-10-07 16:32:24 UTC (rev 21516) @@ -1,5 +1,5 @@ { - "name" : "qxe Demo Wizard", + "name" : "qxe Wizard Demo", "include" : [ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 16:28:19
|
Revision: 21515 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21515&view=rev Author: sandersson Date: 2011-10-07 16:28:12 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/Manifest.json trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/source/class/qxe/demo/Application.js Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/Manifest.json 2011-10-07 15:00:24 UTC (rev 21514) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/Manifest.json 2011-10-07 16:28:12 UTC (rev 21515) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe Demo", + "name" : "qxe ButtonPane Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/Manifest.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/Manifest.json 2011-10-07 15:00:24 UTC (rev 21514) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/Manifest.json 2011-10-07 16:28:12 UTC (rev 21515) @@ -1,7 +1,7 @@ { "info" : { - "name" : "qxe Demo", + "name" : "qxe Wizard Demo", "summary" : "qooxdoo extension framework Demo", "description" : "Extension of the standard qooxdoo framework demo.", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json 2011-10-07 15:00:24 UTC (rev 21514) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/config.json 2011-10-07 16:28:12 UTC (rev 21515) @@ -1,5 +1,5 @@ { - "name" : "qxe Demo ButtonPane", + "name" : "qxe Demo Wizard", "include" : [ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-07 15:00:24 UTC (rev 21514) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/Wizard/source/class/qxe/demo/Application.js 2011-10-07 16:28:12 UTC (rev 21515) @@ -68,206 +68,23 @@ // Document is the application root var doc = this.getRoot(); - - // Add button to document at fixed coordinates - doc.add(new qx.ui.basic.Label("Default with custom and predefined buttons"), {left: 100, top: 35}); - doc.add(this.createButtonPane1(), {left: 100, top: 50}); - doc.add(new qx.ui.basic.Label("Spacing 8px with predefined buttons"), {left: 100, top: 85}); - doc.add(this.createButtonPane2(), {left: 100, top: 100}); + var wizard = new qxe.ui.wizard.Wizard(); - doc.add(new qx.ui.basic.Label("Button constraints with predefined buttons"), {left: 100, top: 135}); - doc.add(this.createButtonPane3(), {left: 100, top: 150}); + var page1 = new qxe.ui.wizard.Page(); + var page2 = new qxe.ui.wizard.Page(); + var page3 = new qxe.ui.wizard.Page(); + var page4 = new qxe.ui.wizard.Page(); + var page5 = new qxe.ui.wizard.Page(); - doc.add(new qx.ui.basic.Label("Yes and No predefined buttons"), {left: 100, top: 185}); - doc.add(this.createButtonPane4(), {left: 100, top: 200}); + wizard.add(page1); + wizard.add(page2); + wizard.add(page3); + wizard.add(page4); + wizard.add(page5); - doc.add(new qx.ui.basic.Label("Vertical predefined buttons same width"), {left: 350, top: 35}); - doc.add(this.createButtonPane5(), {left: 350, top: 50}); - - doc.add(new qx.ui.basic.Label("Vertical predefined buttons and optimized width"), {left: 350, top: 135}); - doc.add(this.createButtonPane6(), {left: 350, top: 150}); - }, - - createButtonPane1 : function() - { - // Normal horizontal button pane - var buttonPane = new qxe.ui.form.ButtonPane(); - - var sendB = new qx.ui.form.Button("Send", "icon/16/actions/dialog-ok.png"); - sendB.addListener("execute", function() { - alert("You pressed the Send button!"); - }, this); - - buttonPane.add(sendB); - - var cancelB = new qx.ui.form.Button(); - cancelB.set(qxe.ui.form.ButtonPane.CANCEL); - cancelB.addListener("execute", function() { - alert("You pressed the Cancel button!"); - }, this); - - buttonPane.add(cancelB); - - var helpB = new qx.ui.form.Button(); - helpB.set(qxe.ui.form.ButtonPane.HELP); - helpB.addListener("execute", function() { - alert("You pressed the Help button!"); - }, this); - - buttonPane.add(helpB); - - return buttonPane; - }, - - createButtonPane2 : function() - { - // Normal horizontal button pane with double spacing - var buttonPane = new qxe.ui.form.ButtonPane(null, 8); - - var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); - okB.addListener("execute", function() { - alert("You pressed the OK button!"); - }, this); - - buttonPane.add(okB); - - var cancelB = new qx.ui.form.Button(); - cancelB.set(qxe.ui.form.ButtonPane.CANCEL); - cancelB.addListener("execute", function() { - alert("You pressed the Cancel button!"); - }, this); - - buttonPane.add(cancelB); - - var helpB = new qx.ui.form.Button(); - helpB.set(qxe.ui.form.ButtonPane.HELP); - helpB.addListener("execute", function() { - alert("You pressed the Help button!"); - }, this); - - buttonPane.add(helpB); - - return buttonPane; - }, - - createButtonPane3 : function() - { - // Horizontal button pane with constraints - var buttonPane = new qxe.ui.form.ButtonPane(); - buttonPane.setSizeConstraint(false); - - var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); - okB.addListener("execute", function() { - alert("You pressed the OK button!"); - }, this); - - buttonPane.add(okB, "affirmative"); - - var cancelB = new qx.ui.form.Button(); - cancelB.set(qxe.ui.form.ButtonPane.CANCEL); - cancelB.addListener("execute", function() { - alert("You pressed the Cancel button!"); - }, this); - - buttonPane.add(cancelB, "cancel"); - - var helpB = new qx.ui.form.Button(); - helpB.set(qxe.ui.form.ButtonPane.HELP); - helpB.addListener("execute", function() { - alert("You pressed the Help button!"); - }, this); - - buttonPane.add(helpB, "help"); - - return buttonPane; - }, - - createButtonPane4 : function() - { - // Horizontal button pane with constraints - var buttonPane = new qxe.ui.form.ButtonPane(); - - var yesB = new qx.ui.form.Button(); - yesB.set(qxe.ui.form.ButtonPane.YES); - yesB.addListener("execute", function() { - alert("You pressed the Yes button!"); - }, this); - - buttonPane.add(yesB, "affirmative"); - - var noB = new qx.ui.form.Button(); - noB.set(qxe.ui.form.ButtonPane.NO); - noB.addListener("execute", function() { - alert("You pressed the Yes button!"); - }, this); - - buttonPane.add(noB, "cancel"); - - return buttonPane; - }, - - createButtonPane5 : function() - { - // Normal vertical button pane - var buttonPane = new qxe.ui.form.ButtonPane("vertical"); - - var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); - okB.addListener("execute", function() { - alert("You pressed the OK button!"); - }, this); - - buttonPane.add(okB); - - var cancelB = new qx.ui.form.Button(); - cancelB.set(qxe.ui.form.ButtonPane.CANCEL); - cancelB.addListener("execute", function() { - alert("You pressed the Cancel button!"); - }, this); - - buttonPane.add(cancelB); - - var helpB = new qx.ui.form.Button(); - helpB.set(qxe.ui.form.ButtonPane.HELP); - helpB.addListener("execute", function() { - alert("You pressed the Help button!"); - }, this); - - buttonPane.add(helpB); - - return buttonPane; - }, - - createButtonPane6 : function() - { - // Normal vertical button pane - var buttonPane = new qxe.ui.form.ButtonPane("vertical"); - buttonPane.setSizeConstraint(false); - - var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); - okB.addListener("execute", function() { - alert("You pressed the OK button!"); - }, this); - - buttonPane.add(okB); - - var cancelB = new qx.ui.form.Button(); - cancelB.set(qxe.ui.form.ButtonPane.CANCEL); - cancelB.addListener("execute", function() { - alert("You pressed the Cancel button!"); - }, this); - - buttonPane.add(cancelB); - - var helpB = new qx.ui.form.Button(); - helpB.set(qxe.ui.form.ButtonPane.HELP); - helpB.addListener("execute", function() { - alert("You pressed the Help button!"); - }, this); - - buttonPane.add(helpB); - - return buttonPane; + doc.add(wizard); } } }); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 15:00:36
|
Revision: 21514 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21514&view=rev Author: sandersson Date: 2011-10-07 15:00:24 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 14:53:24
|
Revision: 21513 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21513&view=rev Author: sandersson Date: 2011-10-07 14:53:18 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-07 14:12:44 UTC (rev 21512) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-07 14:53:18 UTC (rev 21513) @@ -155,6 +155,7 @@ { // Horizontal button pane with constraints var buttonPane = new qxe.ui.form.ButtonPane(); + buttonPane.setSizeConstraint(false); var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); okB.addListener("execute", function() { @@ -241,7 +242,7 @@ { // Normal vertical button pane var buttonPane = new qxe.ui.form.ButtonPane("vertical"); - buttonPane.setSizeConstraint(true); + buttonPane.setSizeConstraint(false); var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); okB.addListener("execute", function() { Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-07 14:12:44 UTC (rev 21512) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-07 14:53:18 UTC (rev 21513) @@ -5,7 +5,7 @@ qx.$$start = new Date(); if (!qx.$$environment) qx.$$environment = {}; -var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509:21511M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; +var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509:21512M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; for (var k in envinfo) qx.$$environment[k] = envinfo[k]; if (!qx.$$libraries) qx.$$libraries = {}; Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 14:12:44 UTC (rev 21512) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 14:53:18 UTC (rev 21513) @@ -213,15 +213,18 @@ /** * The size constraint of buttons making them grow to same width (false) or optimized (true). * - * Horizontal layout has optimized lengths as default while vertical layout has same lengths as default. + * qx.ui.layout.HBox has minimum width as default + * qx.ui.layout.VBox has maximum width as default. * - * true -> optimized lengths - * false -> same lengths + * This has been change for the button pane to be minimum width as default. + * + * true -> minimum width + * false -> maximum width (flex:1) */ sizeConstraint : { check : "Boolean", - init : false, + init : true, apply : "_applySizeConstraint" } }, @@ -527,35 +530,37 @@ /** * Resize the buttons according to sizeConstraint. + * + * @param value {boolean} True if size constrained. */ _sizeConstrainButtons : function(value) { var children = this._getChildren(); var len = children.length; - if(len) + if(!value && len && this.getOrientation() == "horizontal") { - if(this.getOrientation() == "horizontal") + var widest = 0; + var width; + + // Find the widest button + for(var i = 0; i < len; i++) { - var widest = 0; - var width; + width = children[i].getSizeHint().width; - // Find the widest button - for(var i = 0; i < len; i++) - { - width = children[i].getWidth(); - - widest < width ? widest = width : width; - } - - // Set all button widths to widest - for(var i = 0; i < len; i++) - { - children[i].setWidth(widest); - } + widest = widest < width ? width : widest; } - else + + // Set all button widths to widest + for(var i = 0; i < len; i++) { + children[i].setWidth(widest); + } + } + else + { + if(value && len) + { for(var i = 0, l = children.length; i < l; i++) { children[i].setAllowGrowX(!value); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-07 14:12:56
|
Revision: 21512 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21512&view=rev Author: sandersson Date: 2011-10-07 14:12:44 +0000 (Fri, 07 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Appearance.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Color.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Decoration.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Font.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.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 trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Font.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/config.json 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/config.json 2011-10-07 14:12:44 UTC (rev 21512) @@ -31,7 +31,7 @@ "APPLICATION_MAIN_CLASS" : "${APPLICATION}.demo.Demo", "QOOXDOO_PATH" : "../../../qooxdoo", //"QXTHEME" : "test.theme.modern.Theme", - "QXTHEME" : "qxe.theme.Theme", + "QXTHEME" : "qxe.theme.modern.Theme", "API_EXCLUDE" : [ "qx.test.*", "test.demo.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*" ], "LOCALES" : [ "ar", "ar_JO", "da", "de", "de_DE", "de_AT", "de_CH", "en", "en_GB", "en_US", "es", "es_MX", "es_ES", "et", "fi", "fi_FI", "is", "pt", "pt_BR", "pt_PT", "sv", "sv_SE", "sv_FI" ], "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache", Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/config.json 2011-10-07 14:12:44 UTC (rev 21512) @@ -1,5 +1,5 @@ { - "name" : "qxe Demo", + "name" : "qxe Demo ButtonPane", "include" : [ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -82,10 +82,10 @@ doc.add(new qx.ui.basic.Label("Yes and No predefined buttons"), {left: 100, top: 185}); doc.add(this.createButtonPane4(), {left: 100, top: 200}); - doc.add(new qx.ui.basic.Label("Vertical with predefined buttons same width"), {left: 350, top: 35}); + doc.add(new qx.ui.basic.Label("Vertical predefined buttons same width"), {left: 350, top: 35}); doc.add(this.createButtonPane5(), {left: 350, top: 50}); - doc.add(new qx.ui.basic.Label("Vertical with predefined buttons and optimized width"), {left: 350, top: 135}); + doc.add(new qx.ui.basic.Label("Vertical predefined buttons and optimized width"), {left: 350, top: 135}); doc.add(this.createButtonPane6(), {left: 350, top: 150}); }, @@ -193,7 +193,7 @@ alert("You pressed the Yes button!"); }, this); - buttonPane.add(yesB, "Yes"); + buttonPane.add(yesB, "affirmative"); var noB = new qx.ui.form.Button(); noB.set(qxe.ui.form.ButtonPane.NO); @@ -201,7 +201,7 @@ alert("You pressed the Yes button!"); }, this); - buttonPane.add(noB, "No"); + buttonPane.add(noB, "cancel"); return buttonPane; }, Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Appearance.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Appearance.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Appearance.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -10,9 +10,9 @@ qx.Theme.define("qxe.demo.theme.Appearance", { - extend : qx.theme.modern.Appearance, + extend : qxe.theme.modern.Appearance, appearances : { } -}); \ No newline at end of file +}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Color.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Color.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Color.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -10,9 +10,9 @@ qx.Theme.define("qxe.demo.theme.Color", { - extend : qx.theme.modern.Color, + extend : qxe.theme.modern.Color, colors : { } -}); \ No newline at end of file +}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Decoration.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Decoration.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Decoration.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -10,9 +10,9 @@ qx.Theme.define("qxe.demo.theme.Decoration", { - extend : qx.theme.modern.Decoration, + extend : qxe.theme.modern.Decoration, decorations : { } -}); \ No newline at end of file +}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Font.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/theme/Font.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -10,9 +10,9 @@ qx.Theme.define("qxe.demo.theme.Font", { - extend : qx.theme.modern.Font, + extend : qxe.theme.modern.Font, fonts : { } -}); \ No newline at end of file +}); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -5,7 +5,7 @@ qx.$$start = new Date(); if (!qx.$$environment) qx.$$environment = {}; -var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509:21510M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; +var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509:21511M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; for (var k in envinfo) qx.$$environment[k] = envinfo[k]; if (!qx.$$libraries) qx.$$libraries = {}; @@ -19,7 +19,7 @@ qx.$$loader = { parts : {"boot":[0]}, - packages : {"0":{"uris":["__out__:qxe.demo.bdadb8e5c432.js","qx:qx/Bootstrap.js","qx:qx/core/Environment.js","qx:qx/Mixin.js","qx:qx/Interface.js","qx:qx/core/Aspect.js","qx:qx/lang/Core.js","qx:qx/core/Property.js","qx:qx/Class.js","qx:qx/lang/Generics.js","qx:qx/data/MBinding.js","qx:qx/data/SingleValueBinding.js","qx:qx/lang/String.js","qx:qx/lang/Array.js","qx:qx/bom/client/Engine.js","qx:qx/lang/Type.js","qx:qx/core/Assert.js","qx:qx/type/BaseError.js","qx:qx/core/AssertionError.js","qx:qx/dev/StackTrace.js","qx:qx/lang/Function.js","qx:qx/core/MProperty.js","qx:qx/core/ObjectRegistry.js","qx:qx/core/MAssert.js","qx:qx/lang/RingBuffer.js","qx:qx/log/appender/RingBuffer.js","qx:qx/log/Logger.js","qx:qx/core/MLogging.js","qx:qx/dom/Node.js","qx:qx/bom/Event.js","qx:qx/event/Manager.js","qx:qx/event/GlobalError.js","qx:qx/core/WindowError.js","qx:qx/core/GlobalError.js","qx:qx/event/IEventHandler.js","qx:qx/event/Registration.js","qx:qx/core/MEvents.js","qx:qx/lang/JsonImpl.js","qx:qx/bom/client/Json.js","qx:qx/core/Object.js","qx:qx/util/DisposeUtil.js","qx:qx/lang/Json.js","qx:qx/event/IEventDispatcher.js","qx:qx/event/type/Event.js","qx:qx/util/ObjectPool.js","qx:qx/event/Pool.js","qx:qx/event/dispatch/Direct.js","qx:qx/event/handler/Object.js","qx:qx/event/type/Data.js","qx:qx/lang/Date.js","qx:qx/data/IListData.js","qx:qx/core/ValidationError.js","qx:qx/application/IApplication.js","qx:qx/locale/MTranslation.js","qx:qx/core/BaseInit.js","qx:qx/bom/client/OperatingSystem.js","qx:qx/event/type/Native.js","qx:qx/event/handler/Window.js","qx:qx/event/handler/Application.js","qx:qx/core/Init.js","qx:qx/application/AbstractGui.js","qx:qx/theme/manager/Meta.js","qx:qx/util/ValueManager.js","qx:qx/theme/manager/Color.js","qx:qx/util/ColorUtil.js","qx:qx/theme/manager/Decoration.js","qx:qx/ui/decoration/IDecorator.js","qx:qx/ui/decoration/Abstract.js","qx:qx/ui/decoration/DynamicDecorator.js","qx:qx/bom/element/Cursor.js","qx:qx/bom/element/Overflow.js","qx:qx/bom/element/BoxSizing.js","qx:qx/bom/Document.js","qx:qx/bom/Viewport.js","qx:qx/bom/element/Clip.js","qx:qx/bom/element/Opacity.js","qx:qx/bom/element/Style.js","qx:qx/bom/client/EcmaScript.js","qx:qx/lang/Object.js","qx:qx/util/AliasManager.js","qx:qx/theme/manager/Font.js","qx:qx/bom/Font.js","qx:qx/bom/webfonts/WebFont.js","qx:qx/bom/webfonts/Manager.js","qx:qx/bom/client/Transport.js","qx:qx/util/ResourceManager.js","qx:qx/bom/client/Browser.js","qx:qx/event/Timer.js","qx:qx/dom/Element.js","qx:qx/bom/Stylesheet.js","qx:qx/bom/client/Stylesheet.js","qx:qx/util/Uri.js","qx:qx/bom/webfonts/Validator.js","qx:qx/bom/element/Dimension.js","qx:qx/theme/manager/Icon.js","qx:qx/theme/manager/Appearance.js","qx:qx/Theme.js","qx:qx/ui/tooltip/Manager.js","qx:qx/ui/core/MChildrenHandling.js","qx:qx/ui/core/MLayoutHandling.js","qx:qx/ui/core/DecoratorFactory.js","qx:qx/util/DeferredCallManager.js","qx:qx/util/DeferredCall.js","qx:qx/html/Element.js","qx:qx/event/handler/Orientation.js","qx:qx/event/type/Orientation.js","qx:qx/bom/client/Event.js","qx:qx/event/handler/UserAction.js","qx:qx/event/handler/Touch.js","qx:qx/event/type/Dom.js","qx:qx/event/type/Touch.js","qx:qx/event/type/Tap.js","qx:qx/event/type/Swipe.js","qx:qx/event/handler/Appear.js","qx:qx/event/dispatch/AbstractBubbling.js","qx:qx/event/dispatch/DomBubbling.js","qx:qx/event/handler/Element.js","qx:qx/event/handler/Capture.js","qx:qx/event/handler/Mouse.js","qx:qx/event/type/Mouse.js","qx:qx/event/type/MouseWheel.js","qx:qx/dom/Hierarchy.js","qx:qx/bom/client/Html.js","qx:qx/event/handler/Keyboard.js","qx:qx/event/type/KeyInput.js","qx:qx/event/type/KeySequence.js","qx:qx/event/handler/Focus.js","qx:qx/bom/Selection.js","qx:qx/bom/Range.js","qx:qx/util/StringSplit.js","qx:qx/event/handler/DragDrop.js","qx:qx/event/type/Drag.js","qx:qx/event/handler/Offline.js","qx:qx/bom/Element.js","qx:qx/bom/element/Attribute.js","qx:qx/event/dispatch/MouseCapture.js","qx:qx/bom/Selector.js","qx:qx/bom/client/Plugin.js","qx:qx/xml/Document.js","qx:qx/bom/client/Xml.js","qx:qx/event/type/Focus.js","qx:qx/bom/element/Scroll.js","qx:qx/bom/element/Location.js","qx:qx/html/Decorator.js","qx:qx/ui/core/LayoutItem.js","qx:qx/ui/core/queue/Layout.js","qx:qx/ui/core/queue/Manager.js","qx:qx/ui/core/queue/Widget.js","qx:qx/ui/core/queue/Visibility.js","qx:qx/ui/core/queue/Appearance.js","qx:qx/ui/core/queue/Dispose.js","qx:qx/ui/core/Widget.js","qx:qx/ui/core/EventHandler.js","qx:qx/type/BaseString.js","qx:qx/locale/LocalizedString.js","qx:qx/locale/Manager.js","qx:qx/bom/client/Locale.js","qx:qx/ui/layout/Abstract.js","qx:qx/bom/element/Decoration.js","qx:qx/io/ImageLoader.js","qx:qx/bom/element/Background.js","qx:qx/html/Image.js","qx:qx/ui/core/MPlacement.js","qx:qx/event/Idle.js","qx:qx/util/placement/Placement.js","qx:qx/util/placement/AbstractAxis.js","qx:qx/util/placement/DirectAxis.js","qx:qx/util/placement/KeepAlignAxis.js","qx:qx/util/placement/BestFitAxis.js","qx:qx/ui/basic/Image.js","qx:qx/ui/core/DragDropCursor.js","qx:qx/ui/container/Composite.js","qx:qx/ui/popup/Popup.js","qx:qx/ui/popup/Manager.js","qx:qx/ui/tooltip/ToolTip.js","qx:qx/ui/layout/Grow.js","qx:qx/ui/basic/Atom.js","qx:qx/ui/layout/Atom.js","qx:qx/ui/layout/Util.js","qx:qx/ui/form/IStringForm.js","qx:qx/ui/basic/Label.js","qx:qx/bom/client/Css.js","qx:qx/html/Label.js","qx:qx/bom/Label.js","qx:qx/ui/form/IForm.js","qx:qx/application/Standalone.js","qx:qx/ui/window/MDesktop.js","qx:qx/ui/core/MBlocker.js","qx:qx/ui/core/Blocker.js","qx:qx/ui/root/Abstract.js","qx:qx/ui/core/FocusHandler.js","qx:qx/ui/root/Application.js","qx:qx/ui/layout/Canvas.js","qx:qx/html/Root.js","qx:qx/html/Blocker.js","qxe.demo:qxe/demo/Application.js","qx:qx/log/appender/Util.js","qx:qx/log/appender/Native.js","qx:qx/log/appender/Console.js","qxe:qxe/ui/form/ButtonPane.js","qx:qx/ui/core/MExecutable.js","qx:qx/ui/form/IExecutable.js","qx:qx/ui/form/Button.js","qx:qx/ui/layout/HBox.js","qx:qx/ui/layout/VBox.js","qx:qx/ui/core/Spacer.js","qx:qx/theme/modern/Font.js","qxe.demo:qxe/demo/theme/Font.js","qx:qx/theme/modern/Appearance.js","qxe.demo:qxe/demo/theme/Appearance.js","qx:qx/theme/icon/Tango.js","qx:qx/theme/modern/Color.js","qxe.demo:qxe/demo/theme/Color.js","qx:qx/ui/decoration/MBoxShadow.js","qx:qx/ui/decoration/MBackgroundColor.js","qx:qx/ui/decoration/MBackgroundImage.js","qx:qx/ui/decoration/MSingleBorder.js","qx:qx/ui/decoration/Single.js","qx:qx/ui/decoration/Background.js","qx:qx/ui/decoration/Uniform.js","qx:qx/ui/decoration/MDoubleBorder.js","qx:qx/ui/decoration/Beveled.js","qx:qx/ui/decoration/MLinearBackgroundGradient.js","qx:qx/ui/decoration/Grid.js","qx:qx/ui/decoration/css3/BorderImage.js","qx:qx/ui/decoration/GridDiv.js","qx:qx/ui/decoration/MBorderRadius.js","qx:qx/theme/modern/Decoration.js","qxe.demo:qxe/demo/theme/Decoration.js","qxe.demo:qxe/demo/theme/Theme.js"]}}, + packages : {"0":{"uris":["__out__:qxe.demo.bdadb8e5c432.js","qx:qx/Bootstrap.js","qx:qx/core/Environment.js","qx:qx/Mixin.js","qx:qx/Interface.js","qx:qx/core/Aspect.js","qx:qx/lang/Core.js","qx:qx/core/Property.js","qx:qx/Class.js","qx:qx/lang/Generics.js","qx:qx/data/MBinding.js","qx:qx/data/SingleValueBinding.js","qx:qx/lang/String.js","qx:qx/lang/Array.js","qx:qx/bom/client/Engine.js","qx:qx/lang/Type.js","qx:qx/core/Assert.js","qx:qx/type/BaseError.js","qx:qx/core/AssertionError.js","qx:qx/dev/StackTrace.js","qx:qx/lang/Function.js","qx:qx/core/MProperty.js","qx:qx/core/ObjectRegistry.js","qx:qx/core/MAssert.js","qx:qx/lang/RingBuffer.js","qx:qx/log/appender/RingBuffer.js","qx:qx/log/Logger.js","qx:qx/core/MLogging.js","qx:qx/dom/Node.js","qx:qx/bom/Event.js","qx:qx/event/Manager.js","qx:qx/event/GlobalError.js","qx:qx/core/WindowError.js","qx:qx/core/GlobalError.js","qx:qx/event/IEventHandler.js","qx:qx/event/Registration.js","qx:qx/core/MEvents.js","qx:qx/lang/JsonImpl.js","qx:qx/bom/client/Json.js","qx:qx/core/Object.js","qx:qx/util/DisposeUtil.js","qx:qx/lang/Json.js","qx:qx/event/IEventDispatcher.js","qx:qx/event/type/Event.js","qx:qx/util/ObjectPool.js","qx:qx/event/Pool.js","qx:qx/event/dispatch/Direct.js","qx:qx/event/handler/Object.js","qx:qx/event/type/Data.js","qx:qx/lang/Date.js","qx:qx/data/IListData.js","qx:qx/core/ValidationError.js","qx:qx/application/IApplication.js","qx:qx/locale/MTranslation.js","qx:qx/core/BaseInit.js","qx:qx/bom/client/OperatingSystem.js","qx:qx/event/type/Native.js","qx:qx/event/handler/Window.js","qx:qx/event/handler/Application.js","qx:qx/core/Init.js","qx:qx/application/AbstractGui.js","qx:qx/theme/manager/Meta.js","qx:qx/util/ValueManager.js","qx:qx/theme/manager/Color.js","qx:qx/util/ColorUtil.js","qx:qx/theme/manager/Decoration.js","qx:qx/ui/decoration/IDecorator.js","qx:qx/ui/decoration/Abstract.js","qx:qx/ui/decoration/DynamicDecorator.js","qx:qx/bom/element/Cursor.js","qx:qx/bom/element/Overflow.js","qx:qx/bom/element/BoxSizing.js","qx:qx/bom/Document.js","qx:qx/bom/Viewport.js","qx:qx/bom/element/Clip.js","qx:qx/bom/element/Opacity.js","qx:qx/bom/element/Style.js","qx:qx/bom/client/EcmaScript.js","qx:qx/lang/Object.js","qx:qx/util/AliasManager.js","qx:qx/theme/manager/Font.js","qx:qx/bom/Font.js","qx:qx/bom/webfonts/WebFont.js","qx:qx/bom/webfonts/Manager.js","qx:qx/bom/client/Transport.js","qx:qx/util/ResourceManager.js","qx:qx/bom/client/Browser.js","qx:qx/event/Timer.js","qx:qx/dom/Element.js","qx:qx/bom/Stylesheet.js","qx:qx/bom/client/Stylesheet.js","qx:qx/util/Uri.js","qx:qx/bom/webfonts/Validator.js","qx:qx/bom/element/Dimension.js","qx:qx/theme/manager/Icon.js","qx:qx/theme/manager/Appearance.js","qx:qx/Theme.js","qx:qx/ui/tooltip/Manager.js","qx:qx/ui/core/MChildrenHandling.js","qx:qx/ui/core/MLayoutHandling.js","qx:qx/ui/core/DecoratorFactory.js","qx:qx/util/DeferredCallManager.js","qx:qx/util/DeferredCall.js","qx:qx/html/Element.js","qx:qx/event/handler/Orientation.js","qx:qx/event/type/Orientation.js","qx:qx/bom/client/Event.js","qx:qx/event/handler/UserAction.js","qx:qx/event/handler/Touch.js","qx:qx/event/type/Dom.js","qx:qx/event/type/Touch.js","qx:qx/event/type/Tap.js","qx:qx/event/type/Swipe.js","qx:qx/event/handler/Appear.js","qx:qx/event/dispatch/AbstractBubbling.js","qx:qx/event/dispatch/DomBubbling.js","qx:qx/event/handler/Element.js","qx:qx/event/handler/Capture.js","qx:qx/event/handler/Mouse.js","qx:qx/event/type/Mouse.js","qx:qx/event/type/MouseWheel.js","qx:qx/dom/Hierarchy.js","qx:qx/bom/client/Html.js","qx:qx/event/handler/Keyboard.js","qx:qx/event/type/KeyInput.js","qx:qx/event/type/KeySequence.js","qx:qx/event/handler/Focus.js","qx:qx/bom/Selection.js","qx:qx/bom/Range.js","qx:qx/util/StringSplit.js","qx:qx/event/handler/DragDrop.js","qx:qx/event/type/Drag.js","qx:qx/event/handler/Offline.js","qx:qx/bom/Element.js","qx:qx/bom/element/Attribute.js","qx:qx/event/dispatch/MouseCapture.js","qx:qx/bom/Selector.js","qx:qx/bom/client/Plugin.js","qx:qx/xml/Document.js","qx:qx/bom/client/Xml.js","qx:qx/event/type/Focus.js","qx:qx/bom/element/Scroll.js","qx:qx/bom/element/Location.js","qx:qx/html/Decorator.js","qx:qx/ui/core/LayoutItem.js","qx:qx/ui/core/queue/Layout.js","qx:qx/ui/core/queue/Manager.js","qx:qx/ui/core/queue/Widget.js","qx:qx/ui/core/queue/Visibility.js","qx:qx/ui/core/queue/Appearance.js","qx:qx/ui/core/queue/Dispose.js","qx:qx/ui/core/Widget.js","qx:qx/ui/core/EventHandler.js","qx:qx/type/BaseString.js","qx:qx/locale/LocalizedString.js","qx:qx/locale/Manager.js","qx:qx/bom/client/Locale.js","qx:qx/ui/layout/Abstract.js","qx:qx/bom/element/Decoration.js","qx:qx/io/ImageLoader.js","qx:qx/bom/element/Background.js","qx:qx/html/Image.js","qx:qx/ui/core/MPlacement.js","qx:qx/event/Idle.js","qx:qx/util/placement/Placement.js","qx:qx/util/placement/AbstractAxis.js","qx:qx/util/placement/DirectAxis.js","qx:qx/util/placement/KeepAlignAxis.js","qx:qx/util/placement/BestFitAxis.js","qx:qx/ui/basic/Image.js","qx:qx/ui/core/DragDropCursor.js","qx:qx/ui/container/Composite.js","qx:qx/ui/popup/Popup.js","qx:qx/ui/popup/Manager.js","qx:qx/ui/tooltip/ToolTip.js","qx:qx/ui/layout/Grow.js","qx:qx/ui/basic/Atom.js","qx:qx/ui/layout/Atom.js","qx:qx/ui/layout/Util.js","qx:qx/ui/form/IStringForm.js","qx:qx/ui/basic/Label.js","qx:qx/bom/client/Css.js","qx:qx/html/Label.js","qx:qx/bom/Label.js","qx:qx/ui/form/IForm.js","qx:qx/application/Standalone.js","qx:qx/ui/window/MDesktop.js","qx:qx/ui/core/MBlocker.js","qx:qx/ui/core/Blocker.js","qx:qx/ui/root/Abstract.js","qx:qx/ui/core/FocusHandler.js","qx:qx/ui/root/Application.js","qx:qx/ui/layout/Canvas.js","qx:qx/html/Root.js","qx:qx/html/Blocker.js","qxe.demo:qxe/demo/Application.js","qx:qx/log/appender/Util.js","qx:qx/log/appender/Native.js","qx:qx/log/appender/Console.js","qxe:qxe/ui/form/ButtonPane.js","qx:qx/ui/core/MExecutable.js","qx:qx/ui/form/IExecutable.js","qx:qx/ui/form/Button.js","qx:qx/ui/layout/HBox.js","qx:qx/ui/layout/VBox.js","qx:qx/ui/core/Spacer.js","qx:qx/theme/modern/Font.js","qxe:qxe/theme/modern/Font.js","qxe.demo:qxe/demo/theme/Font.js","qx:qx/theme/modern/Appearance.js","qxe:qxe/theme/modern/Appearance.js","qxe.demo:qxe/demo/theme/Appearance.js","qx:qx/theme/icon/Tango.js","qx:qx/theme/modern/Color.js","qxe:qxe/theme/modern/Color.js","qxe.demo:qxe/demo/theme/Color.js","qx:qx/ui/decoration/MBoxShadow.js","qx:qx/ui/decoration/MBackgroundColor.js","qx:qx/ui/decoration/MBackgroundImage.js","qx:qx/ui/decoration/MSingleBorder.js","qx:qx/ui/decoration/Single.js","qx:qx/ui/decoration/Background.js","qx:qx/ui/decoration/Uniform.js","qx:qx/ui/decoration/MDoubleBorder.js","qx:qx/ui/decoration/Beveled.js","qx:qx/ui/decoration/MLinearBackgroundGradient.js","qx:qx/ui/decoration/Grid.js","qx:qx/ui/decoration/css3/BorderImage.js","qx:qx/ui/decoration/GridDiv.js","qx:qx/ui/decoration/MBorderRadius.js","qx:qx/theme/modern/Decoration.js","qxe:qxe/theme/modern/Decoration.js","qxe.demo:qxe/demo/theme/Decoration.js","qxe.demo:qxe/demo/theme/Theme.js"]}}, urisBefore : [], cssBefore : [], boot : "boot", 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-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/classic/Appearance.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -33,7 +33,7 @@ --------------------------------------------------------------------------- */ - "button-pane" : "widget", + "button-pane" : "widget", /* --------------------------------------------------------------------------- @@ -126,7 +126,7 @@ --------------------------------------------------------------------------- */ - "option-pane" : "widget", + "option-pane" : "widget", /* --------------------------------------------------------------------------- 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-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Appearance.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -28,6 +28,8 @@ { title : "qxe modern appearance theme", + extend : qx.theme.modern.Appearance, + appearances : { /* @@ -36,7 +38,7 @@ --------------------------------------------------------------------------- */ - "button-pane" : "widget", + "button-pane" : "widget", /* --------------------------------------------------------------------------- @@ -133,7 +135,7 @@ --------------------------------------------------------------------------- */ - "option-pane" : "widget", + "option-pane" : "widget", /* --------------------------------------------------------------------------- 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-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Color.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -17,6 +17,8 @@ qx.Theme.define("qxe.theme.modern.Color", { + extend : qx.theme.modern.Color, + colors : { } 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-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Decoration.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -17,6 +17,8 @@ qx.Theme.define("qxe.theme.modern.Decoration", { + extend : qx.theme.modern.Decoration, + decorations : { /* Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Font.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Font.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/theme/modern/Font.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -17,6 +17,8 @@ qx.Theme.define("qxe.theme.modern.Font", { + extend : qx.theme.modern.Font, + fonts : { } Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-06 16:22:40 UTC (rev 21511) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-07 14:12:44 UTC (rev 21512) @@ -198,8 +198,8 @@ * and the help button. * * true: - * windows -> buttons in following order from left to right: help > cancel > affirmative - * os/x -> buttons in following order from left to right: affirmative > cancel > help + * windows -> buttons in following order from left to right: other > help > cancel > affirmative + * os/x -> buttons in following order from left to right: affirmative > cancel > help > other * false: * all -> in the order you define them */ @@ -235,6 +235,8 @@ members : { + __buttonOrder : [], + /* --------------------------------------------------------------------------- APPLY ROUTINES @@ -314,39 +316,9 @@ */ _applySizeConstraint : function(value, old) { - if(value != old) + if(value != old && this._getChildren()) { - var children = this._getChildren(); - var len = children.length; -this.debug("v="+value+" old="+old+" c="+children.length); - - if(this.getOrientation() == "horizontal") - { - var widest = 0; - var width; - - // Find the widest button - for(var i = 0; i < len; i++) - { - width = children[i].getWidth(); - - widest < width ? widest = width : width; - } - - // Set all button widths to widest - for(var i = 0; i < len; i++) - { - children[i].setWidth(widest); - } - } - else - { - for(var i = 0, l = children.length; i < l; i++) - { - children[i].setAllowGrowX(!value); - children[i].setAllowShrinkX(value); - } - } + this.invalidateLayoutCache(); } }, @@ -358,7 +330,7 @@ /** * Adds button to buttonpane with specified constraint. - * The valid constraints are "affirmative", "cancel", "help" and "other". + * The valid constraints are "affirmative", "cancel" and "help". * * The main purpose of the constraints is to determine how the buttons are * laid out on different platforms according to the OS convention. For example, on @@ -366,7 +338,7 @@ * On Mac OS X, affirmative button will appear on the left hand side of cancel button. * * @param button {qx.ui.form.Button} The button to add. - * @param constraint {[ "affirmative" | "cancel" | "help" | "other" ]} The constraint used for the button. + * @param constraint {[ "affirmative" | "cancel" | "help" ]} The constraint used for the button. */ add : function(button, constraint) { @@ -378,13 +350,54 @@ } } - var index = this._getChildren().length; + if(this.__buttonOrder.indexOf(button) != -1) + { + this.__buttonOrder.push(button); + } - if(this.getConstraint() && constraint != null) + var children = this._getChildren(); + var index = children.length; + + if(constraint != null) { -// check valid constraints -// button.setUserData("constraint", constraint); -// index = this._constrainButtons(constraint); + var constraints = this._getConstraints(); + + if(constraint.match("affirmative|cancel|help") && !constraints[constraint]) + { + button.setUserData("constraint", constraint); + } + else + { + this.debug("Illegal or double constraint " + constraint + "."); + } + + if(this.getConstraint()) + { + var win = (qx.core.Environment.get("os.name") == "win"); + + if(constraint == "affirmative") + { + win || index == 0 ? this._addAt(button, index) : this._addBefore(button, children[0]); + } + else + { + var affirmative = constraints["affirmative"]; + + if(constraint == "cancel") + { + win && !affirmative ? this._addAt() : this._addBefore(button, win ? index - !!affirmative - 1 : index - !!affirmative - 1); + } + else + { + var cancel = (constraints["cancel"] ? 1 : 0); + + if(constraint == "help") + { + index = win ? index - affirmative - cancel - 1 : 0; + } + } + } + } } this._addAt(button, index); @@ -397,6 +410,7 @@ */ remove : function(button) { +// this.__buttonOrder[button] = null; this._remove(button); }, @@ -418,11 +432,49 @@ /* --------------------------------------------------------------------------- + LAYOUT INTERFACE + --------------------------------------------------------------------------- + */ + + // overridden + renderLayout : function(left, top, width, height) + { + this._sizeConstrainButtons(this.getSizeConstraint()); + + return this.base(arguments, left, top, width, height); + }, + + /* + --------------------------------------------------------------------------- INTERNAL ROUTINES --------------------------------------------------------------------------- */ /** + * Get all constrained buttons. + * + * @return {Array#map} the constrained buttons. + */ + _getConstraints : function() + { + var constraint; + var constraints = []; + var children = this._getChildren(); + + for(var i = 0, l = children.length; i < l; i++) + { + constraint = children[i].getUserData("constraint"); + + if(!constraints[constraint]) + { + constraints[constraint] = children[i]; + } + } + + return constraints; + }, + + /** * The main purpose of the constraints is to determine how the buttons are * laid out on different platforms according to the OS convention. For example, on * Windows, affirmative button appears on the right hand side of cancel button. @@ -432,12 +484,36 @@ */ _constrainButtons : function(constraint) { +/* var item = 0; // Windows versions // affirm button to the right of the cancel button. if(qx.core.Environment.get("os.name") == "win") { + var affirmative = constraints["affirmative"]; + + if(children.indexOf(affirmative) > 0) + { + this._remove(affirmative); + this._addAt(affirmative, 0); + } + + var cancel = constraints["cancel"]; + + if(children.indexOf(cancel) != -1 && children.indexOf(cancel) != 1) + { + this._remove(cancel); + this._addAt(cancel, 1 - (affirmative ? 1 : 0)); + } + + var help = constraints["help"]; + + if(children.indexOf(help) != -1 && children.indexOf(help) != 1) + { + this._remove(help); + this._addAt(help, 2 - (affirmative ? 1 : 0) - (cancel ? 1 : 0)); + } } // All others osx, linux etc. // affirm button to the left of the cancel button. @@ -446,9 +522,49 @@ } return item; +*/ }, + /** + * Resize the buttons according to sizeConstraint. + */ + _sizeConstrainButtons : function(value) + { + var children = this._getChildren(); + var len = children.length; + if(len) + { + if(this.getOrientation() == "horizontal") + { + var widest = 0; + var width; + + // Find the widest button + for(var i = 0; i < len; i++) + { + width = children[i].getWidth(); + + widest < width ? widest = width : width; + } + + // Set all button widths to widest + for(var i = 0; i < len; i++) + { + children[i].setWidth(widest); + } + } + else + { + for(var i = 0, l = children.length; i < l; i++) + { + children[i].setAllowGrowX(!value); + children[i].setAllowShrinkX(value); + } + } + } + }, + /* --------------------------------------------------------------------------- UTILITIES This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-06 16:22:47
|
Revision: 21511 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21511&view=rev Author: sandersson Date: 2011-10-06 16:22:40 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-06 09:52:03 UTC (rev 21510) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-06 16:22:40 UTC (rev 21511) @@ -70,10 +70,23 @@ var doc = this.getRoot(); // Add button to document at fixed coordinates + doc.add(new qx.ui.basic.Label("Default with custom and predefined buttons"), {left: 100, top: 35}); doc.add(this.createButtonPane1(), {left: 100, top: 50}); - doc.add(this.createButtonPane2(), {left: 300, top: 50}); - doc.add(this.createButtonPane3(), {left: 100, top: 100}); - doc.add(this.createButtonPane4(), {left: 300, top: 100}); + + doc.add(new qx.ui.basic.Label("Spacing 8px with predefined buttons"), {left: 100, top: 85}); + doc.add(this.createButtonPane2(), {left: 100, top: 100}); + + doc.add(new qx.ui.basic.Label("Button constraints with predefined buttons"), {left: 100, top: 135}); + doc.add(this.createButtonPane3(), {left: 100, top: 150}); + + doc.add(new qx.ui.basic.Label("Yes and No predefined buttons"), {left: 100, top: 185}); + doc.add(this.createButtonPane4(), {left: 100, top: 200}); + + doc.add(new qx.ui.basic.Label("Vertical with predefined buttons same width"), {left: 350, top: 35}); + doc.add(this.createButtonPane5(), {left: 350, top: 50}); + + doc.add(new qx.ui.basic.Label("Vertical with predefined buttons and optimized width"), {left: 350, top: 135}); + doc.add(this.createButtonPane6(), {left: 350, top: 150}); }, createButtonPane1 : function() @@ -81,12 +94,12 @@ // Normal horizontal button pane var buttonPane = new qxe.ui.form.ButtonPane(); - var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); - okB.addListener("execute", function() { - alert("You pressed the OK button!"); + var sendB = new qx.ui.form.Button("Send", "icon/16/actions/dialog-ok.png"); + sendB.addListener("execute", function() { + alert("You pressed the Send button!"); }, this); - buttonPane.add(okB); + buttonPane.add(sendB); var cancelB = new qx.ui.form.Button(); cancelB.set(qxe.ui.form.ButtonPane.CANCEL); @@ -140,6 +153,61 @@ createButtonPane3 : function() { + // Horizontal button pane with constraints + var buttonPane = new qxe.ui.form.ButtonPane(); + + var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); + okB.addListener("execute", function() { + alert("You pressed the OK button!"); + }, this); + + buttonPane.add(okB, "affirmative"); + + var cancelB = new qx.ui.form.Button(); + cancelB.set(qxe.ui.form.ButtonPane.CANCEL); + cancelB.addListener("execute", function() { + alert("You pressed the Cancel button!"); + }, this); + + buttonPane.add(cancelB, "cancel"); + + var helpB = new qx.ui.form.Button(); + helpB.set(qxe.ui.form.ButtonPane.HELP); + helpB.addListener("execute", function() { + alert("You pressed the Help button!"); + }, this); + + buttonPane.add(helpB, "help"); + + return buttonPane; + }, + + createButtonPane4 : function() + { + // Horizontal button pane with constraints + var buttonPane = new qxe.ui.form.ButtonPane(); + + var yesB = new qx.ui.form.Button(); + yesB.set(qxe.ui.form.ButtonPane.YES); + yesB.addListener("execute", function() { + alert("You pressed the Yes button!"); + }, this); + + buttonPane.add(yesB, "Yes"); + + var noB = new qx.ui.form.Button(); + noB.set(qxe.ui.form.ButtonPane.NO); + noB.addListener("execute", function() { + alert("You pressed the Yes button!"); + }, this); + + buttonPane.add(noB, "No"); + + return buttonPane; + }, + + createButtonPane5 : function() + { // Normal vertical button pane var buttonPane = new qxe.ui.form.ButtonPane("vertical"); @@ -169,17 +237,18 @@ return buttonPane; }, - createButtonPane4 : function() + createButtonPane6 : function() { - // Horizontal button pane with constraints - var buttonPane = new qxe.ui.form.ButtonPane(); + // Normal vertical button pane + var buttonPane = new qxe.ui.form.ButtonPane("vertical"); + buttonPane.setSizeConstraint(true); var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); okB.addListener("execute", function() { alert("You pressed the OK button!"); }, this); - buttonPane.add(okB, "affirmative"); + buttonPane.add(okB); var cancelB = new qx.ui.form.Button(); cancelB.set(qxe.ui.form.ButtonPane.CANCEL); @@ -187,7 +256,7 @@ alert("You pressed the Cancel button!"); }, this); - buttonPane.add(cancelB, "cancel"); + buttonPane.add(cancelB); var helpB = new qx.ui.form.Button(); helpB.set(qxe.ui.form.ButtonPane.HELP); @@ -195,7 +264,7 @@ alert("You pressed the Help button!"); }, this); - buttonPane.add(helpB, "help"); + buttonPane.add(helpB); return buttonPane; } Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-06 09:52:03 UTC (rev 21510) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-06 16:22:40 UTC (rev 21511) @@ -5,7 +5,7 @@ qx.$$start = new Date(); if (!qx.$$environment) qx.$$environment = {}; -var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; +var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509:21510M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; for (var k in envinfo) qx.$$environment[k] = envinfo[k]; if (!qx.$$libraries) qx.$$libraries = {}; @@ -19,7 +19,7 @@ qx.$$loader = { parts : {"boot":[0]}, - packages : {"0":{"uris":["__out__:qxe.demo.bdadb8e5c432.js","qx:qx/Bootstrap.js","qx:qx/core/Environment.js","qx:qx/Mixin.js","qx:qx/Interface.js","qx:qx/core/Aspect.js","qx:qx/lang/Core.js","qx:qx/core/Property.js","qx:qx/Class.js","qx:qx/lang/Generics.js","qx:qx/data/MBinding.js","qx:qx/data/SingleValueBinding.js","qx:qx/lang/String.js","qx:qx/lang/Array.js","qx:qx/bom/client/Engine.js","qx:qx/lang/Type.js","qx:qx/core/Assert.js","qx:qx/type/BaseError.js","qx:qx/core/AssertionError.js","qx:qx/dev/StackTrace.js","qx:qx/lang/Function.js","qx:qx/core/MProperty.js","qx:qx/core/ObjectRegistry.js","qx:qx/core/MAssert.js","qx:qx/lang/RingBuffer.js","qx:qx/log/appender/RingBuffer.js","qx:qx/log/Logger.js","qx:qx/core/MLogging.js","qx:qx/dom/Node.js","qx:qx/bom/Event.js","qx:qx/event/Manager.js","qx:qx/event/GlobalError.js","qx:qx/core/WindowError.js","qx:qx/core/GlobalError.js","qx:qx/event/IEventHandler.js","qx:qx/event/Registration.js","qx:qx/core/MEvents.js","qx:qx/lang/JsonImpl.js","qx:qx/bom/client/Json.js","qx:qx/core/Object.js","qx:qx/util/DisposeUtil.js","qx:qx/lang/Json.js","qx:qx/event/IEventDispatcher.js","qx:qx/event/type/Event.js","qx:qx/util/ObjectPool.js","qx:qx/event/Pool.js","qx:qx/event/dispatch/Direct.js","qx:qx/event/handler/Object.js","qx:qx/event/type/Data.js","qx:qx/lang/Date.js","qx:qx/data/IListData.js","qx:qx/core/ValidationError.js","qx:qx/application/IApplication.js","qx:qx/locale/MTranslation.js","qx:qx/core/BaseInit.js","qx:qx/bom/client/OperatingSystem.js","qx:qx/event/type/Native.js","qx:qx/event/handler/Window.js","qx:qx/event/handler/Application.js","qx:qx/core/Init.js","qx:qx/application/AbstractGui.js","qx:qx/theme/manager/Meta.js","qx:qx/util/ValueManager.js","qx:qx/theme/manager/Color.js","qx:qx/util/ColorUtil.js","qx:qx/theme/manager/Decoration.js","qx:qx/ui/decoration/IDecorator.js","qx:qx/ui/decoration/Abstract.js","qx:qx/ui/decoration/DynamicDecorator.js","qx:qx/bom/element/Cursor.js","qx:qx/bom/element/Overflow.js","qx:qx/bom/element/BoxSizing.js","qx:qx/bom/Document.js","qx:qx/bom/Viewport.js","qx:qx/bom/element/Clip.js","qx:qx/bom/element/Opacity.js","qx:qx/bom/element/Style.js","qx:qx/bom/client/EcmaScript.js","qx:qx/lang/Object.js","qx:qx/util/AliasManager.js","qx:qx/theme/manager/Font.js","qx:qx/bom/Font.js","qx:qx/bom/webfonts/WebFont.js","qx:qx/bom/webfonts/Manager.js","qx:qx/bom/client/Transport.js","qx:qx/util/ResourceManager.js","qx:qx/bom/client/Browser.js","qx:qx/event/Timer.js","qx:qx/dom/Element.js","qx:qx/bom/Stylesheet.js","qx:qx/bom/client/Stylesheet.js","qx:qx/util/Uri.js","qx:qx/bom/webfonts/Validator.js","qx:qx/bom/element/Dimension.js","qx:qx/theme/manager/Icon.js","qx:qx/theme/manager/Appearance.js","qx:qx/Theme.js","qx:qx/ui/tooltip/Manager.js","qx:qx/ui/core/MChildrenHandling.js","qx:qx/ui/core/MLayoutHandling.js","qx:qx/ui/core/DecoratorFactory.js","qx:qx/util/DeferredCallManager.js","qx:qx/util/DeferredCall.js","qx:qx/html/Element.js","qx:qx/event/handler/Orientation.js","qx:qx/event/type/Orientation.js","qx:qx/bom/client/Event.js","qx:qx/event/handler/UserAction.js","qx:qx/event/handler/Touch.js","qx:qx/event/type/Dom.js","qx:qx/event/type/Touch.js","qx:qx/event/type/Tap.js","qx:qx/event/type/Swipe.js","qx:qx/event/handler/Appear.js","qx:qx/event/dispatch/AbstractBubbling.js","qx:qx/event/dispatch/DomBubbling.js","qx:qx/event/handler/Element.js","qx:qx/event/handler/Capture.js","qx:qx/event/handler/Mouse.js","qx:qx/event/type/Mouse.js","qx:qx/event/type/MouseWheel.js","qx:qx/dom/Hierarchy.js","qx:qx/bom/client/Html.js","qx:qx/event/handler/Keyboard.js","qx:qx/event/type/KeyInput.js","qx:qx/event/type/KeySequence.js","qx:qx/event/handler/Focus.js","qx:qx/bom/Selection.js","qx:qx/bom/Range.js","qx:qx/util/StringSplit.js","qx:qx/event/handler/DragDrop.js","qx:qx/event/type/Drag.js","qx:qx/event/handler/Offline.js","qx:qx/bom/Element.js","qx:qx/bom/element/Attribute.js","qx:qx/event/dispatch/MouseCapture.js","qx:qx/bom/Selector.js","qx:qx/bom/client/Plugin.js","qx:qx/xml/Document.js","qx:qx/bom/client/Xml.js","qx:qx/event/type/Focus.js","qx:qx/bom/element/Scroll.js","qx:qx/bom/element/Location.js","qx:qx/html/Decorator.js","qx:qx/ui/core/LayoutItem.js","qx:qx/ui/core/queue/Layout.js","qx:qx/ui/core/queue/Manager.js","qx:qx/ui/core/queue/Widget.js","qx:qx/ui/core/queue/Visibility.js","qx:qx/ui/core/queue/Appearance.js","qx:qx/ui/core/queue/Dispose.js","qx:qx/ui/core/Widget.js","qx:qx/ui/core/EventHandler.js","qx:qx/type/BaseString.js","qx:qx/locale/LocalizedString.js","qx:qx/locale/Manager.js","qx:qx/bom/client/Locale.js","qx:qx/ui/layout/Abstract.js","qx:qx/bom/element/Decoration.js","qx:qx/io/ImageLoader.js","qx:qx/bom/element/Background.js","qx:qx/html/Image.js","qx:qx/ui/core/MPlacement.js","qx:qx/event/Idle.js","qx:qx/util/placement/Placement.js","qx:qx/util/placement/AbstractAxis.js","qx:qx/util/placement/DirectAxis.js","qx:qx/util/placement/KeepAlignAxis.js","qx:qx/util/placement/BestFitAxis.js","qx:qx/ui/basic/Image.js","qx:qx/ui/core/DragDropCursor.js","qx:qx/ui/container/Composite.js","qx:qx/ui/popup/Popup.js","qx:qx/ui/popup/Manager.js","qx:qx/ui/tooltip/ToolTip.js","qx:qx/ui/layout/Grow.js","qx:qx/ui/basic/Atom.js","qx:qx/ui/layout/Atom.js","qx:qx/ui/layout/Util.js","qx:qx/ui/form/IStringForm.js","qx:qx/ui/basic/Label.js","qx:qx/bom/client/Css.js","qx:qx/html/Label.js","qx:qx/bom/Label.js","qx:qx/ui/form/IForm.js","qx:qx/application/Standalone.js","qx:qx/ui/window/MDesktop.js","qx:qx/ui/core/MBlocker.js","qx:qx/ui/core/Blocker.js","qx:qx/ui/root/Abstract.js","qx:qx/ui/core/FocusHandler.js","qx:qx/ui/root/Application.js","qx:qx/ui/layout/Canvas.js","qx:qx/html/Root.js","qx:qx/html/Blocker.js","qxe.demo:qxe/demo/Application.js","qx:qx/log/appender/Util.js","qx:qx/log/appender/Native.js","qx:qx/log/appender/Console.js","qxe:qxe/ui/form/ButtonPane.js","qx:qx/ui/layout/HBox.js","qx:qx/ui/layout/VBox.js","qx:qx/ui/core/MExecutable.js","qx:qx/ui/form/IExecutable.js","qx:qx/ui/form/Button.js","qx:qx/ui/core/Spacer.js","qx:qx/theme/modern/Font.js","qxe.demo:qxe/demo/theme/Font.js","qx:qx/theme/modern/Appearance.js","qxe.demo:qxe/demo/theme/Appearance.js","qx:qx/theme/icon/Tango.js","qx:qx/theme/modern/Color.js","qxe.demo:qxe/demo/theme/Color.js","qx:qx/ui/decoration/MBoxShadow.js","qx:qx/ui/decoration/MBackgroundColor.js","qx:qx/ui/decoration/MBackgroundImage.js","qx:qx/ui/decoration/MSingleBorder.js","qx:qx/ui/decoration/Single.js","qx:qx/ui/decoration/Background.js","qx:qx/ui/decoration/Uniform.js","qx:qx/ui/decoration/MDoubleBorder.js","qx:qx/ui/decoration/Beveled.js","qx:qx/ui/decoration/MLinearBackgroundGradient.js","qx:qx/ui/decoration/Grid.js","qx:qx/ui/decoration/css3/BorderImage.js","qx:qx/ui/decoration/GridDiv.js","qx:qx/ui/decoration/MBorderRadius.js","qx:qx/theme/modern/Decoration.js","qxe.demo:qxe/demo/theme/Decoration.js","qxe.demo:qxe/demo/theme/Theme.js"]}}, + packages : {"0":{"uris":["__out__:qxe.demo.bdadb8e5c432.js","qx:qx/Bootstrap.js","qx:qx/core/Environment.js","qx:qx/Mixin.js","qx:qx/Interface.js","qx:qx/core/Aspect.js","qx:qx/lang/Core.js","qx:qx/core/Property.js","qx:qx/Class.js","qx:qx/lang/Generics.js","qx:qx/data/MBinding.js","qx:qx/data/SingleValueBinding.js","qx:qx/lang/String.js","qx:qx/lang/Array.js","qx:qx/bom/client/Engine.js","qx:qx/lang/Type.js","qx:qx/core/Assert.js","qx:qx/type/BaseError.js","qx:qx/core/AssertionError.js","qx:qx/dev/StackTrace.js","qx:qx/lang/Function.js","qx:qx/core/MProperty.js","qx:qx/core/ObjectRegistry.js","qx:qx/core/MAssert.js","qx:qx/lang/RingBuffer.js","qx:qx/log/appender/RingBuffer.js","qx:qx/log/Logger.js","qx:qx/core/MLogging.js","qx:qx/dom/Node.js","qx:qx/bom/Event.js","qx:qx/event/Manager.js","qx:qx/event/GlobalError.js","qx:qx/core/WindowError.js","qx:qx/core/GlobalError.js","qx:qx/event/IEventHandler.js","qx:qx/event/Registration.js","qx:qx/core/MEvents.js","qx:qx/lang/JsonImpl.js","qx:qx/bom/client/Json.js","qx:qx/core/Object.js","qx:qx/util/DisposeUtil.js","qx:qx/lang/Json.js","qx:qx/event/IEventDispatcher.js","qx:qx/event/type/Event.js","qx:qx/util/ObjectPool.js","qx:qx/event/Pool.js","qx:qx/event/dispatch/Direct.js","qx:qx/event/handler/Object.js","qx:qx/event/type/Data.js","qx:qx/lang/Date.js","qx:qx/data/IListData.js","qx:qx/core/ValidationError.js","qx:qx/application/IApplication.js","qx:qx/locale/MTranslation.js","qx:qx/core/BaseInit.js","qx:qx/bom/client/OperatingSystem.js","qx:qx/event/type/Native.js","qx:qx/event/handler/Window.js","qx:qx/event/handler/Application.js","qx:qx/core/Init.js","qx:qx/application/AbstractGui.js","qx:qx/theme/manager/Meta.js","qx:qx/util/ValueManager.js","qx:qx/theme/manager/Color.js","qx:qx/util/ColorUtil.js","qx:qx/theme/manager/Decoration.js","qx:qx/ui/decoration/IDecorator.js","qx:qx/ui/decoration/Abstract.js","qx:qx/ui/decoration/DynamicDecorator.js","qx:qx/bom/element/Cursor.js","qx:qx/bom/element/Overflow.js","qx:qx/bom/element/BoxSizing.js","qx:qx/bom/Document.js","qx:qx/bom/Viewport.js","qx:qx/bom/element/Clip.js","qx:qx/bom/element/Opacity.js","qx:qx/bom/element/Style.js","qx:qx/bom/client/EcmaScript.js","qx:qx/lang/Object.js","qx:qx/util/AliasManager.js","qx:qx/theme/manager/Font.js","qx:qx/bom/Font.js","qx:qx/bom/webfonts/WebFont.js","qx:qx/bom/webfonts/Manager.js","qx:qx/bom/client/Transport.js","qx:qx/util/ResourceManager.js","qx:qx/bom/client/Browser.js","qx:qx/event/Timer.js","qx:qx/dom/Element.js","qx:qx/bom/Stylesheet.js","qx:qx/bom/client/Stylesheet.js","qx:qx/util/Uri.js","qx:qx/bom/webfonts/Validator.js","qx:qx/bom/element/Dimension.js","qx:qx/theme/manager/Icon.js","qx:qx/theme/manager/Appearance.js","qx:qx/Theme.js","qx:qx/ui/tooltip/Manager.js","qx:qx/ui/core/MChildrenHandling.js","qx:qx/ui/core/MLayoutHandling.js","qx:qx/ui/core/DecoratorFactory.js","qx:qx/util/DeferredCallManager.js","qx:qx/util/DeferredCall.js","qx:qx/html/Element.js","qx:qx/event/handler/Orientation.js","qx:qx/event/type/Orientation.js","qx:qx/bom/client/Event.js","qx:qx/event/handler/UserAction.js","qx:qx/event/handler/Touch.js","qx:qx/event/type/Dom.js","qx:qx/event/type/Touch.js","qx:qx/event/type/Tap.js","qx:qx/event/type/Swipe.js","qx:qx/event/handler/Appear.js","qx:qx/event/dispatch/AbstractBubbling.js","qx:qx/event/dispatch/DomBubbling.js","qx:qx/event/handler/Element.js","qx:qx/event/handler/Capture.js","qx:qx/event/handler/Mouse.js","qx:qx/event/type/Mouse.js","qx:qx/event/type/MouseWheel.js","qx:qx/dom/Hierarchy.js","qx:qx/bom/client/Html.js","qx:qx/event/handler/Keyboard.js","qx:qx/event/type/KeyInput.js","qx:qx/event/type/KeySequence.js","qx:qx/event/handler/Focus.js","qx:qx/bom/Selection.js","qx:qx/bom/Range.js","qx:qx/util/StringSplit.js","qx:qx/event/handler/DragDrop.js","qx:qx/event/type/Drag.js","qx:qx/event/handler/Offline.js","qx:qx/bom/Element.js","qx:qx/bom/element/Attribute.js","qx:qx/event/dispatch/MouseCapture.js","qx:qx/bom/Selector.js","qx:qx/bom/client/Plugin.js","qx:qx/xml/Document.js","qx:qx/bom/client/Xml.js","qx:qx/event/type/Focus.js","qx:qx/bom/element/Scroll.js","qx:qx/bom/element/Location.js","qx:qx/html/Decorator.js","qx:qx/ui/core/LayoutItem.js","qx:qx/ui/core/queue/Layout.js","qx:qx/ui/core/queue/Manager.js","qx:qx/ui/core/queue/Widget.js","qx:qx/ui/core/queue/Visibility.js","qx:qx/ui/core/queue/Appearance.js","qx:qx/ui/core/queue/Dispose.js","qx:qx/ui/core/Widget.js","qx:qx/ui/core/EventHandler.js","qx:qx/type/BaseString.js","qx:qx/locale/LocalizedString.js","qx:qx/locale/Manager.js","qx:qx/bom/client/Locale.js","qx:qx/ui/layout/Abstract.js","qx:qx/bom/element/Decoration.js","qx:qx/io/ImageLoader.js","qx:qx/bom/element/Background.js","qx:qx/html/Image.js","qx:qx/ui/core/MPlacement.js","qx:qx/event/Idle.js","qx:qx/util/placement/Placement.js","qx:qx/util/placement/AbstractAxis.js","qx:qx/util/placement/DirectAxis.js","qx:qx/util/placement/KeepAlignAxis.js","qx:qx/util/placement/BestFitAxis.js","qx:qx/ui/basic/Image.js","qx:qx/ui/core/DragDropCursor.js","qx:qx/ui/container/Composite.js","qx:qx/ui/popup/Popup.js","qx:qx/ui/popup/Manager.js","qx:qx/ui/tooltip/ToolTip.js","qx:qx/ui/layout/Grow.js","qx:qx/ui/basic/Atom.js","qx:qx/ui/layout/Atom.js","qx:qx/ui/layout/Util.js","qx:qx/ui/form/IStringForm.js","qx:qx/ui/basic/Label.js","qx:qx/bom/client/Css.js","qx:qx/html/Label.js","qx:qx/bom/Label.js","qx:qx/ui/form/IForm.js","qx:qx/application/Standalone.js","qx:qx/ui/window/MDesktop.js","qx:qx/ui/core/MBlocker.js","qx:qx/ui/core/Blocker.js","qx:qx/ui/root/Abstract.js","qx:qx/ui/core/FocusHandler.js","qx:qx/ui/root/Application.js","qx:qx/ui/layout/Canvas.js","qx:qx/html/Root.js","qx:qx/html/Blocker.js","qxe.demo:qxe/demo/Application.js","qx:qx/log/appender/Util.js","qx:qx/log/appender/Native.js","qx:qx/log/appender/Console.js","qxe:qxe/ui/form/ButtonPane.js","qx:qx/ui/core/MExecutable.js","qx:qx/ui/form/IExecutable.js","qx:qx/ui/form/Button.js","qx:qx/ui/layout/HBox.js","qx:qx/ui/layout/VBox.js","qx:qx/ui/core/Spacer.js","qx:qx/theme/modern/Font.js","qxe.demo:qxe/demo/theme/Font.js","qx:qx/theme/modern/Appearance.js","qxe.demo:qxe/demo/theme/Appearance.js","qx:qx/theme/icon/Tango.js","qx:qx/theme/modern/Color.js","qxe.demo:qxe/demo/theme/Color.js","qx:qx/ui/decoration/MBoxShadow.js","qx:qx/ui/decoration/MBackgroundColor.js","qx:qx/ui/decoration/MBackgroundImage.js","qx:qx/ui/decoration/MSingleBorder.js","qx:qx/ui/decoration/Single.js","qx:qx/ui/decoration/Background.js","qx:qx/ui/decoration/Uniform.js","qx:qx/ui/decoration/MDoubleBorder.js","qx:qx/ui/decoration/Beveled.js","qx:qx/ui/decoration/MLinearBackgroundGradient.js","qx:qx/ui/decoration/Grid.js","qx:qx/ui/decoration/css3/BorderImage.js","qx:qx/ui/decoration/GridDiv.js","qx:qx/ui/decoration/MBorderRadius.js","qx:qx/theme/modern/Decoration.js","qxe.demo:qxe/demo/theme/Decoration.js","qxe.demo:qxe/demo/theme/Theme.js"]}}, urisBefore : [], cssBefore : [], boot : "boot", Modified: trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-06 09:52:03 UTC (rev 21510) +++ trunk/qooxdoo-contrib/qxe/trunk/source/class/qxe/ui/form/ButtonPane.js 2011-10-06 16:22:40 UTC (rev 21511) @@ -115,6 +115,45 @@ toolTip : null, toolTipIcon : "icon/16/actions/help-about.png", toolTipText : qx.locale.Manager.marktr("Answer no to the dialog.") + }, + + /** + * Get an instance of a button pane by definition through json. + * + * The json structure looks like this: + * { + * <button name> : { + * name : "SUBMIT", + * constraint : "affirm", + * label : qx.locale.Manager.marktr("Submit"), + * icon : "icon/16/actions/dialog-ok.png", + * toolTip : null, + * toolTipIcon : "icon/16/actions/help-about.png", + * toolTipText : qx.locale.Manager.marktr("Submit the dialog.") + * }, + * <button name> : { + * ... + * }, + * ... + * } + * + * @param json {object} The new value. + * @return {qxe.ui.form.ButtonPane} The newly created button pane. + */ + getInstance : function(json) + { + var button; + var buttonPane = new qxe.ui.form.ButtonPane(json.orientation, json.spacing); + + for(var key in json) + { + button = new qx.ui.form.Button(); + button.set(json.key); + + buttonPane.add(button/*, json.key.name*/); + } + + return buttonPane; } }, @@ -155,14 +194,34 @@ }, /** - * Sets the size constraint. Valid values are "less" and "same". - * The size constraint will apply to all components except if the component client property - * growX or growY set to true. + * The constraint of buttons positioning affirmative button to the right or left of the cancel button + * and the help button. + * + * true: + * windows -> buttons in following order from left to right: help > cancel > affirmative + * os/x -> buttons in following order from left to right: affirmative > cancel > help + * false: + * all -> in the order you define them */ + constraint : + { + check : "Boolean", + init : false, + apply : "_applyConstraint" + }, + + /** + * The size constraint of buttons making them grow to same width (false) or optimized (true). + * + * Horizontal layout has optimized lengths as default while vertical layout has same lengths as default. + * + * true -> optimized lengths + * false -> same lengths + */ sizeConstraint : { - check : ["same", "less"], - init : "same", + check : "Boolean", + init : false, apply : "_applySizeConstraint" } }, @@ -230,13 +289,65 @@ }, /** + * Apply method for constraint. + * + * @param value {boolean} The new value. + * @param old {boolean} The old value. + */ + _applyConstraint : function(value, old) + { + if(value != old) + { + this._constrainButtons(); + } + }, + + /** * Apply method for size constraint. * + * Horizontal layout has optimized lengths as default while vertical layout has same lengths as default. + * * @param value {boolean} The new value. + * true -> optimized lengths + * false -> same lengths * @param old {boolean} The old value. */ _applySizeConstraint : function(value, old) { + if(value != old) + { + var children = this._getChildren(); + var len = children.length; +this.debug("v="+value+" old="+old+" c="+children.length); + + if(this.getOrientation() == "horizontal") + { + var widest = 0; + var width; + + // Find the widest button + for(var i = 0; i < len; i++) + { + width = children[i].getWidth(); + + widest < width ? widest = width : width; + } + + // Set all button widths to widest + for(var i = 0; i < len; i++) + { + children[i].setWidth(widest); + } + } + else + { + for(var i = 0, l = children.length; i < l; i++) + { + children[i].setAllowGrowX(!value); + children[i].setAllowShrinkX(value); + } + } + } }, /* @@ -269,7 +380,7 @@ var index = this._getChildren().length; - if(constraint != null) + if(this.getConstraint() && constraint != null) { // check valid constraints // button.setUserData("constraint", constraint); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-06 09:52:11
|
Revision: 21510 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21510&view=rev Author: sandersson Date: 2011-10-06 09:52:03 +0000 (Thu, 06 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/widget/ Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-05 15:04:48 UTC (rev 21509) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/class/qxe/demo/Application.js 2011-10-06 09:52:03 UTC (rev 21510) @@ -1,15 +1,24 @@ /* ************************************************************************ + qxe - qooxdoo extension framework + Copyright: + 2010-2011 Cost Savers, http://www.cost-savers.net License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL: http://www.eclipse.org/org/documents/epl-v10.php + See the LICENSE file in the project's top-level directory for details. Authors: + * Stefan Andersson (sand) ************************************************************************ */ /* ************************************************************************ +#asset(qx/icon/${qx.icontheme}/16/actions/dialog-ok.png) + #asset(qxe/demo/*) ************************************************************************ */ @@ -57,19 +66,138 @@ ------------------------------------------------------------------------- */ - // Create a button - var button1 = new qxe.Contribution("First Contribution", "qxe/test.png"); - // Document is the application root var doc = this.getRoot(); // Add button to document at fixed coordinates - doc.add(button1, {left: 100, top: 50}); + doc.add(this.createButtonPane1(), {left: 100, top: 50}); + doc.add(this.createButtonPane2(), {left: 300, top: 50}); + doc.add(this.createButtonPane3(), {left: 100, top: 100}); + doc.add(this.createButtonPane4(), {left: 300, top: 100}); + }, - // Add an event listener - button1.addListener("execute", function(e) { - alert("Hello World!"); - }); + createButtonPane1 : function() + { + // Normal horizontal button pane + var buttonPane = new qxe.ui.form.ButtonPane(); + + var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); + okB.addListener("execute", function() { + alert("You pressed the OK button!"); + }, this); + + buttonPane.add(okB); + + var cancelB = new qx.ui.form.Button(); + cancelB.set(qxe.ui.form.ButtonPane.CANCEL); + cancelB.addListener("execute", function() { + alert("You pressed the Cancel button!"); + }, this); + + buttonPane.add(cancelB); + + var helpB = new qx.ui.form.Button(); + helpB.set(qxe.ui.form.ButtonPane.HELP); + helpB.addListener("execute", function() { + alert("You pressed the Help button!"); + }, this); + + buttonPane.add(helpB); + + return buttonPane; + }, + + createButtonPane2 : function() + { + // Normal horizontal button pane with double spacing + var buttonPane = new qxe.ui.form.ButtonPane(null, 8); + + var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); + okB.addListener("execute", function() { + alert("You pressed the OK button!"); + }, this); + + buttonPane.add(okB); + + var cancelB = new qx.ui.form.Button(); + cancelB.set(qxe.ui.form.ButtonPane.CANCEL); + cancelB.addListener("execute", function() { + alert("You pressed the Cancel button!"); + }, this); + + buttonPane.add(cancelB); + + var helpB = new qx.ui.form.Button(); + helpB.set(qxe.ui.form.ButtonPane.HELP); + helpB.addListener("execute", function() { + alert("You pressed the Help button!"); + }, this); + + buttonPane.add(helpB); + + return buttonPane; + }, + + createButtonPane3 : function() + { + // Normal vertical button pane + var buttonPane = new qxe.ui.form.ButtonPane("vertical"); + + var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); + okB.addListener("execute", function() { + alert("You pressed the OK button!"); + }, this); + + buttonPane.add(okB); + + var cancelB = new qx.ui.form.Button(); + cancelB.set(qxe.ui.form.ButtonPane.CANCEL); + cancelB.addListener("execute", function() { + alert("You pressed the Cancel button!"); + }, this); + + buttonPane.add(cancelB); + + var helpB = new qx.ui.form.Button(); + helpB.set(qxe.ui.form.ButtonPane.HELP); + helpB.addListener("execute", function() { + alert("You pressed the Help button!"); + }, this); + + buttonPane.add(helpB); + + return buttonPane; + }, + + createButtonPane4 : function() + { + // Horizontal button pane with constraints + var buttonPane = new qxe.ui.form.ButtonPane(); + + var okB = new qx.ui.form.Button("OK", "icon/16/actions/dialog-ok.png"); + okB.addListener("execute", function() { + alert("You pressed the OK button!"); + }, this); + + buttonPane.add(okB, "affirmative"); + + var cancelB = new qx.ui.form.Button(); + cancelB.set(qxe.ui.form.ButtonPane.CANCEL); + cancelB.addListener("execute", function() { + alert("You pressed the Cancel button!"); + }, this); + + buttonPane.add(cancelB, "cancel"); + + var helpB = new qx.ui.form.Button(); + helpB.set(qxe.ui.form.ButtonPane.HELP); + helpB.addListener("execute", function() { + alert("You pressed the Help button!"); + }, this); + + buttonPane.add(helpB, "help"); + + return buttonPane; } } }); Modified: trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js =================================================================== --- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-05 15:04:48 UTC (rev 21509) +++ trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/source/script/qxe.demo.js 2011-10-06 09:52:03 UTC (rev 21510) @@ -1,20 +1,183 @@ -/* - * This is mock content and will be overwritten with the first 'generate.py source'. - */ -function inform(){ - var message = - "<div style='font-family: Verdana'>" + - "<h2>Application not yet ready!</h2>" + - "<div>Please use the generator to build this application, i.e. run <i>'generate.py source'</i> in an OS shell; then reload this page.</div>" + - "</div>"; +(function(){ - window.setTimeout(function() { - document.body.innerHTML = message; - }, 0); +if (!window.qx) window.qx = {}; + +qx.$$start = new Date(); + +if (!qx.$$environment) qx.$$environment = {}; +var envinfo = {"qx.application":"qxe.demo.Application","qx.revision":"21509M","qx.theme":"qxe.demo.theme.Theme","qx.version":"1.6"}; +for (var k in envinfo) qx.$$environment[k] = envinfo[k]; + +if (!qx.$$libraries) qx.$$libraries = {}; +var libinfo = {"__out__":{"sourceUri":"script"},"qx":{"resourceUri":"../../../../../qooxdoo/1.6/framework/source/resource","sourceUri":"../../../../../qooxdoo/1.6/framework/source/class","version":"1.6"},"qxe":{"resourceUri":"../../../source/resource","sourceUri":"../../../source/class","version":"trunk"},"qxe.demo":{"resourceUri":"../source/resource","sourceUri":"../source/class","version":"trunk"}}; +for (var k in libinfo) qx.$$libraries[k] = libinfo[k]; + +qx.$$resources = {}; +qx.$$translations = {"C":null,"en":null}; +qx.$$locales = {"C":null,"en":null}; +qx.$$packageData = {}; + +qx.$$loader = { + parts : {"boot":[0]}, + packages : {"0":{"uris":["__out__:qxe.demo.bdadb8e5c432.js","qx:qx/Bootstrap.js","qx:qx/core/Environment.js","qx:qx/Mixin.js","qx:qx/Interface.js","qx:qx/core/Aspect.js","qx:qx/lang/Core.js","qx:qx/core/Property.js","qx:qx/Class.js","qx:qx/lang/Generics.js","qx:qx/data/MBinding.js","qx:qx/data/SingleValueBinding.js","qx:qx/lang/String.js","qx:qx/lang/Array.js","qx:qx/bom/client/Engine.js","qx:qx/lang/Type.js","qx:qx/core/Assert.js","qx:qx/type/BaseError.js","qx:qx/core/AssertionError.js","qx:qx/dev/StackTrace.js","qx:qx/lang/Function.js","qx:qx/core/MProperty.js","qx:qx/core/ObjectRegistry.js","qx:qx/core/MAssert.js","qx:qx/lang/RingBuffer.js","qx:qx/log/appender/RingBuffer.js","qx:qx/log/Logger.js","qx:qx/core/MLogging.js","qx:qx/dom/Node.js","qx:qx/bom/Event.js","qx:qx/event/Manager.js","qx:qx/event/GlobalError.js","qx:qx/core/WindowError.js","qx:qx/core/GlobalError.js","qx:qx/event/IEventHandler.js","qx:qx/event/Registration.js","qx:qx/core/MEvents.js","qx:qx/lang/JsonImpl.js","qx:qx/bom/client/Json.js","qx:qx/core/Object.js","qx:qx/util/DisposeUtil.js","qx:qx/lang/Json.js","qx:qx/event/IEventDispatcher.js","qx:qx/event/type/Event.js","qx:qx/util/ObjectPool.js","qx:qx/event/Pool.js","qx:qx/event/dispatch/Direct.js","qx:qx/event/handler/Object.js","qx:qx/event/type/Data.js","qx:qx/lang/Date.js","qx:qx/data/IListData.js","qx:qx/core/ValidationError.js","qx:qx/application/IApplication.js","qx:qx/locale/MTranslation.js","qx:qx/core/BaseInit.js","qx:qx/bom/client/OperatingSystem.js","qx:qx/event/type/Native.js","qx:qx/event/handler/Window.js","qx:qx/event/handler/Application.js","qx:qx/core/Init.js","qx:qx/application/AbstractGui.js","qx:qx/theme/manager/Meta.js","qx:qx/util/ValueManager.js","qx:qx/theme/manager/Color.js","qx:qx/util/ColorUtil.js","qx:qx/theme/manager/Decoration.js","qx:qx/ui/decoration/IDecorator.js","qx:qx/ui/decoration/Abstract.js","qx:qx/ui/decoration/DynamicDecorator.js","qx:qx/bom/element/Cursor.js","qx:qx/bom/element/Overflow.js","qx:qx/bom/element/BoxSizing.js","qx:qx/bom/Document.js","qx:qx/bom/Viewport.js","qx:qx/bom/element/Clip.js","qx:qx/bom/element/Opacity.js","qx:qx/bom/element/Style.js","qx:qx/bom/client/EcmaScript.js","qx:qx/lang/Object.js","qx:qx/util/AliasManager.js","qx:qx/theme/manager/Font.js","qx:qx/bom/Font.js","qx:qx/bom/webfonts/WebFont.js","qx:qx/bom/webfonts/Manager.js","qx:qx/bom/client/Transport.js","qx:qx/util/ResourceManager.js","qx:qx/bom/client/Browser.js","qx:qx/event/Timer.js","qx:qx/dom/Element.js","qx:qx/bom/Stylesheet.js","qx:qx/bom/client/Stylesheet.js","qx:qx/util/Uri.js","qx:qx/bom/webfonts/Validator.js","qx:qx/bom/element/Dimension.js","qx:qx/theme/manager/Icon.js","qx:qx/theme/manager/Appearance.js","qx:qx/Theme.js","qx:qx/ui/tooltip/Manager.js","qx:qx/ui/core/MChildrenHandling.js","qx:qx/ui/core/MLayoutHandling.js","qx:qx/ui/core/DecoratorFactory.js","qx:qx/util/DeferredCallManager.js","qx:qx/util/DeferredCall.js","qx:qx/html/Element.js","qx:qx/event/handler/Orientation.js","qx:qx/event/type/Orientation.js","qx:qx/bom/client/Event.js","qx:qx/event/handler/UserAction.js","qx:qx/event/handler/Touch.js","qx:qx/event/type/Dom.js","qx:qx/event/type/Touch.js","qx:qx/event/type/Tap.js","qx:qx/event/type/Swipe.js","qx:qx/event/handler/Appear.js","qx:qx/event/dispatch/AbstractBubbling.js","qx:qx/event/dispatch/DomBubbling.js","qx:qx/event/handler/Element.js","qx:qx/event/handler/Capture.js","qx:qx/event/handler/Mouse.js","qx:qx/event/type/Mouse.js","qx:qx/event/type/MouseWheel.js","qx:qx/dom/Hierarchy.js","qx:qx/bom/client/Html.js","qx:qx/event/handler/Keyboard.js","qx:qx/event/type/KeyInput.js","qx:qx/event/type/KeySequence.js","qx:qx/event/handler/Focus.js","qx:qx/bom/Selection.js","qx:qx/bom/Range.js","qx:qx/util/StringSplit.js","qx:qx/event/handler/DragDrop.js","qx:qx/event/type/Drag.js","qx:qx/event/handler/Offline.js","qx:qx/bom/Element.js","qx:qx/bom/element/Attribute.js","qx:qx/event/dispatch/MouseCapture.js","qx:qx/bom/Selector.js","qx:qx/bom/client/Plugin.js","qx:qx/xml/Document.js","qx:qx/bom/client/Xml.js","qx:qx/event/type/Focus.js","qx:qx/bom/element/Scroll.js","qx:qx/bom/element/Location.js","qx:qx/html/Decorator.js","qx:qx/ui/core/LayoutItem.js","qx:qx/ui/core/queue/Layout.js","qx:qx/ui/core/queue/Manager.js","qx:qx/ui/core/queue/Widget.js","qx:qx/ui/core/queue/Visibility.js","qx:qx/ui/core/queue/Appearance.js","qx:qx/ui/core/queue/Dispose.js","qx:qx/ui/core/Widget.js","qx:qx/ui/core/EventHandler.js","qx:qx/type/BaseString.js","qx:qx/locale/LocalizedString.js","qx:qx/locale/Manager.js","qx:qx/bom/client/Locale.js","qx:qx/ui/layout/Abstract.js","qx:qx/bom/element/Decoration.js","qx:qx/io/ImageLoader.js","qx:qx/bom/element/Background.js","qx:qx/html/Image.js","qx:qx/ui/core/MPlacement.js","qx:qx/event/Idle.js","qx:qx/util/placement/Placement.js","qx:qx/util/placement/AbstractAxis.js","qx:qx/util/placement/DirectAxis.js","qx:qx/util/placement/KeepAlignAxis.js","qx:qx/util/placement/BestFitAxis.js","qx:qx/ui/basic/Image.js","qx:qx/ui/core/DragDropCursor.js","qx:qx/ui/container/Composite.js","qx:qx/ui/popup/Popup.js","qx:qx/ui/popup/Manager.js","qx:qx/ui/tooltip/ToolTip.js","qx:qx/ui/layout/Grow.js","qx:qx/ui/basic/Atom.js","qx:qx/ui/layout/Atom.js","qx:qx/ui/layout/Util.js","qx:qx/ui/form/IStringForm.js","qx:qx/ui/basic/Label.js","qx:qx/bom/client/Css.js","qx:qx/html/Label.js","qx:qx/bom/Label.js","qx:qx/ui/form/IForm.js","qx:qx/application/Standalone.js","qx:qx/ui/window/MDesktop.js","qx:qx/ui/core/MBlocker.js","qx:qx/ui/core/Blocker.js","qx:qx/ui/root/Abstract.js","qx:qx/ui/core/FocusHandler.js","qx:qx/ui/root/Application.js","qx:qx/ui/layout/Canvas.js","qx:qx/html/Root.js","qx:qx/html/Blocker.js","qxe.demo:qxe/demo/Application.js","qx:qx/log/appender/Util.js","qx:qx/log/appender/Native.js","qx:qx/log/appender/Console.js","qxe:qxe/ui/form/ButtonPane.js","qx:qx/ui/layout/HBox.js","qx:qx/ui/layout/VBox.js","qx:qx/ui/core/MExecutable.js","qx:qx/ui/form/IExecutable.js","qx:qx/ui/form/Button.js","qx:qx/ui/core/Spacer.js","qx:qx/theme/modern/Font.js","qxe.demo:qxe/demo/theme/Font.js","qx:qx/theme/modern/Appearance.js","qxe.demo:qxe/demo/theme/Appearance.js","qx:qx/theme/icon/Tango.js","qx:qx/theme/modern/Color.js","qxe.demo:qxe/demo/theme/Color.js","qx:qx/ui/decoration/MBoxShadow.js","qx:qx/ui/decoration/MBackgroundColor.js","qx:qx/ui/decoration/MBackgroundImage.js","qx:qx/ui/decoration/MSingleBorder.js","qx:qx/ui/decoration/Single.js","qx:qx/ui/decoration/Background.js","qx:qx/ui/decoration/Uniform.js","qx:qx/ui/decoration/MDoubleBorder.js","qx:qx/ui/decoration/Beveled.js","qx:qx/ui/decoration/MLinearBackgroundGradient.js","qx:qx/ui/decoration/Grid.js","qx:qx/ui/decoration/css3/BorderImage.js","qx:qx/ui/decoration/GridDiv.js","qx:qx/ui/decoration/MBorderRadius.js","qx:qx/theme/modern/Decoration.js","qxe.demo:qxe/demo/theme/Decoration.js","qxe.demo:qxe/demo/theme/Theme.js"]}}, + urisBefore : [], + cssBefore : [], + boot : "boot", + closureParts : {}, + bootIsInline : false, + addNoCacheParam : true, + + decodeUris : function(compressedUris) + { + var libs = qx.$$libraries; + var uris = []; + for (var i=0; i<compressedUris.length; i++) + { + var uri = compressedUris[i].split(":"); + var euri; + if (uri.length==2 && uri[0] in libs) { + var prefix = libs[uri[0]].sourceUri; + euri = prefix + "/" + uri[1]; + } else { + euri = compressedUris[i]; + } + if (qx.$$loader.addNoCacheParam) { + euri += "?nocache=" + Math.random(); + } + + uris.push(euri); + } + return uris; + } +}; + +function loadScript(uri, callback) { + var elem = document.createElement("script"); + elem.charset = "utf-8"; + elem.src = uri; + elem.onreadystatechange = elem.onload = function() { + if (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") { + elem.onreadystatechange = elem.onload = null; + callback(); + } + }; + var head = document.getElementsByTagName("head")[0]; + head.appendChild(elem); } -if (window.attachEvent) { - window.attachEvent("onload", inform); -} else { - window.addEventListener("load", inform, false); +function loadCss(uri) { + var elem = document.createElement("link"); + elem.rel = "stylesheet"; + elem.type= "text/css"; + elem.href= uri; + var head = document.getElementsByTagName("head")[0]; + head.appendChild(elem); } + +var isWebkit = /AppleWebKit\/([^ ]+)/.test(navigator.userAgent); + +function loadScriptList(list, callback) { + if (list.length == 0) { + callback(); + return; + } + var item = list.shift(); + loadScript(item, function() { + if (isWebkit) { + // force async, else Safari fails with a "maximum recursion depth exceeded" + window.setTimeout(function() { + loadScriptList(list, callback); + }, 0); + } else { + loadScriptList(list, callback); + } + }); +} + +var fireContentLoadedEvent = function() { + qx.$$domReady = true; + document.removeEventListener('DOMContentLoaded', fireContentLoadedEvent, false); +}; +if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); +} + +qx.$$loader.importPackageData = function (dataMap, callback) { + if (dataMap["resources"]){ + var resMap = dataMap["resources"]; + for (var k in resMap) qx.$$resources[k] = resMap[k]; + } + if (dataMap["locales"]){ + var locMap = dataMap["locales"]; + var qxlocs = qx.$$locales; + for (var lang in locMap){ + if (!qxlocs[lang]) qxlocs[lang] = locMap[lang]; + else + for (var k in locMap[lang]) qxlocs[lang][k] = locMap[lang][k]; + } + } + if (dataMap["translations"]){ + var trMap = dataMap["translations"]; + var qxtrans = qx.$$translations; + for (var lang in trMap){ + if (!qxtrans[lang]) qxtrans[lang] = trMap[lang]; + else + for (var k in trMap[lang]) qxtrans[lang][k] = trMap[lang][k]; + } + } + if (callback){ + callback(dataMap); + } +} + +qx.$$loader.signalStartup = function () +{ + qx.$$loader.scriptLoaded = true; + if (window.qx && qx.event && qx.event.handler && qx.event.handler.Application) { + qx.event.handler.Application.onScriptLoaded(); + qx.$$loader.applicationHandlerReady = true; + } else { + qx.$$loader.applicationHandlerReady = false; + } +} + +// Load all stuff +qx.$$loader.init = function(){ + var l=qx.$$loader; + if (l.cssBefore.length>0) { + for (var i=0, m=l.cssBefore.length; i<m; i++) { + loadCss(l.cssBefore[i]); + } + } + if (l.urisBefore.length>0){ + loadScriptList(l.urisBefore, function(){ + l.initUris(); + }); + } else { + l.initUris(); + } +} + +// Load qooxdoo boot stuff +qx.$$loader.initUris = function(){ + var l=qx.$$loader; + var bootPackageHash=l.parts[l.boot][0]; + if (l.bootIsInline){ + l.importPackageData(qx.$$packageData[bootPackageHash]); + l.signalStartup(); + } else { + loadScriptList(l.decodeUris(l.packages[l.parts[l.boot][0]].uris), function(){ + // Opera needs this extra time to parse the scripts + window.setTimeout(function(){ + l.importPackageData(qx.$$packageData[bootPackageHash] || {}); + l.signalStartup(); + }, 0); + }); + } +} +})(); + + + +qx.$$loader.init(); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-05 15:04:57
|
Revision: 21509 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21509&view=rev Author: sandersson Date: 2011-10-05 15:04:48 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Added Paths: ----------- trunk/qooxdoo-contrib/qxe/trunk/demo/ButtonPane/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <san...@us...> - 2011-10-05 15:03:31
|
Revision: 21508 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21508&view=rev Author: sandersson Date: 2011-10-05 15:03:22 +0000 (Wed, 05 Oct 2011) Log Message: ----------- Removed Paths: ------------- trunk/qooxdoo-contrib/qxe/trunk/demo/default/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <d_w...@us...> - 2011-10-05 14:59:22
|
Revision: 21507 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21507&view=rev Author: d_wagner Date: 2011-10-05 14:59:14 +0000 (Wed, 05 Oct 2011) Log Message: ----------- [BUG #5680] Separated framework unit tests and Testrunner GUI tests Added Paths: ----------- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner.js trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/unittests/ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/unittests/test_unittests.js Removed Paths: ------------- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner2.js trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner2/ Added: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner.js =================================================================== --- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner.js (rev 0) +++ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner.js 2011-10-05 14:59:14 UTC (rev 21507) @@ -0,0 +1,198 @@ +var baseConf = { + 'debug' : true +}; + +var args = arguments ? arguments : ""; +var simSvn = baseConf.simulatorSvn; +for (var i=0; i<args.length; i++) { + if (args[i].indexOf('simulatorSvn') >= 0) { + simSvn = args[i].substr(args[i].indexOf('simulatorSvn=') + 13); + } +} + +load([simSvn + "/trunk/tool/selenium/simulation/Simulation.js"]); +var mySim = new simulation.Simulation(baseConf,args); + +var selWin = simulation.Simulation.SELENIUMWINDOW; +var qxAppInst = simulation.Simulation.QXAPPINSTANCE; +var suiteState = selWin + "." + qxAppInst + ".runner.getTestSuiteState()"; +var testCount = selWin + "." + qxAppInst + ".runner.getTestCount()"; + + +var locators = { + toolbarButtonRun : "qxhv=*/[@icon=media-playback-start]", + toolbarButtonStackTrace : "qxhv=*/[@icon=document-properties]" +}; + +simulation.Simulation.prototype.getSuiteState = function() +{ + return String(this.getEval(suiteState)); +}; + +simulation.Simulation.prototype.waitForSuiteState = function(state, timeout) +{ + var timeout = timeout || 60000; + var suiteStateCheck = suiteState + " == \"" + state + "\""; + return this.waitForCondition(suiteStateCheck, timeout); +}; + +simulation.Simulation.prototype.getResultCounts = function() +{ + var failed = selWin + "." + qxAppInst + ".runner.view.getFailedTestCount()"; + var skipped = selWin + "." + qxAppInst + ".runner.view.getSkippedTestCount()"; + var successful = selWin + "." + qxAppInst + ".runner.view.getSuccessfulTestCount()"; + + var failedCount = parseInt(String(this.getEval(failed)), 10); + var skippedCount = parseInt(String(this.getEval(skipped)), 10); + var successfulCount = parseInt(String(this.getEval(successful)), 10); + + return { + failed : failedCount, + skipped : skippedCount, + successful : successfulCount + } +}; + +simulation.Simulation.prototype.getTestCount = function() +{ + return parseInt(String(this.getEval(testCount)), 10); +}; + +simulation.Simulation.prototype.getShowStackTrace = function() +{ + var code = selWin + "." + qxAppInst + ".runner.view.getShowStackTrace()"; + var showStackTrace = String(this.getEval(code)); + return showStackTrace === "true"; +}; + +simulation.Simulation.prototype.runTest = function() +{ + if (!this.waitForSuiteState("ready")) { + this.testFailed = true; + this.log("Test suite not loaded within one minute, aborting!", "error"); + return; + } + this.log("Suite loaded, running tests", "debug"); + + var tests = [ + this.testRunTests, + this.testToggleStackTrace + ]; + + for (var i=0, l=tests.length; i<l; i++) { + try { + tests[i].call(this); + } + catch(ex) { + this.testFailed = true; + this.log(ex.message, "error"); + return; + } + } +}; + + +simulation.Simulation.prototype.testRunTests = function() +{ + var testCountBefore = this.getTestCount(); + if (!testCountBefore > 0) { + throw new Error("No tests queued!"); + } + this.qxClick(locators.toolbarButtonRun); + if (!this.waitForSuiteState("finished")) { + throw new Error("Test suite was not finished within one minute!"); + } + if (!this.getTestCount() === 0) { + throw new Error("Suite is finished but not all tests were executed!"); + } + + var resultCounts = this.getResultCounts(); + var totalResults = resultCounts.success + resultCounts.skipped + resultCounts.failed; + if (!totalResults == testCountBefore) { + throw new Error("Got " + totalResults + " results for " + testCountBefore + " tests!"); + } + + if (resultCounts.successful > 0 && !this.__sel.isElementPresent("css=.success")) { + throw new Error("Got successful results but no element with class .success!"); + } + + if (resultCounts.skipped > 0 && !this.__sel.isElementPresent("css=.skip")) { + throw new Error("Got skipped results but no element with class .skip!"); + } + + if (resultCounts.failed > 0 && !this.__sel.isElementPresent("css=.error")) { + throw new Error("Got failed results but no element with class .error!"); + } +}; + +simulation.Simulation.prototype.testToggleStackTrace = function() +{ + var stackTraceActive = this.getShowStackTrace(); + if (stackTraceActive && !this.__sel.isVisible("css=.trace")) { + throw new Error("Stack trace display is active but found no element with class .trace!"); + } + + if (!stackTraceActive && this.__sel.isVisible("css=.trace")) { + throw new Error("Stack trace display is inactive but found an element with class .trace!"); + } + + this.qxClick(locators.toolbarButtonStackTrace); + var stackTraceActiveAfter = this.getShowStackTrace(); + if (stackTraceActive == stackTraceActiveAfter) { + throw new Error("Clicking the stack trace toggle did not change the property!"); + } + + if ((stackTraceActiveAfter && !this.__sel.isVisible("css=.trace")) || + (!stackTraceActiveAfter && this.__sel.isVisible("css=.trace")) ) + { + throw new Error("Stack trace display toggle did not work!"); + } +}; + +// - Main -------------------------------------------------------------------- + +(function() { + mySim.testFailed = false; + + var sessionStarted = mySim.startSession(); + + if (!sessionStarted) { + return; + } + + var isAppReady = mySim.waitForCondition(simulation.Simulation.ISQXAPPREADY, 240000, + "Waiting for qooxdoo application"); + + + if (!isAppReady) { + mySim.testFailed = true; + mySim.stop(); + return; + } + + try { + mySim.addGlobalErrorHandler(); + mySim.runTest(); + } + catch(ex) { + var msg = "Unexpected error while running tests: " + ex; + if (mySim.getConfigSetting("debug")) { + print(msg + "\n"); + } + mySim.log(msg, "error"); + } + mySim.logGlobalErrors(); + + if (!mySim.testFailed) { + if (mySim.getConfigSetting("debug")) { + print("Test run finished successfully."); + } + + var totalErrors = mySim.getTotalErrorsLogged() + mySim.getTotalWarningsLogged(); + mySim.log("Tests with warnings or errors: " + totalErrors, "info"); + } + + mySim.stop(); + mySim.logTestDuration(); + +})(); Property changes on: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner.js ___________________________________________________________________ Added: svn:mime-type + text/plain Deleted: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner2.js =================================================================== --- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner2/test_testrunner2.js 2011-09-26 11:16:41 UTC (rev 21461) +++ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner/test_testrunner2.js 2011-10-05 14:59:14 UTC (rev 21507) @@ -1,304 +0,0 @@ -var baseConf = { - 'autName' : 'Testrunner', - 'globalTimeout' : 120000, - 'stepSpeed' : '250', - 'selServer' : 'localhost', - 'selPort' : 4444, - 'testBrowser' : '*custom /usr/lib/firefox-3.0.10/firefox -no-remote -P selenium-3', - 'autHost' : 'http://localhost', - 'autPath' : '/~dwagner/workspace/qooxdoo.trunk/framework/test/index.html', - 'simulatorSvn' : '/home/dwagner/workspace/qooxdoo.contrib/Simulator', - 'debug' : true, - 'getAutLog' : false, - 'logAutGlobalErrors' : true, - 'ignoreGlobalErrors' : [ "testErrorEvent", - "no load event should be fired", - "loading a non existing file", - "Expected exception", - "test404", - "testLoadError", - "testRequireState", - "call onerror on network error", - "call onloadend on network error", - "reset responseJson when reopened", - "myCallback is not a function", - "loading failed because of network error", - "failure when request failed", - "remove script from DOM when request failed"], - 'accessInterval' : 10000, - 'packageLoadTimeout' : 30000, - 'packageRunTimeout' : 1800000 -}; - -var args = arguments ? arguments : ""; -var simSvn = baseConf.simulatorSvn; -for (var i=0; i<args.length; i++) { - if (args[i].indexOf('simulatorSvn') >= 0) { - simSvn = args[i].substr(args[i].indexOf('simulatorSvn=') + 13); - } -} - -load([simSvn + "/trunk/tool/selenium/simulation/Simulation.js"]); - -var mySim = new simulation.Simulation(baseConf,args); - -var selWin = simulation.Simulation.SELENIUMWINDOW; -var qxAppInst = simulation.Simulation.QXAPPINSTANCE; - - -/** - * Periodically checks if the test suite is done. Once it is, the results are - * logged. - */ -simulation.Simulation.prototype.runTest = function() -{ - var accessInterval = this.getConfigSetting("accessInterval"); - var lastLoadedPackage, lastRunningPackage; - var loadCycles = 0; - var runCycles = 0; - - var getSuiteState = selWin + "." + qxAppInst + ".runner.getTestSuiteState()"; - var suiteStateCheck = getSuiteState + " !== \"loading\""; - var suiteReady = this.waitForCondition(suiteStateCheck, 120000); - if (!suiteReady) { - this.log("Test suite not loaded within two minutes, aborting!", "error"); - } - var getViewStatus = selWin + "." + qxAppInst + ".runner.view.getStatus()"; - - while (true) { - Packages.java.lang.Thread.sleep(accessInterval); - //Selenium doesn't like to execute the same command multiple times - this.__sel.getSpeed(); - var suiteState = String(this.getEval(getSuiteState)); - var viewStatus = String(this.getEval(getViewStatus)); - - print("========================================================="); - switch (suiteState) { - case "error": - this.testFailed = true; - this.log("Error loading test suite", "error"); - return; - case "finished": - // testSuiteState "finished" means a package is done, need to check the - // view's status to know if the entire test suite is done - if (viewStatus == "finished") { - this.logResult(); - return; - } - case "loading": - var match = viewStatus.match(/Loading package (.*)/i); - if (match && match.length > 1) { - var loadingPackage = match[1]; - print(suiteState + " " + loadingPackage); - - if (lastLoadedPackage && lastLoadedPackage == loadingPackage) { - loadCycles++; - var loadTime = (loadCycles * accessInterval); - var msg = "Package " + loadingPackage + " loading for " + - (loadTime / 1000) + "s"; - this.log(msg, "debug"); - print(msg); - if (loadTime >= this.getConfigSetting("packageLoadTimeout")) { - this.testFailed = true; - this.log("Package load timeout reached, aborting!", "error"); - this.logResult(); - return; - } - } - else { - lastLoadedPackage = loadingPackage; - loadCycles = 0; - } - } - break; - case "running": - var match = viewStatus.match(/Running package (.*)/i); - if (match && match.length > 1) { - var runningPackage = match[1]; - print(suiteState + " " + runningPackage); - - if (lastRunningPackage && lastRunningPackage == runningPackage) { - var packageRunTimeout = this.getConfigSetting("packageRunTimeout") - runCycles++; - var runTime = (runCycles * accessInterval); - var msg = "Package " + runningPackage + " running for " + - (runTime / 1000) + "s"; - this.log(msg, "debug"); - print(msg); - if (runTime >= packageRunTimeout) { - this.testFailed = true; - this.log("Package run timeout reached, aborting!", "error"); - this.logResult(); - return; - } - } - else { - lastRunningPackage = runningPackage; - runCycles = 0; - } - } - break; - default: - var msg = "Unexpected suite state: " + suiteState + " View status: " + - viewStatus; - this.log(msg, "warn"); - print(msg); - } - } -}; - - -simulation.Simulation.prototype.logErrors = function() -{ - var prefix = selWin + "." + qxAppInst; - - var errorGetter = selWin + ".qx.lang.Json.stringify(" + prefix + ".runner.view.getFailedResults())"; - var resultsString; - try { - resultsString = this.__sel.getEval(errorGetter); - resultsString = String(resultsString); - eval("var results=" + resultsString); - } - catch(ex) { - this.log("Couldn't get results: " + ex.message, "error"); - return; - } - - - for (var testName in results) { - var result = results[testName]; - - var message = ""; - for (var i=0,l=result.messages.length; i<l; i++) { - var msg = result.messages[i]; - msg = this.replaceStrings(msg); - message += msg + "<br/><br/>"; - } - - var level = "info"; - switch(result.state) { - case "skip": - level = "info"; - break; - default: - level = "error"; - }; - - var html = '<div class="testResult ' + level + '">' - + '<h3>' + testName + '</h3>' + message + '</div>'; - - this.log(html, level); - } -}; - -simulation.Simulation.prototype.logAutErrors = function() -{ - var autErrorGetter = function() - { - var errors = selenium.qxStoredVars['autWindow'].qx.core.Init.getApplication().runner.view.getFormattedAutErrors(); - return selenium.qxStoredVars['autWindow'].qx.lang.Json.stringify(errors); - }; - - this.addOwnFunction("getAutErrors", autErrorGetter); - var autErrors = ""; - try { - autErrors = String(this.__sel.getEval(selWin + ".qx.Simulation.getAutErrors()")); - } - catch(ex) { - this.log("Couldn't get AUT errors " + ex.message, "warn"); - return; - } - - if (autErrors.length != "") { - var errArr = eval(autErrors); - for (var i=0,l=errArr.length; i<l; i++) { - if (!this.ignoreMessage(errArr[i])) { - this.log(errArr[i], "warn"); - } - } - } -}; - -simulation.Simulation.prototype.logResult = function() -{ - try { - this.logErrors(); - this.logAutErrors(); - } - catch(ex) { - this.log("Unable to log test results: " + ex.message, "error"); - } -}; - -simulation.Simulation.prototype.ignoreMessage = function(msg) { - var ignored = this.getConfigSetting("ignoreGlobalErrors"); - for (var i=0,l=ignored.length; i<l; i++) { - if (msg.match(new RegExp(ignored[i]))) { - return true; - } - } - return false; -}; - -simulation.Simulation.prototype.replaceStrings = function(line) -{ - try { - line = line.replace(/\<br\>/gi, "<br/>"); - line = line.replace(/\'/g, "\\'"); - line = line.replace(/\n/g, ""); - line = line.replace(/\r/g, ""); - } - catch(ex) { - print("Error while replacing: " + ex); - line = "LINE REPLACED DUE TO ILLEGAL CHARACTER"; - } - return line; -}; - -// - Main -------------------------------------------------------------------- - -(function() { - mySim.testFailed = false; - - var sessionStarted = mySim.startSession(); - - if (!sessionStarted) { - return; - } - - var isAppReady = mySim.waitForCondition(simulation.Simulation.ISQXAPPREADY, 240000, - "Waiting for qooxdoo application"); - - - if (!isAppReady) { - mySim.testFailed = true; - mySim.stop(); - return; - } - - try { - mySim.addGlobalErrorHandler(); - mySim.runTest(); - } - catch(ex) { - var msg = "Unexpected error while running tests: " + ex; - if (mySim.getConfigSetting("debug")) { - print(msg + "\n"); - } - mySim.log(msg, "error"); - } - mySim.logGlobalErrors(); - - if (!mySim.testFailed) { - if (mySim.getConfigSetting("debug")) { - print("Test run finished successfully."); - } - - var totalErrors = mySim.getTotalErrorsLogged() + mySim.getTotalWarningsLogged(); - mySim.log("Tests with warnings or errors: " + totalErrors, "info"); - } - - mySim.stop(); - mySim.logTestDuration(); - -})(); Copied: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/unittests/test_unittests.js (from rev 21461, trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/testrunner2/test_testrunner2.js) =================================================================== --- trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/unittests/test_unittests.js (rev 0) +++ trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/unittests/test_unittests.js 2011-10-05 14:59:14 UTC (rev 21507) @@ -0,0 +1,304 @@ +var baseConf = { + 'autName' : 'Testrunner', + 'globalTimeout' : 120000, + 'stepSpeed' : '250', + 'selServer' : 'localhost', + 'selPort' : 4444, + 'testBrowser' : '*custom /usr/lib/firefox-3.0.10/firefox -no-remote -P selenium-3', + 'autHost' : 'http://localhost', + 'autPath' : '/~dwagner/workspace/qooxdoo.trunk/framework/test/index.html', + 'simulatorSvn' : '/home/dwagner/workspace/qooxdoo.contrib/Simulator', + 'debug' : true, + 'getAutLog' : false, + 'logAutGlobalErrors' : true, + 'ignoreGlobalErrors' : [ "testErrorEvent", + "no load event should be fired", + "loading a non existing file", + "Expected exception", + "test404", + "testLoadError", + "testRequireState", + "call onerror on network error", + "call onloadend on network error", + "reset responseJson when reopened", + "myCallback is not a function", + "loading failed because of network error", + "failure when request failed", + "remove script from DOM when request failed"], + 'accessInterval' : 10000, + 'packageLoadTimeout' : 30000, + 'packageRunTimeout' : 1800000 +}; + +var args = arguments ? arguments : ""; +var simSvn = baseConf.simulatorSvn; +for (var i=0; i<args.length; i++) { + if (args[i].indexOf('simulatorSvn') >= 0) { + simSvn = args[i].substr(args[i].indexOf('simulatorSvn=') + 13); + } +} + +load([simSvn + "/trunk/tool/selenium/simulation/Simulation.js"]); + +var mySim = new simulation.Simulation(baseConf,args); + +var selWin = simulation.Simulation.SELENIUMWINDOW; +var qxAppInst = simulation.Simulation.QXAPPINSTANCE; + + +/** + * Periodically checks if the test suite is done. Once it is, the results are + * logged. + */ +simulation.Simulation.prototype.runTest = function() +{ + var accessInterval = this.getConfigSetting("accessInterval"); + var lastLoadedPackage, lastRunningPackage; + var loadCycles = 0; + var runCycles = 0; + + var getSuiteState = selWin + "." + qxAppInst + ".runner.getTestSuiteState()"; + var suiteStateCheck = getSuiteState + " !== \"loading\""; + var suiteReady = this.waitForCondition(suiteStateCheck, 120000); + if (!suiteReady) { + this.log("Test suite not loaded within two minutes, aborting!", "error"); + } + var getViewStatus = selWin + "." + qxAppInst + ".runner.view.getStatus()"; + + while (true) { + Packages.java.lang.Thread.sleep(accessInterval); + //Selenium doesn't like to execute the same command multiple times + this.__sel.getSpeed(); + var suiteState = String(this.getEval(getSuiteState)); + var viewStatus = String(this.getEval(getViewStatus)); + + print("========================================================="); + switch (suiteState) { + case "error": + this.testFailed = true; + this.log("Error loading test suite", "error"); + return; + case "finished": + // testSuiteState "finished" means a package is done, need to check the + // view's status to know if the entire test suite is done + if (viewStatus == "finished") { + this.logResult(); + return; + } + case "loading": + var match = viewStatus.match(/Loading package (.*)/i); + if (match && match.length > 1) { + var loadingPackage = match[1]; + print(suiteState + " " + loadingPackage); + + if (lastLoadedPackage && lastLoadedPackage == loadingPackage) { + loadCycles++; + var loadTime = (loadCycles * accessInterval); + var msg = "Package " + loadingPackage + " loading for " + + (loadTime / 1000) + "s"; + this.log(msg, "debug"); + print(msg); + if (loadTime >= this.getConfigSetting("packageLoadTimeout")) { + this.testFailed = true; + this.log("Package load timeout reached, aborting!", "error"); + this.logResult(); + return; + } + } + else { + lastLoadedPackage = loadingPackage; + loadCycles = 0; + } + } + break; + case "running": + var match = viewStatus.match(/Running package (.*)/i); + if (match && match.length > 1) { + var runningPackage = match[1]; + print(suiteState + " " + runningPackage); + + if (lastRunningPackage && lastRunningPackage == runningPackage) { + var packageRunTimeout = this.getConfigSetting("packageRunTimeout") + runCycles++; + var runTime = (runCycles * accessInterval); + var msg = "Package " + runningPackage + " running for " + + (runTime / 1000) + "s"; + this.log(msg, "debug"); + print(msg); + if (runTime >= packageRunTimeout) { + this.testFailed = true; + this.log("Package run timeout reached, aborting!", "error"); + this.logResult(); + return; + } + } + else { + lastRunningPackage = runningPackage; + runCycles = 0; + } + } + break; + default: + var msg = "Unexpected suite state: " + suiteState + " View status: " + + viewStatus; + this.log(msg, "warn"); + print(msg); + } + } +}; + + +simulation.Simulation.prototype.logErrors = function() +{ + var prefix = selWin + "." + qxAppInst; + + var errorGetter = selWin + ".qx.lang.Json.stringify(" + prefix + ".runner.view.getFailedResults())"; + var resultsString; + try { + resultsString = this.__sel.getEval(errorGetter); + resultsString = String(resultsString); + eval("var results=" + resultsString); + } + catch(ex) { + this.log("Couldn't get results: " + ex.message, "error"); + return; + } + + + for (var testName in results) { + var result = results[testName]; + + var message = ""; + for (var i=0,l=result.messages.length; i<l; i++) { + var msg = result.messages[i]; + msg = this.replaceStrings(msg); + message += msg + "<br/><br/>"; + } + + var level = "info"; + switch(result.state) { + case "skip": + level = "info"; + break; + default: + level = "error"; + }; + + var html = '<div class="testResult ' + level + '">' + + '<h3>' + testName + '</h3>' + message + '</div>'; + + this.log(html, level); + } +}; + +simulation.Simulation.prototype.logAutErrors = function() +{ + var autErrorGetter = function() + { + var errors = selenium.qxStoredVars['autWindow'].qx.core.Init.getApplication().runner.view.getFormattedAutErrors(); + return selenium.qxStoredVars['autWindow'].qx.lang.Json.stringify(errors); + }; + + this.addOwnFunction("getAutErrors", autErrorGetter); + var autErrors = ""; + try { + autErrors = String(this.__sel.getEval(selWin + ".qx.Simulation.getAutErrors()")); + } + catch(ex) { + this.log("Couldn't get AUT errors " + ex.message, "warn"); + return; + } + + if (autErrors.length != "") { + var errArr = eval(autErrors); + for (var i=0,l=errArr.length; i<l; i++) { + if (!this.ignoreMessage(errArr[i])) { + this.log(errArr[i], "warn"); + } + } + } +}; + +simulation.Simulation.prototype.logResult = function() +{ + try { + this.logErrors(); + this.logAutErrors(); + } + catch(ex) { + this.log("Unable to log test results: " + ex.message, "error"); + } +}; + +simulation.Simulation.prototype.ignoreMessage = function(msg) { + var ignored = this.getConfigSetting("ignoreGlobalErrors"); + for (var i=0,l=ignored.length; i<l; i++) { + if (msg.match(new RegExp(ignored[i]))) { + return true; + } + } + return false; +}; + +simulation.Simulation.prototype.replaceStrings = function(line) +{ + try { + line = line.replace(/\<br\>/gi, "<br/>"); + line = line.replace(/\'/g, "\\'"); + line = line.replace(/\n/g, ""); + line = line.replace(/\r/g, ""); + } + catch(ex) { + print("Error while replacing: " + ex); + line = "LINE REPLACED DUE TO ILLEGAL CHARACTER"; + } + return line; +}; + +// - Main -------------------------------------------------------------------- + +(function() { + mySim.testFailed = false; + + var sessionStarted = mySim.startSession(); + + if (!sessionStarted) { + return; + } + + var isAppReady = mySim.waitForCondition(simulation.Simulation.ISQXAPPREADY, 240000, + "Waiting for qooxdoo application"); + + + if (!isAppReady) { + mySim.testFailed = true; + mySim.stop(); + return; + } + + try { + mySim.addGlobalErrorHandler(); + mySim.runTest(); + } + catch(ex) { + var msg = "Unexpected error while running tests: " + ex; + if (mySim.getConfigSetting("debug")) { + print(msg + "\n"); + } + mySim.log(msg, "error"); + } + mySim.logGlobalErrors(); + + if (!mySim.testFailed) { + if (mySim.getConfigSetting("debug")) { + print("Test run finished successfully."); + } + + var totalErrors = mySim.getTotalErrorsLogged() + mySim.getTotalWarningsLogged(); + mySim.log("Tests with warnings or errors: " + totalErrors, "info"); + } + + mySim.stop(); + mySim.logTestDuration(); + +})(); Property changes on: trunk/qooxdoo-contrib/Simulator/trunk/tool/selenium/simulation/unittests/test_unittests.js ___________________________________________________________________ Added: svn:mime-type + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <th...@us...> - 2011-10-05 10:06:23
|
Revision: 21506 http://qooxdoo-contrib.svn.sourceforge.net/qooxdoo-contrib/?rev=21506&view=rev Author: thron7 Date: 2011-10-05 10:06:14 +0000 (Wed, 05 Oct 2011) Log Message: ----------- add Sphinx project Added Paths: ----------- workspace/thron7/misc/api2rst/api.rst/ workspace/thron7/misc/api2rst/api.rst/Makefile workspace/thron7/misc/api2rst/api.rst/make.bat workspace/thron7/misc/api2rst/api.rst/source/ workspace/thron7/misc/api2rst/api.rst/source/_static/ workspace/thron7/misc/api2rst/api.rst/source/_static/blank.gif workspace/thron7/misc/api2rst/api.rst/source/_static/childcontrol18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_abstract18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_abstract_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_singleton18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_singleton_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_static18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_static_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/class_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/close.gif workspace/thron7/misc/api2rst/api.rst/source/_static/colorstrip.gif workspace/thron7/misc/api2rst/api.rst/source/_static/constant18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/constructor18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/cross.gif workspace/thron7/misc/api2rst/api.rst/source/_static/event18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/includes.gif workspace/thron7/misc/api2rst/api.rst/source/_static/information18.png workspace/thron7/misc/api2rst/api.rst/source/_static/inherited_and_mixins_included.gif workspace/thron7/misc/api2rst/api.rst/source/_static/interface18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/interface_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/loading66.gif workspace/thron7/misc/api2rst/api.rst/source/_static/method_internal18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/method_private18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/method_protected18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/method_public18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/method_public_inherited18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/mixin18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/mixin_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/nextlevel.gif workspace/thron7/misc/api2rst/api.rst/source/_static/open.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_abstract18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_constructor18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_error18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_inherited18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_mixin18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_overridden18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_static18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_themeable18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/package18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/package_warning18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/property18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/property_internal18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/property_private18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/property_protected18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/property_themeable18.gif workspace/thron7/misc/api2rst/api.rst/source/_static/search18.png workspace/thron7/misc/api2rst/api.rst/source/_static/vline.gif workspace/thron7/misc/api2rst/api.rst/source/_templates/ workspace/thron7/misc/api2rst/api.rst/source/conf.py workspace/thron7/misc/api2rst/api.rst/source/index.rst workspace/thron7/misc/api2rst/api.rst/source/pages/ workspace/thron7/misc/api2rst/api.rst/source/pages/qx.Class.rst Property changes on: workspace/thron7/misc/api2rst/api.rst ___________________________________________________________________ Added: svn:ignore + build Added: workspace/thron7/misc/api2rst/api.rst/Makefile =================================================================== --- workspace/thron7/misc/api2rst/api.rst/Makefile (rev 0) +++ workspace/thron7/misc/api2rst/api.rst/Makefile 2011-10-05 10:06:14 UTC (rev 21506) @@ -0,0 +1,130 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest + +help: + @echo "Please use \`make <target>' where <target> is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ApiJson-to-reSTRenderer.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ApiJson-to-reSTRenderer.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/ApiJson-to-reSTRenderer" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ApiJson-to-reSTRenderer" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + make -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." Added: workspace/thron7/misc/api2rst/api.rst/make.bat =================================================================== --- workspace/thron7/misc/api2rst/api.rst/make.bat (rev 0) +++ workspace/thron7/misc/api2rst/api.rst/make.bat 2011-10-05 10:06:14 UTC (rev 21506) @@ -0,0 +1,170 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^<target^>` where ^<target^> is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\ApiJson-to-reSTRenderer.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\ApiJson-to-reSTRenderer.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end Added: workspace/thron7/misc/api2rst/api.rst/source/_static/blank.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/blank.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/childcontrol18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/childcontrol18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_abstract18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_abstract18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_abstract_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_abstract_warning18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_singleton18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_singleton18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_singleton_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_singleton_warning18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_static18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_static18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_static_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_static_warning18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/class_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/class_warning18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/close.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/close.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/colorstrip.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/colorstrip.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/constant18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/constant18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/constructor18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/constructor18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/cross.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/cross.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/event18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/event18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/includes.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/includes.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/information18.png =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/information18.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/inherited_and_mixins_included.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/inherited_and_mixins_included.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/interface18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/interface18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/interface_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/interface_warning18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/loading66.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/loading66.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/method_internal18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/method_internal18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/method_private18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/method_private18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/method_protected18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/method_protected18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/method_public18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/method_public18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/method_public_inherited18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/method_public_inherited18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/mixin18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/mixin18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/mixin_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/mixin_warning18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/nextlevel.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/nextlevel.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/open.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/open.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_abstract18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_abstract18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_constructor18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_constructor18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_error18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_error18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_inherited18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_inherited18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_mixin18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_mixin18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_overridden18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_overridden18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_static18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_static18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_themeable18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_themeable18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/overlay_warning18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/package18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/package18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/package_warning18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/package_warning18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/property18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/property18.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/property_internal18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/property_internal18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/property_private18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/property_private18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/property_protected18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/property_protected18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/property_themeable18.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/property_themeable18.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/search18.png =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/search18.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/_static/vline.gif =================================================================== (Binary files differ) Property changes on: workspace/thron7/misc/api2rst/api.rst/source/_static/vline.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: workspace/thron7/misc/api2rst/api.rst/source/conf.py =================================================================== --- workspace/thron7/misc/api2rst/api.rst/source/conf.py (rev 0) +++ workspace/thron7/misc/api2rst/api.rst/source/conf.py 2011-10-05 10:06:14 UTC (rev 21506) @@ -0,0 +1,220 @@ +# -*- coding: utf-8 -*- +# +# qooxdoo API Reference documentation build configuration file, created by +# sphinx-quickstart on Fri Sep 23 15:20:55 2011. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.todo', 'sphinx.ext.ifconfig'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'qooxdoo API Reference' +copyright = u'2011, thron7' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.6' +# The full version, including alpha/beta/rc tags. +release = '1.6' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +highlight_language = 'javascript' + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +#html_theme = 'default' +#html_theme = 'agogo' +html_theme = 'sphinxdoc' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# "<project> v<release> documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a <link> tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'qooxdoo-api-reference' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'qooxdoo-API-Reference.tex', u'qooxdoo API Reference', + u'qooxdoo developers', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'qooxdoo-api-reference', u'qooxdoo API Reference', + [u'thron7'], 1) +] Property changes on: workspace/thron7/misc/api2rst/api.rst/source/conf.py ___________________________________________________________________ Added: svn:eol-style + native Added: workspace/thron7/misc/api2rst/api.rst/source/index.rst =================================================================== --- workspace/thron7/misc/api2rst/api.rst/source/index.rst (rev 0) +++ workspace/thron7/misc/api2rst/api.rst/source/index.rst 2011-10-05 10:06:14 UTC (rev 21506) @@ -0,0 +1,22 @@ +.. Api Json-to-reST Renderer documentation master file, created by + sphinx-quickstart on Fri Sep 23 15:20:55 2011. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to the qooxdoo API Reference +===================================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + pages/qx.Class + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + Added: workspace/thron7/misc/api2rst/api.rst/source/pages/qx.Class.rst =================================================================== --- workspace/thron7/misc/api2rst/api.rst/source/pages/qx.Class.rst (rev 0) +++ workspace/thron7/misc/api2rst/api.rst/source/pages/qx.Class.rst 2011-10-05 10:06:14 UTC (rev 21506) @@ -0,0 +1,338 @@ +qx.Class +********************* + +* type: static +* :ref:`statics` +* :ref:`constants` + +.. _description: + +This class is one of the most important parts of qooxdoo’s object-oriented features. + +Its :ref:`define <define_method>` method is used to create qooxdoo classes. + +Each instance of a class defined by `define` has the following keys attached to the constructor and the prototype: + +.. list-table:: + :widths: 15 85 + + * - classname + - The fully-qualified name of the class (e.g. "qx.ui.core.Widget"). + * - basename + - The namespace part of the class name (e.g. "qx.ui.core"). + * - constructor + - A reference to the constructor of the class. + * - superclass + - A reference to the constructor of the super class. + +Each method may access static members of the same class by using this.self(arguments) (qx.core.Object#self): + +.. code-block:: javascript + + statics : { FOO : "bar" }, + members: { + baz: function(x) { + this.self(arguments).FOO; + ... + } + } + +Each overriding method may call the overridden method by using this.base(arguments [, ...]) (qx.core.Object#base). This is also true for calling the constructor of the superclass. + +.. code-block:: javascript + + members: { + foo: function(x) { + this.base(arguments, x); + ... + } + } + + +Inheritance hierarchy +====================== + +`Object <https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object>`__ -> **qx.Class** + + +.. _statics: + +Static methods +============== + +*(Here, methods as rows in a table. Nice visual structure, but less document structure possible, e.g. no section headings, so also no entries in page-TOC.)* + +.. list-table:: + :widths: 15 85 + + * - .. _define_method: + + **Class** + - **define**\ (String `name`, Map `config`?) + + Define a new class using the qooxdoo class system. This sets up the namespace for the class and generates the class from the definition map. + + **Example** + :: + + qx.Class.define("name", + { + extend : Object, // superclass + implement : [Interfaces], + include : [Mixins], + + statics: + { + CONSTANT : 3.141, + + publicMethod: function() {}, + _protectedMethod: function() {}, + __privateMethod: function() {} + }, + + properties: + { + "tabIndex": { check: "Number", init : -1 } + }, + + members: + { + publicField: "foo", + publicMethod: function() {}, + + _protectedField: "bar", + _protectedMethod: function() {}, + + __privateField: "baz", + __privateMethod: function() {} + } + }); + + **Parameters** + + .. list-table:: + :widths: 25 75 + + * - name + - Name of the class + * - config (default: null) + - Class definition structure. The configuration map has the following keys: + + .. list-table:: + :header-rows: 1 + + + * - Name + - Type + - Description + * - type + - String + - Type of the class. Valid types are “abstract”, “static” and “singleton”. If unset it defaults to a regular non-static class. + * - extend + - Class + - The super class the current class inherits from. + * - implement + - Interface | Interface[] + - Single interface or array of interfaces the class implements. + * - include + - Mixin | Mixin[] + - Single mixin or array of mixins, which will be merged into the class. + * - construct + - Function + - The constructor of the class. + * - statics + - Map + - Map of static members of the class. + * - properties + - Map + - Map of property definitions. For a description of the format of a property definition see qx.core.Property. + * - members + - Map + - Map of instance members of the class. + * - environment + - Map + - Map of environment settings for this class. For a description of the format of a setting see qx.core.Environment. + * - events + - Map + - Map of events the class fires. The keys are the names of the events and the values are the corresponding event type class names. + * - defer + - Function + - Function that is called at the end of processing the class declaration. It allows access to the declared statics, members and properties. + * - destruct + - Function + - The destructor of the class. + + + **Returns** + + The defined class. + + * - **(Class|null)** + - **getByInterface**\ (Class `clazz`, Interface `iface`) + + Returns the class or one of its super classes which contains the declaration of the given interface. Returns null if the interface is not specified anywhere. + + **Parameters** + + .. list-table:: + :widths: 25 75 + + * - clazz + - class to look for the interface + * - iface + - interface to look for + + **Returns** + + The class which directly implements the given interface + + +*(Or, methods as subsections. Provides more space for each method, and auto-generated page-TOC entries for navigation. But less visual structure.)* + + +.. _define: + +**define**\ (String `name`, Map `config`?) +------------------------------------------------- + +Define a new class using the qooxdoo class system. This sets up the namespace for the class and generates the class from the definition map. + +Example +^^^^^^^ +:: + + qx.Class.define("name", + { + extend : Object, // superclass + implement : [Interfaces], + include : [Mixins], + + statics: + { + CONSTANT : 3.141, + + publicMethod: function() {}, + _protectedMethod: function() {}, + __privateMethod: function() {} + }, + + properties: + { + "tabIndex": { check: "Number", init : -1 } + }, + + members: + { + publicField: "foo", + publicMethod: function() {}, + + _protectedField: "bar", + _protectedMethod: function() {}, + + __privateField: "baz", + __privateMethod: function() {} + } + }); + +Parameters +^^^^^^^^^^ + +.. list-table:: + :widths: 25 75 + + * - name + - Name of the class + * - config (default: null) + - Class definition structure. The configuration map has the following keys: + + .. list-table:: + :header-rows: 1 + :widths: 10 10 80 + + + * - Name + - Type + - Description + * - type + - String + - Type of the class. Valid types are “abstract”, “static” and “singleton”. If unset it defaults to a regular non-static class. + * - extend + - Class + - The super class the current class inherits from. + * - implement + - Interface | Interface[] + - Single interface or array of interfaces the class implements. + * - include + - Mixin | Mixin[] + - Single mixin or array of mixins, which will be merged into the class. + * - construct + - Function + - The constructor of the class. + * - statics + - Map + - Map of static members of the class. + * - properties + - Map + - Map of property definitions. For a description of the format of a property definition see qx.core.Property. + * - members + - Map + - Map of instance members of the class. + * - environment + - Map + - Map of environment settings for this class. For a description of the format of a setting see qx.core.Environment. + * - events + - Map + - Map of events the class fires. The keys are the names of the events and the values are the corresponding event type class names. + * - defer + - Function + - Function that is called at the end of processing the class declaration. It allows access to the declared statics, members and properties. + * - destruct + - Function + - The destructor of the class. + + +Returns +^^^^^^^ + + The defined class. + + + +**getByInterface**\ (Class `clazz`, Interface `iface`) +--------------------------------------------------------------------- + +Returns the class or one of its super classes which contains the declaration of the given interface. Returns null if the interface is not specified anywhere. + +**Parameters** + + .. list-table:: + :widths: 25 75 + + * - clazz + - class to look for the interface + * - iface + - interface to look for + +**Returns** + + The class which directly implements the given interface + + + +.. _constants: + +Constants +========= + +.. list-table:: + :widths: 15 85 + + * - **Map** + - **__allowedKeys** + + allowed keys in non-static class definition + + * - **Map** + - **__staticAllowedKeys** + + allowed keys in static class definition This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |