[Laszlo-dev] For Review: Change 20090427-hqm-v Summary: fix for swf9 context menus
André Bargull
andre.bargull at udo.edu
Mon Apr 27 05:47:56 PDT 2009
I'd suggest to place the new context-menu stuff in LFCApplication.as
instead of SWF9Writer.java, because it's easier to maintain runtime code
in the LFC instead of the compiler. And you don't need to recompile the
whole server if you do some tiny changes.
Hm, the setter for the default context-menu in LzSprite doesn't do
anything at the moment.
On 4/27/2009 1:48 PM, Henry Minsky wrote:
> I just realized that I also need to add some way to forward the
> "onmenuopen" event to the appropriate
> LzContextMenu object, since a different ContextMenu object is actually
> being opened now.
>
> I'll add that in another change set.
>
>
>
> On Mon, Apr 27, 2009 at 1:00 AM, Henry Minsky <henry.minsky at gmail.com
> <mailto:henry.minsky at gmail.com>> wrote:
>
>
> NOTE, this is a change against the 4.2 branch, not trunk!
>
> Change 20090427-hqm-v by hqm at badtzmaru.home on 2009-04-27 00:51:30 EDT
> in /Users/hqm/openlaszlo/4.2
> for http://svn.openlaszlo.org/openlaszlo/branches/4.2
>
> Summary: fix for swf9 context menus
>
> New Features:
>
> Bugs Fixed: LPP-6980
>
> Technical Reviewer: andre
> QA Reviewer: max
> Doc Reviewer: (pending)
>
> Documentation:
>
> Release Notes:
>
> Details:
>
> + To work around the original bug (context menus don't work when
> mouseEnabled == false on any parent), I created a context menu at the
> very top level of the sprite hierarchy (in the LzSpriteApplication
> class, which is generated by SWF9Writer). This menu is the only
> context menu in the entire application that is active. This is ensured
> by having a "right-click-trap" sprite as the immediate child , that
> has mouseEnabled = false.
>
> The Laszlo app canvas sprite and its children are children of this
> 'right click trap' sprite.
>
> When a ContextMenuEvent.MENU_SELECT event is received by the active
> context menu, it uses getObjectUnderPoint to find the first view
> with a context menu,
> and copies the customItems from there to the active menu.
>
> + mouseEnabled is once again false by default for views, and is only
> set to true for clickable views. This should hopefully help with the
> CPU usage problem.
>
> Tests:
>
> test/contextmenu/api.lzx in swf9
> test/contextmenu/lpp-6980.lzx in swf9
>
>
> Files:
> M test/contextmenu/api.lzx
> M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
> M WEB-INF/lps/server/src/org/openlaszlo/compiler/SWF9Writer.java
>
> Changeset:
> http://svn.openlaszlo.org/openlaszlo/patches/20090427-hqm-v.tar
>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
>
>
More information about the Laszlo-dev
mailing list