/* *******************************************************************************
 * Use Plugin Namespace
 */
var Plugin = Plugin || {};



/*
 * Layout Window GUI
 * under the Plugin namespace
 */
Plugin.LayoutWindow = Ext.extend(Ext.app.Module, {
    id : 'layout-win',
    
    init : function(){
        this.launcher = {
            text: 'Mon CV...',
            iconCls:'bogus',
            handler : this.createWindow,
            scope: this
        }
    },

    createWindow : function(){
        var desktop = this.app.getDesktop();
        var win = desktop.getWindow('layout-win');
        if(!win){
            var winWidth = desktop.getWinWidth() / 1.1;
            var winHeight = desktop.getWinHeight() / 1.1;
            
            win = desktop.createWindow({
                id: 'layout-win',
                title:'Mon CV',
                width:winWidth,
                height:winHeight,
                x:desktop.getWinX(winWidth),
                y:desktop.getWinY(winHeight),
                iconCls: 'bogus',
                shim:false,
                animCollapse:false,
                constrainHeader:true,
                minimizable:true,
                maximizable:true,

                layout: 'border',
                /*
                tbar:[{
                    text: 'Bouton 1'
                },{
                    text: 'Bouton 2'
                }], */
                items:[/*{
                    region:'north',
                    border:false,
                    elements:'body',
                    height:30
                },*/{
                    region:'west',
                    autoScroll:true,
                    collapsible:true,
                    cmargins:'0 0 0 0',
                    margins:'0 0 0 0',
                    split:true,
                    title:'Comp&eacute;tences',
                    autoLoad: {url: 'liste.html', callback: this.initSearch, scope: this},
                    width:parseFloat(winWidth*0.3) < 301 ? parseFloat(winWidth*0.3) : 300
                },{
                    region:'center',
                    border:false,
                    layout:'border',
                    margins:'0 0 0 0',
                    items:[{
                        region:'north',
                        elements:'body',
                        title:'Exp&eacute;riences',
                        autoScroll:true,
                        //height:winHeight*0.5,
                        height:winHeight,
                        autoLoad: {url: 'web.html', callback: this.initSearch, scope: this},
                        split:true
                    }/*,{
                        autoScroll:true,
                        elements:'body',
                        region:'center',
                        id:'Details',
                        autoLoad: {url: 'embarque.html', callback: this.initSearch, scope: this},
                        title:'Applications Logiciel Embarqu&eacute;'
                    }*/]
                }/*,{
                    region:'south',
                    border:false,
                    elements:'body',
                    height:25
                }*/]
            });
        }
        win.show();
    }
});
