f5d40b57bd7683ef28d122abfee52689ff6c7669
[app.Builder.js] / Sample / RooProjectProperties.js
1 Gtk = imports.gi.Gtk;
2 Gdk = imports.gi.Gdk;
3 Pango = imports.gi.Pango;
4 GLib = imports.gi.GLib;
5 Gio = imports.gi.Gio;
6 GObject = imports.gi.GObject;
7 GtkSource = imports.gi.GtkSource;
8 WebKit = imports.gi.WebKit;
9 Vte = imports.gi.Vte;
10 console = imports.console;
11 XObject = imports.XObject.XObject;
12 RooProjectProperties=new XObject({
13     xtype: Gtk.Dialog,
14     modal : true,
15     show : function() {
16         this.el.show_all();
17     },
18     default_width : 500,
19     listeners : {
20         "delete_event":function (self, event) {
21             this.el.hide()
22             return true;
23         },
24         "response":function (self, response_id) {
25            print(response_id);
26            this.el.hide();
27         }
28     },
29     items : [
30         {
31             xtype: Gtk.VBox,
32             pack : function(p,e) {
33                         p.el.get_content_area().add(e.el);
34                         e.border_width  =5;
35                     },
36             items : [
37                 {
38                     xtype: Gtk.Table,
39                     pack : "pack_start,true,true,3",
40                     init : function() {
41                         this.el = new Gtk.Table.c_new(1,2, true);
42                         XObject.prototype.init.call(this);
43                     
44                     },
45                     items : [
46                         {
47                             xtype: Gtk.Label,
48                             pack : "attach,0,1,0,1,0,0,0,0",
49                             label : "baseURL "
50                         },
51                         {
52                             xtype: Gtk.Entry,
53                             pack : "attach,1,2,0,1,5"
54                         },
55                         {
56                             xtype: Gtk.Label,
57                             pack : "attach,0,1,1,2,0,0,1,0",
58                             label : "login:"
59                         },
60                         {
61                             xtype: Gtk.Entry,
62                             pack : "attach,1,2,1,2,5"
63                         },
64                         {
65                             xtype: Gtk.Label,
66                             pack : "attach,0,1,2,3,0,0,1,0",
67                             label : "password"
68                         },
69                         {
70                             xtype: Gtk.Entry,
71                             pack : "attach,1,2,2,3,5",
72                             visibility : false
73                         }
74                     ]
75                 }
76             ]
77         },
78         {
79             xtype: Gtk.Button,
80             pack : "add_action_widget,1",
81             label : "OK"
82         },
83         {
84             xtype: Gtk.Button,
85             pack : "add_action_widget,0",
86             label : "Cancel"
87         }
88     ]
89 });
90 RooProjectProperties.init();
91 XObject.cache['/RooProjectProperties'] = RooProjectProperties;