resources/RooUsage.txt
[app.Builder.js] / old-javascript / XObjectBase / GdlDockItem.js
1
2 //<Script type="Text/javascript">
3
4 XObject = imports.XObject.XObject
5 Gdl     = imports.gi.Gdl;
6 // Cell render text..
7
8 GdlDockItem = XObject.define(
9     function(cfg) {
10         XObject.call(this, cfg);
11     }, 
12     XObject,
13     {
14         
15         placement :  Gdl.DockPlacement.TOP,
16         behaviour : 0,
17         // name / long name...
18         
19         pack : function(parent, item) 
20         {
21             if (XObject.type(parent.el) == 'GdlDock') {
22                 parent.el.add_item (this.el, this.placement || Gdl.DockPlacement.TOP);
23                 return;
24             }
25             // otherwise 
26             parent.el.dock_to (this.el, this.placement || Gdl.DockPlacement.TOP, -1);
27             //     dock.add_item (item2, Gdl.DockPlacement.RIGHT);
28             
29             
30         },
31         init : function()
32         {
33             GdlDockItem.id = GdlDockItem.id ? GdlDockItem.id + 1 : 1;
34             
35             //new Gdl.DockItem.with_stock  ("item3",
36             //             "Item #3 has accented characters ( )",
37             //             Gtk.STOCK_CONVERT,
38             //             Gdl.DockItemBehavior.NORMAL | Gdl.DockItemBehavior.CANT_CLOSE);
39             
40             
41             this.el = new Gdl.GdlDockItem.c_new (
42                 this.name       || 'Dock' + GdlDockItem.id, 
43                 this.long_name  || 'Dock' + GdlDockItem.id, 
44                 this.behaviour  || 0 //Gdl.DockItemBehavior.LOCKED
45             );
46             
47             
48             XObject.prototype.init.call(this);
49         }
50     }
51 };