[Laszlo-checkins] r8430 - in openlaszlo/branches/pagan-deities: . WEB-INF/lps/lfc/kernel/swf
hqm@openlaszlo.org
hqm at openlaszlo.org
Wed Mar 26 11:12:04 PDT 2008
Author: hqm
Date: 2008-03-26 11:12:01 -0700 (Wed, 26 Mar 2008)
New Revision: 8430
Modified:
openlaszlo/branches/pagan-deities/
openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
Log:
Merged revisions 8424 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk
.......
r8424 | hqm | 2008-03-26 11:01:54 -0400 (Wed, 26 Mar 2008) | 63 lines
Change 20080326-hqm-F by hqm at badtzmaru.local on 2008-03-26 10:42:53 EDT
in /Users/hqm/openlaszlo/trunk4/WEB-INF/lps/lfc
for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc
Summary: fix for context-menu bug on views with image resource
New Features:
Bugs Fixed: LPP-5636, LPP-5670
Technical Reviewer: max
QA Reviewer: andre
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
+ Made setContextMenu set the menu on the foreground movieclip if
there is one
+ Made setResource copy the previous resource movieclip's menu to the
new resource movieclip.
If there was not a menu property on the foreground movieclip, try
copying the menu property from the
background-color movieclip.
Tests:
test case from bug report, right click over image area shows same menu
as over background area.
I used this test case, placed in the test/ directory, so as to access
the resource in
test/resources/gif/logo.gif
<canvas>
<view width="300" height="100" bgcolor="blue" resource="resources/gif/logo.gif">
<handler name="oninit">
var cm = new LzContextMenu();
cm.addItem(cm.makeMenuItem('new item 1'));
cm.addItem(cm.makeMenuItem('new item 2'));
setContextMenu(cm);
</handler>
<handler name="onclick">
this.setSource("resources/png/face.png");
</handler>
</view>
</canvas>
Click right on image and background areas to verify that image and background have custom context menu
Click left on view to load new resource
Click right on image and background areas to verify that image and background have the custom context menu
.......
Property changes on: openlaszlo/branches/pagan-deities
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-7950,7983,8021,8062,8126,8144-8146,8176,8182,8202,8239-8241,8243,8245-8256,8258-8263,8265-8266,8268-8271,8273,8276-8278,8280,8286-8291,8294,8296-8297
+ /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-7950,7983,8021,8062,8126,8144-8146,8176,8182,8202,8239-8241,8243,8245-8256,8258-8263,8265-8266,8268-8271,8273,8276-8278,8280,8286-8291,8294,8296-8297,8424
Modified: openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as
===================================================================
--- openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as 2008-03-26 16:38:08 UTC (rev 8429)
+++ openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as 2008-03-26 18:12:01 UTC (rev 8430)
@@ -197,6 +197,11 @@
this.setHeight(this.hassetheight?this.height:null);
this.setWidth(this.hassetwidth?this.width:null);
+ if (this.__contextmenu) {
+ this.setContextMenu(this.__contextmenu);
+ }
+
+
this.owner.__LZvizLoad = true;
this.owner.__LZupdateShown();
this.owner.resourceload({width: this.resourcewidth, height: this.resourceheight, resource: this.resource, skiponload: false});
Modified: openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-03-26 16:38:08 UTC (rev 8429)
+++ openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-03-26 18:12:01 UTC (rev 8430)
@@ -296,6 +296,10 @@
//from this context, but it's not necessary.
var mc = this.owner.immediateparent.sprite.attachResourceToChildView( resourceName, this );
this.setMovieClip( mc , resourceName );
+ // Copy previous right-click context menu if there is one,
+ // from background-color movieclip.
+ var oldmenu = this.__LZbgRef.menu;
+ mv.menu = oldmenu;
}
this.resource = resourceName;
@@ -321,10 +325,15 @@
var reclick = this.__LZbuttonRef._visible;
this.__LZbuttonRef = null;
+ var oldmenu = this.__LZmovieClipRef.menu;
+ if (oldmenu == null) {
+ oldmenu = this.__LZbgRef.menu;
+ }
var oldname = this.__LZmovieClipRef._name;
var mc = this.owner.immediateparent.sprite.attachResourceToChildView( resourceName, this, oldname);
this.setMovieClip( mc , resourceName );
+ mc.menu = oldmenu;
if ( reclick ){
this.setClickable( true );
@@ -544,6 +553,10 @@
}
this.__LZbgColorO.setRGB( bgc );
}
+ // Reapply context menu if needed
+ if (this.__contextmenu) {
+ this.setContextMenu(this.__contextmenu);
+ }
}
@@ -1647,6 +1660,12 @@
}
this._bgcolorhidden = true;
mb.menu = cmenu;
+
+ // Install menu on foreground resource clip if there is one
+ var mc = this.getMCRef();
+ if (mc != null) {
+ mc.menu = cmenu;
+ }
}
if ($debug) {
More information about the Laszlo-checkins
mailing list