Daniel,

Thanks for the idea, finally I take out the context from every widget, they
have no context menu, and on the onClick event i show the context menu (or
not) with this line:

context.openAtMouse(event);

Thanks you all for your help!

---
A. Matías Quezada



2012/7/11 Daniel Wagner <daniel.wag...@1und1.de>

> I see. beforeContextmenuOpen is triggered by the menu's changeVisibility
> event, so it's fired by all widgets that share the menu. I guess you
> could add mousedown/mouseup listeners to the widgets that enable/disable
> a flag on the widget. Then in onBeforeContextmenuOpen you could check if
> the event target has the flag enabled to determine which widget was
> right-clicked.
> Not the most elegant solution, but I can't think of a better one right now.
>
> On 07/11/2012 12:01 PM, A Matías Quezada wrote:
> > You are right, it works, but it's because you have only one item with
> > context menu, I noticed the problem is than when I right-click one item
> > the beforeContextmenuOpen is fired as many times as items I have on the
> > screen and this produces strange behaviours:
> >
> > You can see an example here: *http://tinyurl.com/d3kwzxb*
> >
> > Open the console and right-click one box, it's confusing.
> >
> >
> >
> > 2012/7/11 Daniel Wagner <daniel.wag...@1und1.de
> > <mailto:daniel.wag...@1und1.de>>
> >
> >     Hi,
> >
> >     "beforeContextmenuOpen" is the right event for this. Instead of
> setting
> >     contextMenu to null on your Atom, try calling show() or hide() on
> >     the menu:
> >
> >     http://tinyurl.com/bmjfec4
> >
> >
> >     Regards,
> >     Daniel
> >
> >     On 07/10/2012 05:37 PM, A Matías Quezada wrote:
> >      > Hi all,
> >      >
> >      > I have a problem with context menus, I've a file browser like
> app, it
> >      > shows a set of files as atoms and you can navigate through
> folders.
> >      >
> >      > I've captured the 'contextmenu' event of every atom, and when
> >     it's fired
> >      > I execute .prepareContextMenu() method who will show/exclude menu
> >     items
> >      > depending on a set of states.
> >      >
> >      > It works all right, but sometimes due to the configuration I
> >     don't want
> >      > to show any item so the context menu is displayed as a one-pixel
> box
> >      > with shadow. This is horrible so I want to not show the menu if
> there
> >      > are no items to display. I tried with event.preventDefault() but
> it
> >      > didn't work, the context menu is still there. So I thought than
> if I
> >      > remove the context menu from the atom on the "contextMenu" event
> >      > "atom.setContextMenu(null)" it will not show any context but this
> >     does
> >      > not work, it shows the menu it had before the event was fired.
> >      >
> >      > Then I captured "beforeContextmenuOpen" instead of "contextMenu"
> >     event,
> >      > but it was worse, "beforeContextmenuOpen" is not fired once I
> >     setted the
> >      > contextMenu property to null and it didn't work either. And at
> last I
> >      > tried with "click" event but the same problem happens.
> >      >
> >      > So I'm desperated isn't any way to disable the context menu of a
> >     widget
> >      > on the fly? that is, when the contextMenu event is fired?
> >      >
> >      > Thanks
> >      >
> >      > ---
> >      > A. Matías Quezada
> >      > amati...@gmail.com <mailto:amati...@gmail.com>
> >     <mailto:amati...@gmail.com <mailto:amati...@gmail.com>>
> >      >
> >      >
> >      >
> >
> ------------------------------------------------------------------------------
> >      > Live Security Virtual Conference
> >      > Exclusive live event will cover all the ways today's security and
> >      > threat landscape has changed and how IT managers can respond.
> >     Discussions
> >      > will include endpoint security, mobile security and the latest in
> >     malware
> >      > threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >      >
> >      >
> >      >
> >      > _______________________________________________
> >      > qooxdoo-devel mailing list
> >      > qooxdoo-devel@lists.sourceforge.net
> >     <mailto:qooxdoo-devel@lists.sourceforge.net>
> >      > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >      >
> >
> >
> >
> ------------------------------------------------------------------------------
> >     Live Security Virtual Conference
> >     Exclusive live event will cover all the ways today's security and
> >     threat landscape has changed and how IT managers can respond.
> >     Discussions
> >     will include endpoint security, mobile security and the latest in
> >     malware
> >     threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >     _______________________________________________
> >     qooxdoo-devel mailing list
> >     qooxdoo-devel@lists.sourceforge.net
> >     <mailto:qooxdoo-devel@lists.sourceforge.net>
> >     https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >
> >
> >
> > _______________________________________________
> > qooxdoo-devel mailing list
> > qooxdoo-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> >
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to