Subversion Repositories eFlore/Applications.cel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
27 jpm 1
/*
2
 * Ext JS Library 2.0.2
3
 * Copyright(c) 2006-2008, Ext JS, LLC.
4
 * licensing@extjs.com
5
 *
6
 * http://extjs.com/license
7
 */
8
 
9
/**
10
 * @class Ext.ReaderLayout
11
 * @extends Ext.BorderLayout
12
 * This is a pre-built layout that represents a classic, 5-pane application.  It consists of a header, a primary
13
 * center region containing two nested regions (a top one for a list view and one for item preview below),
14
 * and regions on either side that can be used for navigation, application commands, informational displays, etc.
15
 * The setup and configuration work exactly the same as it does for a {@link Ext.BorderLayout} - this class simply
16
 * expedites the setup of the overall layout and regions for this common application style.
17
 * Example:
18
 <pre><code>
19
var reader = new Ext.ReaderLayout();
20
var CP = Ext.ContentPanel;  // shortcut for adding
21
 
22
reader.beginUpdate();
23
reader.add("north", new CP("north", "North"));
24
reader.add("west", new CP("west", {title: "West"}));
25
reader.add("east", new CP("east", {title: "East"}));
26
 
27
reader.regions.listView.add(new CP("listView", "List"));
28
reader.regions.preview.add(new CP("preview", "Preview"));
29
reader.endUpdate();
30
</code></pre>
31
* @constructor
32
* Create a new ReaderLayout
33
* @param {Object} config Configuration options
34
* @param {Mixed} container (optional) The container this layout is bound to (defaults to
35
* document.body if omitted)
36
*/
37
Ext.ReaderLayout = function(config, renderTo){
38
    var c = config || {size:{}};
39
    Ext.ReaderLayout.superclass.constructor.call(this, renderTo || document.body, {
40
        north: c.north !== false ? Ext.apply({
41
            split:false,
42
            initialSize: 32,
43
            titlebar: false
44
        }, c.north) : false,
45
        west: c.west !== false ? Ext.apply({
46
            split:true,
47
            initialSize: 200,
48
            minSize: 175,
49
            maxSize: 400,
50
            titlebar: true,
51
            collapsible: true,
52
            animate: true,
53
            margins:{left:5,right:0,bottom:5,top:5},
54
            cmargins:{left:5,right:5,bottom:5,top:5}
55
        }, c.west) : false,
56
        east: c.east !== false ? Ext.apply({
57
            split:true,
58
            initialSize: 200,
59
            minSize: 175,
60
            maxSize: 400,
61
            titlebar: true,
62
            collapsible: true,
63
            animate: true,
64
            margins:{left:0,right:5,bottom:5,top:5},
65
            cmargins:{left:5,right:5,bottom:5,top:5}
66
        }, c.east) : false,
67
        center: Ext.apply({
68
            tabPosition: 'top',
69
            autoScroll:false,
70
            closeOnTab: true,
71
            titlebar:false,
72
            margins:{left:c.west!==false ? 0 : 5,right:c.east!==false ? 0 : 5,bottom:5,top:2}
73
        }, c.center)
74
    });
75
 
76
    this.el.addClass('x-reader');
77
 
78
    this.beginUpdate();
79
 
80
    var inner = new Ext.BorderLayout(Ext.getBody().createChild(), {
81
        south: c.preview !== false ? Ext.apply({
82
            split:true,
83
            initialSize: 200,
84
            minSize: 100,
85
            autoScroll:true,
86
            collapsible:true,
87
            titlebar: true,
88
            cmargins:{top:5,left:0, right:0, bottom:0}
89
        }, c.preview) : false,
90
        center: Ext.apply({
91
            autoScroll:false,
92
            titlebar:false,
93
            minHeight:200
94
        }, c.listView)
95
    });
96
    this.add('center', new Ext.NestedLayoutPanel(inner,
97
            Ext.apply({title: c.mainTitle || '',tabTip:''},c.innerPanelCfg)));
98
 
99
    this.endUpdate();
100
 
101
    this.regions.preview = inner.getRegion('south');
102
    this.regions.listView = inner.getRegion('center');
103
};
104
 
105
Ext.extend(Ext.ReaderLayout, Ext.BorderLayout);