Changeset 77
- Timestamp:
- 07/26/08 08:43:23 (4 months ago)
- Files:
-
- trunk/lily/lily/chrome/content/object.js (modified) (5 diffs)
- trunk/lily/lily/chrome/content/patch.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/object.js
r62 r77 62 62 this.loadsSubPatchByName = false; //true when a subpatch is invoked by name 63 63 this.hasBeenResized=false; //true when an extern has resized by hand. 64 this.isPaste=false; //true if we're creating this as a paste 64 65 65 66 this.ui=null; //to filled in when view instantiates … … 868 869 // log("deselect- no e "+thisPtr.id) 869 870 870 if(!thisPtr.isSelected || thisPtr.objDrag.dragging )871 if(!thisPtr.isSelected || thisPtr.objDrag.dragging || (e && e.type=="paste")) 871 872 return; 872 873 … … 1010 1011 //handler for edit state switch 1011 1012 this.toggleEditState=function() { 1012 thisPtr.deselect();1013 thisPtr.objView.toggleEditView(); 1013 if(!thisPtr.objView.parent.isPaste)thisPtr.deselect(); 1014 thisPtr.objView.toggleEditView(); 1014 1015 } 1015 1016 … … 1753 1754 1754 1755 if(!this.parent.subPatcherID) //no listeners for subpatch objects 1755 this.controller.addDefaultListeners(); //setTimeout(function(){thisPtr.controller.addDefaultListeners();},100);1756 this.controller.addDefaultListeners(); 1756 1757 1757 1758 this.contentWrapper=this.getElByID(this.parent.createElID("contentWrapper")); … … 1761 1762 this.parent.displayElement=this.contentContainer; 1762 1763 this.parent.resizeElement=this.contentWrapper; 1763 this.parent.animationElement=this.objViewNode; 1764 1765 if(!this.controller.noBorders) 1766 setTimeout(function(){if(thisPtr.name!="tmp"){thisPtr.controller.toggleEditState();}},100); 1767 else if(thisPtr.name!="tmp" && this.controller.noBorders) 1764 this.parent.animationElement=this.objViewNode; 1765 1766 //FIXME? hack to get the borders to draw correctly 1767 if(!this.controller.noBorders) { 1768 setTimeout(function(){ 1769 if(thisPtr.name!="tmp"){ 1770 thisPtr.controller.toggleEditState(); 1771 thisPtr.parent.isPaste=false; 1772 } 1773 },100); 1774 } else if(thisPtr.name!="tmp" && this.controller.noBorders) { 1768 1775 thisPtr.controller.toggleEditState(); 1776 thisPtr.parent.isPaste=false; 1777 } 1769 1778 1770 1779 setTimeout(function(){thisPtr.updateObjSize();},100); trunk/lily/lily/chrome/content/patch.js
r76 r77 643 643 LilyDebugWindow.error("error- patch not found."); 644 644 } 645 646 /* 647 Method: openHidden 648 open an existing patch as hidden. 649 650 Arguments: 651 path - path to patch (required) 652 653 Returns: 654 returns the newly created patch object. 655 */ 656 //open an existing patch window. 657 this.openHidden=function(path) { 658 659 var fPath=LilyUtils.getFilePath(path); 660 var file=(fPath)?LilyUtils.getFileHandle(fPath):null; 661 662 if(file) 663 return Lily.openPatchFromFile(file,true,true); 664 else 665 LilyDebugWindow.error("error- patch not found."); 666 } 667 668 /* 669 Method: openReadOnly 670 open an existing patch as readonly. 671 672 Arguments: 673 path - path to patch (required) 674 675 Returns: 676 returns the newly created patch object. 677 */ 678 //open an existing patch window. 679 this.openReadOnly=function(path) { 680 681 var fPath=LilyUtils.getFilePath(path); 682 var file=(fPath)?LilyUtils.getFileHandle(fPath):null; 683 684 if(file) 685 return Lily.openPatchFromFile(file,true,false); 686 else 687 LilyDebugWindow.error("error- patch not found."); 688 } 645 689 646 690 /* … … 795 839 //create the object 796 840 var o=this.createObject(oArray[x].name,subPatchID,oArray[x].top,oArray[x].left,this.updateObjID(oArray[x].objID,opID),oArray[x].args,oArray[x].hasBeenResized); 841 842 if(opID) { 843 o.isPaste=true; //set the flag so this doesn't get deselected. 844 } 797 845 798 846 //set some object properties … … 843 891 parent_patch.patchModel.addSubPatch(x,false,null); //add this subpatch to the list 844 892 } 893 894 if(opID) { 895 o.controller.select({type:"paste"}); //if we're pasting, select the object after we create it. 896 } 845 897 } 846 898 } … … 849 901 if(oArray[a].type=="connection") { 850 902 var c=this.createConnection(this.updateObjID(oArray[a].inlet,opID),this.updateObjID(oArray[a].outlet,opID),oArray[a].segmentArray,subPatchID); 851 if(c && typeof oArray[a].hiddenInPerf!="undefined") 903 904 if(c && typeof oArray[a].hiddenInPerf!="undefined"){ 852 905 c.controller.setHiddenInPerf(oArray[a].hiddenInPerf); 906 } 907 908 if(opID) { 909 c.controller.select({type:"paste"}); 910 } 911 853 912 } 854 913 } … … 1410 1469 this.deselectAll=function(e) { 1411 1470 1412 if((e && (LilyUtils.selectionModifyingKeyDown(e)||e.type=="selectAll"||e.type=="marqueeSelection"))) 1471 if( 1472 ( 1473 e && 1474 ( 1475 LilyUtils.selectionModifyingKeyDown(e)|| 1476 e.type=="selectAll"|| 1477 e.type=="marqueeSelection"|| 1478 e.type=="paste" 1479 ) 1480 ) 1481 ) 1413 1482 return; 1414 1483
