Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / examples / desktop / TabWindow.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /*!
16  * Ext JS Library 4.0
17  * Copyright(c) 2006-2011 Sencha Inc.
18  * licensing@sencha.com
19  * http://www.sencha.com/license
20  */
21
22 Ext.define('MyDesktop.TabWindow', {
23     extend: 'Ext.ux.desktop.Module',
24
25     requires: [
26         'Ext.tab.Panel'
27     ],
28
29     id:'tab-win',
30
31     init : function(){
32         this.launcher = {
33             text: 'Tab Window',
34             iconCls:'tabs',
35             handler : this.createWindow,
36             scope: this
37         }
38     },
39
40     createWindow : function(){
41         var desktop = this.app.getDesktop();
42         var win = desktop.getWindow('tab-win');
43         if(!win){
44             win = desktop.createWindow({
45                 id: 'tab-win',
46                 title:'Tab Window',
47                 width:740,
48                 height:480,
49                 iconCls: 'tabs',
50                 animCollapse:false,
51                 border:false,
52                 constrainHeader:true,
53
54                 layout: 'fit',
55                 items: [
56                     {
57                         xtype: 'tabpanel',
58                         activeTab:0,
59                         bodyStyle: 'padding: 5px;',
60
61                         items: [{
62                             title: 'Tab Text 1',
63                             header:false,
64                             html : '<p>Something useful would be in here.</p>',
65                             border:false
66                         },{
67                             title: 'Tab Text 2',
68                             header:false,
69                             html : '<p>Something useful would be in here.</p>',
70                             border:false
71                         },{
72                             title: 'Tab Text 3',
73                             header:false,
74                             html : '<p>Something useful would be in here.</p>',
75                             border:false
76                         },{
77                             title: 'Tab Text 4',
78                             header:false,
79                             html : '<p>Something useful would be in here.</p>',
80                             border:false
81                         }]
82                     }
83                 ]
84             });
85         }
86         win.show();
87         return win;
88     }
89 });
90