qx.Class.define('qooxdoo_test_app.MessageDialog', {
    extend: qx.ui.window.Window,

    construct: function (title, message) {
        this.base(arguments, title);

        this.setLayout(new qx.ui.layout.Canvas());
        this.setAllowMaximize(false);
        this.setAllowMinimize(false);
        this.setWidth(320);
        this.setHeight(200);
        this.setModal(true);

        this.add(new qx.ui.basic.Label().set({
            value: '<p style="text-align: left; font-size: 12px;">' + message + '<p>',
            rich : true,
            allowGrowX: false,
            allowGrowY: true,
            alignX: 'center',
            height: 45
        }), {
            left: 15, top: 15, right: 15, bottom: 15 
        });

        var closeButton = new qx.ui.form.Button('Sulge');
        this.add(closeButton, {
            right: 15, bottom: 15 
        });
        
        closeButton.addListener('execute', function () {
            this.close();
        }, this);
        
        this.addListener('resize', function() {
            this.center();
        }, this);
    }
});