Hi Andrew,

On Tuesday 09 August 2011 13:55:35 Andrew Goldberg wrote:
> I have a list of widgets (custom list items) that I'd like to have
> right-click / context menus for. However, I do not want the action of
> opening the menu to actually select the corresponding list item. Is this
> possible?
You can subclass the "qx.ui.form.List" widget and set a custom selection 
manager (this class is reponsible for selection list items).

You have to set the "SELECTION_MANAGER" variable to your own selection manager 
which itself extends the "qx.ui.core.selection.ScrollArea" selection manager 
class. In your own selection manager class you can overwrite the 
"handleMouseDown" method and check for the mouse button which was pressed.
If the user clicks the left button simply call the base method. If the user 
clicks the right button show your context menu and do nothing else (no call to 
the base method).

> I've tried several combinations of putting "e.stopPropagation()"
> and "e.preventDefault()" in the contextmenu listener function, but it
> seems the change selection event happens anyway. 
Yes, because the selection manager does handle that already as described 
above.

> Instead of a contextmenu, another option is to have a small button in each 
> list item that brings up the menu---is there an easier way to handle clicks 
> on a child control without selecting the parent listitem widget?
Same as above. You have to go for an own selection manger class, I guess. The 
selection handling is done at list level and not at list item level. So there 
will always be a selection if you do not modify the selection manager which is 
responsible for that.

Regards,
  Alex

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to