History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5533
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: André Bargull
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Text cannot have contextmenu

Created: 29/Feb/08 03:07 PM   Updated: 19/Mar/08 08:30 AM
Component/s: Kernel - swf6-8
Affects Version/s: Freya, RingDing (4.1), Legals
Fix Version/s: Mars, RingDing (4.1)

Time Tracking:
Not Specified

File Attachments: 1. File lpp-5533.lzx (2 kb)


Severity: Major
Fixed in Change#: 8,183
Runtime: N/A, SWF7, SWF8
Flags: Regression
Fix in hand: True


 Description  « Hide
User reported bug: "http://forum.openlaszlo.org/showthread.php?t=11612" and "http://forum.openlaszlo.org/showthread.php?t=7206"

Context-Menu for LzText doesn't work anymore in Freya / trunk, used to work in OL4.0.9 (and all prev. releases).

Fix: You need to attach the flash context-menu on the TextField (="getMCRef()").

Question: Who changed that code, he may explain these changes!

Also compare LzSprite#setContextMenu(..):

was:
[...]
    var mc = this.getMCRef();
    // [todo hqm 01-24-07] SWF-specific
    var mb = this.__LZbgRef;
    // If there's no movieclip attached, use the background clip.
    if (mc != null) {
        mc.menu = cmenu;
    }
    if (mb != null) {
        mb.menu = cmenu;
    }
[...]

Now: only for the canvas-sprite, the flash context-menu will be attached on the "control mc", this is wrong for LzText!
[...]
    // [todo hqm 01-24-07] SWF-specific
    if (this.owner == canvas) {
        // if this is the canvas sprite
        var mc = this.getMCRef();
        if (mc != null) {
            mc.menu = cmenu;
        }
    } else {
        var mb = this.__LZbgRef;
        if (mb == null) {
            this.setBGColor(0xffffff);
            var mb = this.__LZbgRef;
            mb._alpha = 0;
        }
        this._bgcolorhidden = true;
        mb.menu = cmenu;
    }
[...]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Amy Muntz - 29/Feb/08 04:57 PM
Max - can you take a look at this regression? Thanks.

P T Withington - 03/Mar/08 05:36 AM
According to svn-blame, Max made this change at r7444

Max Carlson - 05/Mar/08 01:45 PM
Testcase for contextmenus

Max Carlson - 05/Mar/08 02:15 PM
Author: max
Date: 2008-03-05 14:13:01 -0800 (Wed, 05 Mar 2008)
New Revision: 8182

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
Log:
Change 20080305-maxcarlson-w by maxcarlson@Roboto on 2008-03-05 13:48:58 PST
    in /Users/maxcarlson/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix contextmenu for canvas, text and inputtext

New Features:

Bugs Fixed: LPP-5533

Technical Reviewer: promanik
QA Reviewer: a.bargull@intensis.de
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: Attach to getMCRef() for canvas and LzTextSprite instances. If this is the canvas, attache to _root.menu. Move testing inside if ($debug) case.
    

Tests: See LPP-5533 and LPP-4212



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-03-05 21:52:19 UTC (rev 8181)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-03-05 22:13:01 UTC (rev 8182)
@@ -1634,9 +1634,13 @@
     }
 
     // [todo hqm 01-24-07] SWF-specific
- if (this.owner == canvas) {
- // if this is the canvas sprite
+ if (this.owner == canvas || this instanceof LzTextSprite) {
+ // check canvas for LPP-4214, instanceof LzTextSprite for LPP-5533
         var mc = this.getMCRef();
+ if (this.owner == canvas) {
+ // must use _root if canvas
+ var mc = _root;
+ }
         if (mc != null) {
             mc.menu = cmenu;
         }
@@ -1651,8 +1655,10 @@
         mb.menu = cmenu;
     }
 
- if (mb == null && mc == null) {
- if ($debug) Debug.warn("LzView.setContextMenu: cannot set menu on view %w, it has no foreground or background movieclip", this.owner);
+ if ($debug) {
+ if (mb == null && mc == null) {
+ Debug.warn("LzView.setContextMenu: cannot set menu on view %w, it has no foreground or background movieclip", this.owner);
+ }
     }
 }
 


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Max Carlson - 05/Mar/08 02:26 PM
Author: max
Date: 2008-03-05 14:23:35 -0800 (Wed, 05 Mar 2008)
New Revision: 8183

Modified:
   openlaszlo/branches/pagan-deities/
   openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
Log:
Merged revisions 8182 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r8182 | max | 2008-03-05 14:13:01 -0800 (Wed, 05 Mar 2008) | 24 lines
  
  Change 20080305-maxcarlson-w by maxcarlson@Roboto on 2008-03-05 13:48:58 PST
      in /Users/maxcarlson/openlaszlo/trunk
      for http://svn.openlaszlo.org/openlaszlo/trunk
  
  Summary: Fix contextmenu for canvas, text and inputtext
  
  New Features:
  
  Bugs Fixed: LPP-5533
  
  Technical Reviewer: promanik
  QA Reviewer: a.bargull@intensis.de
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details: Attach to getMCRef() for canvas and LzTextSprite instances. If this is the canvas, attache to _root.menu. Move testing inside if ($debug) case.
      
  
  Tests: See LPP-5533 and LPP-4212
.......



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,8144-8146,8176
   + /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,8144-8146,8176,8182

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-05 22:13:01 UTC (rev 8182)
+++ openlaszlo/branches/pagan-deities/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2008-03-05 22:23:35 UTC (rev 8183)
@@ -1628,9 +1628,13 @@
     }
 
     // [todo hqm 01-24-07] SWF-specific
- if (this.owner == canvas) {
- // if this is the canvas sprite
+ if (this.owner == canvas || this instanceof LzTextSprite) {
+ // check canvas for LPP-4214, instanceof LzTextSprite for LPP-5533
         var mc = this.getMCRef();
+ if (this.owner == canvas) {
+ // must use _root if canvas
+ var mc = _root;
+ }
         if (mc != null) {
             mc.menu = cmenu;
         }
@@ -1645,8 +1649,10 @@
         mb.menu = cmenu;
     }
 
- if (mb == null && mc == null) {
- if ($debug) Debug.warn("LzView.setContextMenu: cannot set menu on view %w, it has no foreground or background movieclip", this.owner);
+ if ($debug) {
+ if (mb == null && mc == null) {
+ Debug.warn("LzView.setContextMenu: cannot set menu on view %w, it has no foreground or background movieclip", this.owner);
+ }
     }
 }
 


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Mamye Kratt - 18/Mar/08 02:47 PM
(pagan-deities branch build r8311 - 4.0.11 RC)

Ran the testcase and checked with Andre. Closing.

Mamye Kratt - 18/Mar/08 02:47 PM
Need to test trunk.

Mamye Kratt - 19/Mar/08 08:30 AM
(trunk 4 build r8276)
Ran the testcase and checked with Andre. Closing.