Changeset 60

Show
Ignore:
Timestamp:
07/16/08 22:42:59 (2 months ago)
Author:
bi..@lilyapp.org
Message:

fix bug in subpatch code where an instance would lose its size when reopened in a patch

Files:

Legend:

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

    r59 r60  
    246246                                                                                                                                                                                                         
    247247                        //size the subpatch to the size set in patch we're loading... 
    248                         if(parseInt(thisPatch.obj.heightInSubPatch) != 0 && parseInt(thisPatch.obj.widthInSubPatch) != 0)  
     248                        if(parseInt(thisPatch.obj.heightInSubPatch) != 0 && parseInt(thisPatch.obj.widthInSubPatch) != 0 && !thisPtr.hasBeenResized)  
    249249                                iframe.resize(parseInt(thisPatch.obj.widthInSubPatch), parseInt(thisPatch.obj.heightInSubPatch)); 
    250250 
  • trunk/lily/lily/chrome/content/model.js

    r57 r60  
    136136                                j+="'groupName':"+quote+this.objArray[x].groupName+quote+comma; 
    137137                                j+="'cssName':"+quote+this.objArray[x].cssName+quote+comma; 
    138                                 j+="'customColor':"+quote+this.objArray[x].customColor+quote+comma;                                                                                                                                                                                                                                                                                                                              
    139                                  
     138                                j+="'customColor':"+quote+this.objArray[x].customColor+quote+comma;      
     139                                j+="'hasBeenResized':"+quote+this.objArray[x].hasBeenResized+quote+comma;                                        
     140                                                                                                                                                                                                                                                                                                                                                         
    140141                                if(this.objArray[x].args) 
    141142                                        j+="'args':"+quote+LilyUtils.escape(this.objArray[x].args)+quote+comma; //copy in additional creation args 
  • trunk/lily/lily/chrome/content/object.js

    r52 r60  
    6161        this.displayArgs=true; //should we see objects arguments (for non-UI objects only) 
    6262        this.loadsSubPatchByName = false; //true when a subpatch is invoked by name 
     63        this.hasBeenResized=false; //true when an extern has resized by hand. 
    6364         
    6465        this.ui=null; //to filled in when view instantiates 
     
    11871188                        thisPtr.patchController.attachPatchObserver(thisPtr.patchController.pID,"mousemove",resize,"select"); 
    11881189                        thisPtr.objController.patchView.setWindowStatusText("width:"+(thisPtr.width)+"px height:"+(thisPtr.height)+"px"); 
    1189                         thisPtr.resizeFlag=true;                         
     1190                        thisPtr.resizeFlag=true; 
     1191                        parent.obj.hasBeenResized=true;                  
    11901192                } 
    11911193                 
  • trunk/lily/lily/chrome/content/patch.js

    r57 r60  
    362362        */                       
    363363        //create object- args: className, top, left, objID, variable_length_arguments_to_obj //only the first arg is required. 
    364         this.createObject=function(name,pID,t,l,id,args) { 
     364        this.createObject=function(name,pID,t,l,id,args,resizeFlag) { 
    365365                 
    366366                if(this.getObj(id)) 
     
    380380                var obj=(this.getModule(name))?this.getModule(name):this.getModule("tmp"); 
    381381                var count=this.patchModel.getObjectCount()+1; //get the patch object count 
     382                var resize_flag = resizeFlag||false; //has been resized 
    382383                                                 
    383384                if(obj && typeof obj == "function") { 
     
    388389                        if(o.displayName==undefined) 
    389390                                o.displayName=LilyUtils.getObjectMetaData(className).textName; 
     391                                 
     392                        o.hasBeenResized = resize_flag; //need to set this here before we draw the UI 
    390393                                                 
    391394                        if(!o.ui) { //if no custom html defined 
     
    764767                                 
    765768                                        //create the object 
    766                                         var o=this.createObject(oArray[x].name,subPatchID,oArray[x].top,oArray[x].left,this.updateObjID(oArray[x].objID,opID),oArray[x].args); 
     769                                        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); 
    767770 
    768771                                        //set some object properties 
     
    792795                                                o.setCustomColor(oArray[x].customColor); 
    793796                                        if(typeof oArray[x].color!="undefined"&&o.customColor) 
    794                                                 o.setColor(oArray[x].color);                                                                                                                                                                                            
    795                                          
     797                                                o.setColor(oArray[x].color); 
     798                                                                                        
    796799                                        //set name/values from the inspector array 
    797800                                        if(typeof oArray[x].inspectorConfig!="undefined") {