3 Gilbert.lib.Desktop = Ext.extend(Ext.Panel, {
4 constructor: function(config) {
5 Gilbert.lib.Desktop.superclass.constructor.call(this, Ext.applyIf(config||{}, {
9 bodyStyle: 'background: none;',
14 Gilbert.lib.MainMenu = Ext.extend(Ext.Toolbar, {
15 constructor: function(application) {
16 var application = this.application = application;
17 Gilbert.lib.MainMenu.superclass.constructor.call(this, {
24 Gilbert.lib.Application = Ext.extend(Ext.util.Observable, {
25 constructor: function(config) {
26 Ext.apply(this, config, {
27 renderTo: Ext.getBody(),
31 Gilbert.lib.Application.superclass.constructor.call(this);
40 var desktop = this.desktop = new Gilbert.lib.Desktop();
41 var mainmenu = this.mainmenu = new Gilbert.lib.MainMenu(this);
42 var viewport = this.viewport = new Ext.Viewport({
43 renderTo: this.renderTo,
50 var windows = this.windows = new Ext.WindowGroup();
53 if (Ext.isArray(this.plugins)) {
54 for (var i = 0; i < this.plugins.length; i++) {
55 this.plugins[i] = this.initPlugin(this.plugins[i]);
58 this.plugins = this.initPlugin(this.plugins);
64 this.fireEvent('ready', this);
66 initPlugin: function(plugin) {
70 createWindow: function(config, cls) {
71 var win = new(cls||Ext.Window)(Ext.applyIf(config||{},{
72 renderTo: this.desktop.el,
73 manager: this.windows,
74 constrainHeader: true,
76 win.render(this.desktop.el);
79 doLayout: function() {
80 this.mainmenu.doLayout();
81 this.viewport.doLayout();