Hi Norbert,
> Thanks for the hint, Alex. I have now managed to extend the
> "contextmenu" event handler to make the menu popup next to the mouse cursor:
>
> htmlArea.addListener("contextmenu", function(e)
> {
> var mouseData = e.getData();
> var location = htmlArea.getContainerLocation();
> this.popupMenu.setOffsetLeft(mouseData.relX);
> this.popupMenu.setOffsetTop(-location.bottom + mouseData.y);
> this.popupMenu.open();
> }, this);
>
> Looks a bit weird, but it works. (BTW: Why doesn't the HtmlArea handle
> the positioning by itself?)
Yes, looks weird for the UI component, right. The HtmlArea is also available as
low-level component and in this case you do not have the full-featured menu
manager available.
But, yes the UI-level HtmlArea can also position the menu itself. You can file
this as an enhancement bug.
> Now I have another problem: Once the popup menu is opened, how do I
> close it if I don't want to click on one of its options? Clicking outside the
> menu's client area doesn't work, pressing ESC works sometimes but mostly it
> doesn't (http://tinyurl.com/27km6dj). And since the HtmlArea doesn't fire any
> "keypress" or "click" event I can't even handle this task "manually".
The problem here is that the menu manager does listen to the "mousedown" events
of the document, but since the HtmlArea does provide its own document these
"mousedown" events are not captured. The HtmlArea itself has to implement the
functionality of providing the "mousedown" event at the HtmlArea instance.
Right now the event does not bubble and therefore it can't be used. Again, file
a bug report for this issue.
Regards,
Alex
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel