Dear All~
I just have some test for the Right Click~
But I find, There is some thing wrong with my source Code, could you help me please?
 
[Source Code]
<?xml version="1.0" encoding="UTF-8" ?>
<canvas>
<script>
function rightclick_handler (obj, menuobj) {
   Debug.write("rightclick context menu", obj, menuobj);
  }
 function my_itemhandler(obj, item) {
     Debug.write("menu item selected", obj, item);
 }
 
 var cm1 = new ContextMenu(rightclick_handler);
 cm1.hideBuiltInItems();
 cm1.addItem(new ContextMenuItem("LZX Canvas Custom Item!", my_itemhandler));
 canvas.setContextMenu(cm1);
 
 var cm2 = new ContextMenu(rightclick_handler);
 cm2.hideBuiltInItems();
 cm2.addItem(new ContextMenuItem("View Custom Item 1", my_itemhandler));
 cm2.addItem(new ContextMenuItem("View Custom Item 2", my_itemhandler));
 
 
 var cm3 = new ContextMenu(rightclick_handler);
 cm3.hideBuiltInItems();
 cm3.addItem(new ContextMenuItem("Text Custom Item 1", my_itemhandler));
 cm3.addItem(new ContextMenuItem("Text Custom Item 2", my_itemhandler));
 cm3.addItem(new ContextMenuItem("Text Custom Item 3", my_itemhandler));
 
</script>
 
<view name = "p1" width = "400" height = "400" bgcolor = "#000000">
 <method event = "oninit">
  setContextMenu(cm1);
 </method>
 <view name = "p2" width = "300" height = "300" x= "100" y = "100" bgcolor = "#ff0000">
  <method event = "oninit" >
   setContextMenu(cm2);
  </method>
  <view name = "p3" width = "200" height = "200" clickable = "true" x= "200" y= "200" bgcolor = "#0000ff" >
   <method event = "oninit">
    setContextMenu(cm3);
   </method>
  </view>
 </view>
</view>
</canvas>
[/Source Code]
 
juet Like the Source Code show, I write 3 views here, p1,p2,p3, And with filiation.
And there show only p1's right click worked, but p1's right click menu could not work.
and for p3, if I add "clickable = true"or "onmouse" event, the p3 also don't have the right click menu.
 
Why parent's could not work, why left cilck could not work ~
Wish it could be solved~
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to