]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/Modal.js
6906599434bb14086dd73644d4ecdf19c5998746
[gpl/argeo-slc.git] / org.argeo.slc.webapp / src / main / webapp / source / class / org / argeo / ria / components / Modal.js
1 /* ************************************************************************
2
3 Copyright: 2008 Argeo
4
5 License:
6
7 Authors: Charles du Jeu
8
9 ************************************************************************ */
10 qx.Class.define("org.argeo.ria.components.Modal",
11 {
12 extend : qx.ui.window.Window,
13
14 construct : function(caption, icon, text){
15 this.base(arguments);
16 this.set({
17 showMaximize : false,
18 showMinimize : false,
19 width: 200,
20 height: 150
21 });
22 this.setLayout(new qx.ui.layout.Dock());
23 var closeButton = new qx.ui.form.Button("Close");
24 closeButton.addListener("execute", function(e){
25 this.hide();
26 this.destroy();
27 }, this);
28 this.add(closeButton, {edge:'south'});
29 this.setModal(true);
30 this.center();
31 if(text){
32 this.addLabel(text);
33 }
34 },
35
36 members : {
37 addLabel:function(text){
38 this.add(new qx.ui.basic.Label(text), {edge:'center', width:'100%'});
39 },
40 addContent: function(panel){
41 this.add(panel, {edge:'center', width:'100%'});
42 },
43 attachAndShow:function(){
44 org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot().add(this);
45 this.show();
46 }
47 }
48 });