Changeset 76
- Timestamp:
- 07/24/08 17:07:56 (4 weeks ago)
- Files:
-
- trunk/lily/lily/chrome/content/externals/patcher.js (modified) (1 diff)
- trunk/lily/lily/chrome/content/inspector.js (modified) (1 diff)
- trunk/lily/lily/chrome/content/lily.js (modified) (3 diffs)
- trunk/lily/lily/chrome/content/patch.js (modified) (2 diffs)
- trunk/lily/lily/chrome/content/utils.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/externals/patcher.js
r75 r76 307 307 setTimeout(function(){ 308 308 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 on309 //openPatchWin.obj.patchView.xulWin.moveBy(20,20); //move it a bit so its clear whats going on 310 310 },500); 311 311 trunk/lily/lily/chrome/content/inspector.js
r14 r76 72 72 // LilyDebugWindow.print("open the window...") 73 73 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);}); 75 76 } else { 76 77 LilyInspectorWindow.init(id); trunk/lily/lily/chrome/content/lily.js
r64 r76 1198 1198 }; 1199 1199 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){ 1201 1203 for(var x in val) { 1202 1204 switch(x) { … … 1239 1241 } 1240 1242 1243 var tmp = LilyUtils.getOpenDialogCoords(250,height); 1244 1241 1245 var initVals = { color: color, type: type }; 1242 1246 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) { 1244 1248 if(type=="patch") 1245 1249 Lily.setPatchColor(val); … … 1458 1462 opens the preferences dialog. 1459 1463 */ 1460 openPrefs: function() { 1464 openPrefs: function() { 1461 1465 Lily.getCurrentPatch().patchView.xulWin.openDialog("chrome://lily/content/prefs.xul", "lilyPrefsDialog", "chrome,titlebar,toolbar,centerscreen,modal",LilyAPIKeyManager,LilyDebugWindow); 1462 1466 }, trunk/lily/lily/chrome/content/patch.js
r75 r76 2302 2302 //standard patch 2303 2303 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); 2305 2306 //hidden patch 2306 2307 } else if(this.patch.hidden && !extWin) { … … 2311 2312 //this.xulWin=window.openDialog("chrome://lily/content/hiddenpatch.xul", pID,"",initReadOnlyWindow,pID); //hidden patch 2312 2313 } 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); 2314 2316 //patch in iframe 2315 2317 } else if(extWin && extWin.type=="iframe") { trunk/lily/lily/chrome/content/utils.js
r75 r76 1338 1338 1339 1339 /* 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 /* 1340 1381 Method: getObjectPos 1341 1382 get the position of an object.
