[Laszlo-checkins] r11458 - openlaszlo/trunk/WEB-INF/lps/lfc/services

bargull@openlaszlo.org bargull at openlaszlo.org
Wed Oct 15 06:44:48 PDT 2008


Author: bargull
Date: 2008-10-15 06:44:44 -0700 (Wed, 15 Oct 2008)
New Revision: 11458

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/services/LzContextMenu.lzs
Log:
Change 20081015-bargull-Q0K by bargull at dell--p4--2-53 on 2008-10-15 15:05:59
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: placement for contextmenus

New Features:

Bugs Fixed: LPP-7169

Technical Reviewer: hminsky
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Removed "final" modifier so constraints (et.al.) works for contextmenus in swf9.
Added "dynamic" modifier so setter look-up works (e.g required for "ignoreplacement").
Attaching contextmenu(item) to immediateparent instead of parent.
    

Tests:
both testcases at the bugreport



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzContextMenu.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzContextMenu.lzs	2008-10-15 13:14:56 UTC (rev 11457)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzContextMenu.lzs	2008-10-15 13:44:44 UTC (rev 11458)
@@ -28,7 +28,7 @@
   *
   * @shortdesc A contextual menu
   */
-public final class LzContextMenu extends LzNode {
+public dynamic class LzContextMenu extends LzNode {
 
     /** @access private
       * @modifiers override
@@ -38,6 +38,12 @@
     /** @access private */
     static var attributes :Object = new LzInheritedHash(LzNode.attributes);
 
+    /** contextmenus ignore placement by default
+      *
+      * @modifiers override
+      */
+    LzContextMenu.attributes.ignoreplacement = true;
+
     /** Send when the menu is opened
       * @lzxtype event
       */
@@ -73,9 +79,9 @@
     override function init () {
         super.init();
 
-        var p:LzNode = this.parent;
-        if (p && p is LzView) {
-            (p cast LzView).setContextMenu(this);
+        var ip:LzNode = this.immediateparent;
+        if (ip && ip is LzView) {
+            (ip cast LzView).setContextMenu(this);
         }
     }
 
@@ -174,7 +180,7 @@
   *
   * @shortdesc A menu item within a context menu
   */
-public final class LzContextMenuItem extends LzNode {
+public dynamic class LzContextMenuItem extends LzNode {
 
     /** @access private
       * @modifiers override
@@ -211,8 +217,9 @@
 
         this.kernel = new LzContextMenuItemKernel(this, title, del);
 
-        if (parent && parent is LzContextMenu) {
-            parent.addItem(this);
+        var ip:LzNode = this.immediateparent;
+        if (ip && ip is LzContextMenu) {
+            (ip cast LzContextMenu).addItem(this);
         }
     }
 



More information about the Laszlo-checkins mailing list