Change 20071018-Philip-0 by Philip@Philip-DC on 2007-10-18 20:23:02 EDT      in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk      for http://svn.openlaszlo.org/openlaszlo/trunk
Change 20071018-Philip-0 by Philip@Philip-DC on 2007-10-18 20:23:02 EDT
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix context menu for dhtml (to match swf)

New Features:

Bugs Fixed: LPP-4213

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

Documentation:

Release Notes:

Details:
The context menu worked differently in swf and dhtml. In swf, duplicate captions
  are not displayed. I added this behavior to dhtml. swf is only sensitive to the
  caption name, and not the method name called.


Tests:
Run the following test in swf and dhtml. When you right click on the canvas you should see:

swf
---
   About OpenLaszlo...
   View Source
   My Function
   box4
   box5
   box6
   ------
   Settings
   ------
   About Adobe Flash Player 9...

dhtml
-----
   About OpenLaszlo...
   View Source
   My Function
   box4
   box5
   box6



<canvas debug="true">

   <class name="box">
     <handler name="oninit">
       var cm = canvas.getContextMenu();
       var del = new LzDelegate (this, 'cmHandler');
       cm.addItem(cm.makeMenuItem('My Function', del));
     </handler>

     <method name="cmHandler">
       Debug.write("cmHandler", this);
     </method>
   </class>

   <class name="uniquebox">
     <handler name="oninit">
       var cm = canvas.getContextMenu();
       var del = new LzDelegate (this, 'cmHandler');
       cm.addItem(cm.makeMenuItem(this.id, del));
     </handler>

     <method name="cmHandler">
       Debug.write("cmHandler", this);
     </method>
   </class>

   <handler name="oninit">
     var cm = canvas.getContextMenu();
     var del = new LzDelegate (this, 'cmHandler');
     cm.addItem(cm.makeMenuItem('My Function', del));
   </handler>

   <method name="cmHandler">
     Debug.write("cmHandler", this);
   </method>

   <simplelayout axis="x" spacing="10"/>
   <box width="50" height="50" name="box1" bgcolor="red"/>
   <box width="50" height="50" name="box2" bgcolor="green"/>
   <box width="50" height="50" name="box3" bgcolor="blue"/>
   <uniquebox width="50" height="50" name="box4" bgcolor="red"/>
   <uniquebox width="50" height="50" name="box5" bgcolor="green"/>
   <uniquebox width="50" height="50" name="box6" bgcolor="blue"/> </canvas>



Files:
M      WEB-INF/lps/lfc/kernel/dhtml/LzContextMenu.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071018-Philip-0.tar



git-svn-id: d62bde4b5aa582fdf07c8d403e53e0399a7ed285@6976 fa20e4f9-1d0a-0410-b5f3-dc9c16b8b17c

mcarlson/openlaszlo,mcarlson/openlaszlo,mcarlson/openlaszlo,mcarlson/openlaszlo,mcarlson/openlaszlo,mcarlson/openlaszlo,mcarlson/openlaszlo