Changeset 61

Show
Ignore:
Timestamp:
07/20/08 00:44:08 (5 months ago)
Author:
bi..@lilyapp.org
Message:

fix resizing/drag behavior - bug #65
fix bug where number was not outputing a string not a number (ironically)

Files:

Legend:

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

    r33 r61  
    7373                updateValue(parseFloat(val)); 
    7474                draw(); 
    75                 thisPtr.outlet1.doOutlet(outValue);            
     75                thisPtr.outlet1.doOutlet(+outValue);           
    7676        } 
    7777         
     
    8383         
    8484        this.inlet1["bang"]=function() { 
    85                 thisPtr.outlet1.doOutlet(outValue);            
     85                thisPtr.outlet1.doOutlet(+outValue);           
    8686        } 
    8787         
     
    101101                y=parseFloat(e.clientY);                 
    102102                draw(); 
    103                 thisPtr.outlet1.doOutlet(value.toFixed(thisPtr.precVal)); 
     103                thisPtr.outlet1.doOutlet(+value.toFixed(thisPtr.precVal)); 
    104104        }        
    105105                 
  • trunk/lily/lily/chrome/content/object.js

    r60 r61  
    824824                thisPtr.patchController.attachPatchObserver(thisPtr.id,"visibleInPerf",function(){thisPtr.setHiddenInPerf(false);},"select"); 
    825825                 
    826                 if(e.shiftKey && LilyUtils.controlOrCommand(e)) { 
    827                         //resize 
    828                         thisPtr.patchController.attachPatchObserver(thisPtr.obj.createElID("contentWrapper"),"mousedown",thisPtr.objResizeControl.mousedown,"select"); 
    829                         thisPtr.patchController.attachPatchObserver(thisPtr.obj.createElID("contentWrapper"),"mouseup",thisPtr.objResizeControl.mouseup,"select");                       
    830          
    831                 } else { 
    832                         //drag 
    833                         thisPtr.patchController.attachPatchObserver(thisPtr.id,"mousedown",thisPtr.objDrag.mousedown,"select"); 
    834                         thisPtr.patchController.attachPatchObserver(thisPtr.id,"mouseup",thisPtr.objDrag.mouseup,"select"); 
    835                 } 
     826                //drag & resize 
     827                thisPtr.patchController.attachPatchObserver(thisPtr.id,"mousedown",thisPtr.selectDelegate,"select"); 
     828                thisPtr.patchController.attachPatchObserver(thisPtr.id,"mouseup",thisPtr.selectDelegate,"select"); 
    836829                         
    837830                //set flag 
     
    843836                thisPtr.obj.objectMoved();  
    844837                //this.editing=false; 
     838        } 
     839         
     840        //funnel events to drag & resize 
     841        this.selectDelegate=function(e) { 
     842                if(e.shiftKey && LilyUtils.controlOrCommand(e)) { 
     843                         
     844                        if(e.type=="mousedown") { 
     845                                thisPtr.objResizeControl.mousedown(e); 
     846                        } else if(e.type=="mouseup") { 
     847                                thisPtr.objResizeControl.mouseup(e);     
     848                        }                        
     849                                 
     850                } else { 
     851                         
     852                        if(e.type=="mousedown") { 
     853                                thisPtr.objDrag.mousedown(e); 
     854                        } else if(e.type=="mouseup") { 
     855                                thisPtr.objDrag.mouseup(e);      
     856                        } 
     857                }                
    845858        } 
    846859         
     
    891904                thisPtr.patchController.removePatchObserver(thisPtr.id,"hiddenInPerf",function(){thisPtr.setHiddenInPerf(true);},"select"); 
    892905                thisPtr.patchController.removePatchObserver(thisPtr.id,"visibleInPerf",function(){thisPtr.setHiddenInPerf(false);},"select"); 
    893                  
    894                 //drag 
    895                 thisPtr.patchController.removePatchObserver(thisPtr.id,"mousedown",thisPtr.objDrag.mousedown,"select");          
    896                 thisPtr.patchController.removePatchObserver(thisPtr.id,"mouseup",thisPtr.objDrag.mouseup,"select");      
    897                  
    898                 //a little extra security 
    899                 if(0) thisPtr.patchController.removePatchObserver(thisPtr.id,"mousemove",thisPtr.objDrag.mousemove,"select"); 
    900                  
    901                 //resize 
    902                 thisPtr.patchController.removePatchObserver(thisPtr.obj.createElID("contentWrapper"),"mousedown",thisPtr.objResizeControl.mousedown,"select"); 
    903                 thisPtr.patchController.removePatchObserver(thisPtr.obj.createElID("contentWrapper"),"mouseup",thisPtr.objResizeControl.mouseup,"select");                               
     906 
     907                //drag & resize 
     908                thisPtr.patchController.removePatchObserver(thisPtr.id,"mousedown",thisPtr.selectDelegate,"select"); 
     909                thisPtr.patchController.removePatchObserver(thisPtr.id,"mouseup",thisPtr.selectDelegate,"select");                       
    904910                         
    905911                //deselect view                  
  • trunk/lily/lily/chrome/content/patch.js

    r60 r61  
    15901590                for(var i=0;i<arr.length;i++) { 
    15911591                                //LilyDebugWindow.print("try to remove patch listener " + id + " " + evt); 
    1592                         if(arr[i].evt==evt) { 
     1592                        if(arr[i].evt==evt && arr[i].func.toSource()==func.toSource()) { 
    15931593//                              LilyDebugWindow.print("remove patch listener " + id + " " + evt);                        
    15941594                                this.document.removeEventListener(arr[i].evt,arr[i].func,false);                         
  • trunk/lily/lily/chrome/content/utils.js

    r57 r61  
    307307                var shift=e.shiftKey; 
    308308                 
    309                 if(accel || shift
     309                if((accel||shift) && !(accel&&shift)
    310310                        return true; 
    311311                else