about Popup and ContextMenu

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

about Popup and ContextMenu

rsantiagopaz
Hi. I have this example. Try in the Playground. Click the button, then right click in the TextArea. The contextmenu appear behind the Popup.
I need some tip or little help about how control the the overlapping between Popup and ContextMenu. I need ContextMenu appear upon Popup.

var doc = this.getRoot();
var menu = new qx.ui.menu.Menu();
var btnDelete = new qx.ui.menu.Button("Delete all text");
var btnCopy = new qx.ui.menu.Button("Copy all text");
menu.add(btnDelete);
menu.addSeparator();
menu.add(btnCopy);

var button = new qx.ui.form.Button("Open popup");
button.addListener("execute", function(e){
        var text = new qx.ui.form.TextArea();
        text.setContextMenu(menu);
        var popup = new qx.ui.popup.Popup(new qx.ui.layout.Canvas()).set({width: 100, height: 100});
        popup.add(text, {left: 5, top: 5, right: 5, bottom: 5});
        popup.placeToWidget(button);
        popup.show();
});
doc.add(button, {left: 50, top: 50});
Reply | Threaded
Open this post in threaded view
|

Re: about Popup and ContextMenu

rsantiagopaz
Forget it. Now I know de zindex function.