Problem with focus, Window and Popup

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

Problem with focus, Window and Popup

rsantiagopaz
Hi. I have this little problem controlling the focus between windows and popups.
Try this example.
When click on "Close popup" button, why the focus return to "Show popup" button, but not the window?
Really, the focus return to window, but the window's title bar remains white, not blue. When click with the mouse, then the title bar set blue.
This is a little bug, or I am doing wrong something?.
Thanks


var doc = this.getRoot();

var window = new qx.ui.window.Window().set({width: 200, height: 200});
window.setLayout(new qx.ui.layout.Basic());
window.addListenerOnce("appear", function(e){
        window.center();
});

var button1 = new qx.ui.form.Button("Show popup");
button1.addListener("execute", function(e){
        var popup = new qx.ui.popup.Popup(new qx.ui.layout.Basic()).set({width: 150, height: 100});
        popup.addListener("appear", function(e){
                button2.focus();
        });
        popup.addListener("disappear", function(e){
                window.focus();
                button1.focus();
        });
        var button2 = new qx.ui.form.Button("Close popup");
        button2.addListener("execute", function(e){
                popup.destroy();
        });
        popup.add(button2, {left: 20, top: 20});
        popup.placeToWidget(button1);
        popup.show();
});
window.add(button1, {left: 30, top: 30});
var textfield = new qx.ui.form.TextField();
window.add(textfield, {left: 30, top: 60});
doc.add(window);
window.open();
Reply | Threaded
Open this post in threaded view
|

Re: Problem with focus, Window and Popup

Christian Hagendorn
Administrator
CONTENTS DELETED
The author has deleted this message.