Changeset 76

Show
Ignore:
Timestamp:
07/24/08 17:07:56 (4 weeks ago)
Author:
bi..@lilyapp.org
Message:

fix bug #73

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/externals/patcher.js

    r75 r76  
    307307                setTimeout(function(){ 
    308308                        openPatchWin.obj.patchView.setPatchTitle("[subpatch]"); //mark it as a subpatch 
    309                         openPatchWin.obj.patchView.xulWin.moveBy(20,20); //move it a bit so its clear whats going on 
     309                        //openPatchWin.obj.patchView.xulWin.moveBy(20,20); //move it a bit so its clear whats going on 
    310310                },500); 
    311311                 
  • trunk/lily/lily/chrome/content/inspector.js

    r14 r76  
    7272//              LilyDebugWindow.print("open the window...")                              
    7373                if(!this.iWin) { 
    74                         this.iWin=window.openDialog("chrome://lily/content/inspector.xul", "iWin","width=300,height=300,left=50,top=550,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,chrome=yes",function(){LilyInspectorWindow.init(id);});                                         
     74                        var tmp_coords = LilyUtils.getOpenDialogCoords(300,300);         
     75                        this.iWin=window.openDialog("chrome://lily/content/inspector.xul", "iWin","width=300,height=300,left="+tmp_coords[0]+",top="+tmp_coords[1]+",toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,chrome=yes",function(){LilyInspectorWindow.init(id);});                                    
    7576                } else { 
    7677                        LilyInspectorWindow.init(id); 
  • trunk/lily/lily/chrome/content/lily.js

    r64 r76  
    11981198                }; 
    11991199                 
    1200                 win.openDialog("chrome://lily/content/patch-properties.xul", "cWin","width=450,height=450,left=50,top=250,close=no,scrollbars=no,dialog=yes,resizable=no,toolbar=no,menubar=no,location=no,status=no,chrome=yes,alwaysRaised=yes",function(val){ 
     1200                var tmp = LilyUtils.getOpenDialogCoords(450,450);                
     1201                 
     1202                win.openDialog("chrome://lily/content/patch-properties.xul", "cWin","width=450,height=450,left="+tmp[0]+",top="+tmp[1]+",close=no,scrollbars=no,dialog=yes,resizable=no,toolbar=no,menubar=no,location=no,status=no,chrome=yes,alwaysRaised=yes",function(val){ 
    12011203                        for(var x in val) { 
    12021204                                switch(x) { 
     
    12391241                } 
    12401242                 
     1243                var tmp = LilyUtils.getOpenDialogCoords(250,height); 
     1244                 
    12411245                var initVals = { color: color, type: type }; 
    12421246                 
    1243                 win.openDialog("chrome://lily/content/color.xul", "cWin","width=250,height="+height+",left=50,top=550,close=no,scrollbars=no,dialog=yes,resizable=no,toolbar=no,menubar=no,location=no,status=no,chrome=yes,alwaysRaised=yes",function (val) { 
     1247                win.openDialog("chrome://lily/content/color.xul", "cWin","width=250,height="+height+",left="+tmp[0]+",top="+tmp[1]+",close=no,scrollbars=no,dialog=yes,resizable=no,toolbar=no,menubar=no,location=no,status=no,chrome=yes,alwaysRaised=yes",function (val) { 
    12441248                        if(type=="patch") 
    12451249                                Lily.setPatchColor(val); 
     
    14581462                        opens the preferences dialog.                                                                                                                                    
    14591463        */ 
    1460         openPrefs: function() {                 
     1464        openPrefs: function() {          
    14611465        Lily.getCurrentPatch().patchView.xulWin.openDialog("chrome://lily/content/prefs.xul", "lilyPrefsDialog", "chrome,titlebar,toolbar,centerscreen,modal",LilyAPIKeyManager,LilyDebugWindow); 
    14621466        }, 
  • trunk/lily/lily/chrome/content/patch.js

    r75 r76  
    23022302        //standard patch         
    23032303        if(!this.patch.hidden && !this.patch.readonly && !extWin)       { 
    2304                 this.xulWin=window.openDialog("chrome://lily/content/patch.xul", pID,"width="+winWidth+",height="+winHeight+",left=50,top=150,menubar=yes,toolbar=no,location=no,resizable=yes,scrollbars=yes,status=yes,chrome=yes",initWindow,pID);    
     2304                var tmp_coords = LilyUtils.getOpenDialogOffset(winWidth,winHeight);      
     2305                this.xulWin=window.openDialog("chrome://lily/content/patch.xul", pID,"width="+winWidth+",height="+winHeight+",left="+tmp_coords[0]+",top="+tmp_coords[1]+",menubar=yes,toolbar=no,location=no,resizable=yes,scrollbars=yes,status=yes,chrome=yes",initWindow,pID);       
    23052306        //hidden patch 
    23062307        } else if(this.patch.hidden && !extWin) { 
     
    23112312                //this.xulWin=window.openDialog("chrome://lily/content/hiddenpatch.xul", pID,"",initReadOnlyWindow,pID);        //hidden patch   
    23122313        } else if(this.patch.readonly && !extWin) { 
    2313                 this.xulWin=window.openDialog("chrome://lily/content/readonlypatch.xul", pID,"width="+winWidth+",height="+winHeight+",left=50,top=150,menubar=yes,toolbar=no,location=no,resizable=yes,scrollbars=yes,status=yes,chrome=yes",initReadOnlyWindow,pID); 
     2314                var tmp_coords = LilyUtils.getOpenDialogOffset(winWidth,winHeight);              
     2315                this.xulWin=window.openDialog("chrome://lily/content/readonlypatch.xul", pID,"width="+winWidth+",height="+winHeight+",left="+tmp_coords[0]+",top="+tmp_coords[1]+",menubar=yes,toolbar=no,location=no,resizable=yes,scrollbars=yes,status=yes,chrome=yes",initReadOnlyWindow,pID); 
    23142316        //patch in iframe 
    23152317        } else if(extWin && extWin.type=="iframe") { 
  • trunk/lily/lily/chrome/content/utils.js

    r75 r76  
    13381338         
    13391339        /* 
     1340                Method: getOpenDialogCoords 
     1341                        get the coordiates for opening a dialog. 
     1342                 
     1343                Returns:  
     1344                        an array of x,y coords 
     1345        */ 
     1346        getOpenDialogCoords: function(w,h) { 
     1347                var sH = parseInt(window.screen.availHeight)/2; 
     1348                var sW = parseInt(window.screen.availWidth)/2; 
     1349                 
     1350                var x = (sW-parseInt(w/2)); 
     1351                var y = (sH-parseInt(h/2)); 
     1352                 
     1353                return [x,y]; 
     1354        }, 
     1355         
     1356        /* 
     1357                Method: getOpenDialogOffset 
     1358                        get the coordiates of all open windows and calculate an offset for a new window if any. 
     1359                 
     1360                Returns:  
     1361                        an array of x,y coords 
     1362        */ 
     1363        getOpenDialogOffset: function(w,h) { 
     1364                var tmp = Lily.getCurrentPatch(); 
     1365                         
     1366                if(     tmp && 
     1367                        parseInt(tmp.patchView.xulWin.screenX) &&  
     1368                        parseInt(tmp.patchView.xulWin.screenY) 
     1369                ) { 
     1370                        return [ 
     1371                                parseInt(tmp.patchView.xulWin.screenX)+15, 
     1372                                parseInt(tmp.patchView.xulWin.screenY)+15 
     1373                        ] 
     1374                } else { 
     1375                        var tmp_coords = this.getOpenDialogCoords(w,h); 
     1376                        return [tmp_coords[0],tmp_coords[1]]; 
     1377                } 
     1378        },       
     1379         
     1380        /* 
    13401381                Method: getObjectPos 
    13411382                        get the position of an object.