Author: pbr Date: 2007-06-29 07:28:49 -0700 (Fri, 29 Jun 2007) New Revision: 5552
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs Log: Change 20070628-Philip-6 by [EMAIL PROTECTED] on 2007-06-28 11:24:58 EST in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/legals for http://svn.openlaszlo.org/openlaszlo/branches/legals Summary: Fix getContextMenu() New Features: Bugs Fixed: LPP-4155 Technical Reviewer: max QA Reviewer: (pending) Doc Reviewer: (pending) Documentation: Release Notes: Details: LaszloCanvas.lzs - Added a call to setContextMenu() in setDefaultContextMenu() to match the beh avior of 3.4. LaszloView.lzs - Removed this.contextMenu (not needed) - getContextMenu() calls the sprite to get the value LzSprite.as - Store current context menu in this.__contextmenu. - Added getContextMenu() LzSprite.js - Added getContextMenu() I found a small dhtml/swf issue that I submitted as LPP-4213. Tests: http://localhost:8080/legals/test/contextmenu/api.lzx?lzr=dhtml smokecheck passes This app runs in dhtml and swf: <canvas debug="true"> <button text="getContextMenu"> <handler name="onclick"> var cm = canvas.getContextMenu(); var del = new LzDelegate (this, 'myHandler'); cm.addItem(cm.makeMenuItem('My Function', del)); Debug.write(cm); </handler> <method name="myHandler"> Debug.write("myHandler"); </method> </button> </canvas> Files: M WEB-INF/lps/lfc/kernel/swf/LzSprite.as M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js M WEB-INF/lps/lfc/views/LaszloView.lzs M WEB-INF/lps/lfc/views/LaszloCanvas.lzs Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070628-Philip-6.tar Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js =================================================================== --- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2007-06-29 06:44:47 UTC (rev 5551) +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2007-06-29 14:28:49 UTC (rev 5552) @@ -1455,7 +1455,15 @@ this.__contextmenu = cmenu; } +/** + * LzView.getContextMenu + * Return the current context menu + */ +LzSprite.prototype.getContextMenu = function() { + return this.__contextmenu; +} + if (LzSprite.prototype.quirks.ie_leak_prevention) { LzSprite.prototype.__sprites = {}; Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as =================================================================== --- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-06-29 06:44:47 UTC (rev 5551) +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-06-29 14:28:49 UTC (rev 5552) @@ -1534,6 +1534,7 @@ LzSprite.prototype.setContextMenu = function ( cmenu ){ // For back compatibility, we accept either LzContextMenu or (Flash primitive) ContextMenu if (! (cmenu instanceof ContextMenu)) { + this.__contextmenu = cmenu; cmenu = cmenu.__LZcontextMenu(); } else { if ($debug) Debug.warn("Passing a Flash ContextMenu to LzView.setContextMenu is deprecated, use LzContextMenu instead"); @@ -1560,6 +1561,15 @@ } /** + * LzView.getContextMenu + * Return the current context menu + */ +LzSprite.prototype.getContextMenu = function() { + return this.__contextmenu; +} + + +/** * Register for update when the button gets the focus. * Set the behavior of the enter key depending on whether the field is * multiline or not. Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs =================================================================== --- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-06-29 06:44:47 UTC (rev 5551) +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-06-29 14:28:49 UTC (rev 5552) @@ -555,6 +555,7 @@ * @param LzContextMenu cmenu: LzContextMenu to install on this view */ function setDefaultContextMenu ( cmenu ){ + this.setContextMenu(cmenu); this.sprite.setDefaultContextMenu( cmenu ); } Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs =================================================================== --- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs 2007-06-29 06:44:47 UTC (rev 5551) +++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs 2007-06-29 14:28:49 UTC (rev 5552) @@ -2510,7 +2510,6 @@ * @param LzContextMenu cmenu: LzContextMenu to install on this view */ function setContextMenu ( cmenu ){ - this.contextMenu = cmenu; this.sprite.setContextMenu( cmenu ); } @@ -2521,7 +2520,7 @@ * @access public */ function getContextMenu ( ){ - return this.contextMenu; + return this.sprite.getContextMenu(); } } // End of LzView _______________________________________________ Laszlo-checkins mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins
