Changeset 117

Show
Ignore:
Timestamp:
09/04/08 12:31:33 (3 months ago)
Author:
bi..@lilyapp.org
Message:

first cut at adding support for custom borders on all externs. no doubt this will need to be tweaked over the coming days

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lily/lily/chrome/content/color.html

    r14 r117  
    4646                                document.getElementById("displayHex").addEventListener("change",function(){change(this.value)},false); 
    4747 
    48                                 if(windowType=="patch"||windowType=="font"
     48                                if(windowType=="patch"||windowType=="font"||windowType=="border"
    4949                                        document.getElementById("transparencyDiv").style.display="none"; 
    5050                                else 
  • trunk/lily/lily/chrome/content/externals/panel.js

    r1 r117  
    3535        var bgcolor=args.split(" ")[0]||this.color; 
    3636        var roundness=args.split(" ")[1]||0; 
    37         var bwidth=args.split(" ")[2]||0; 
    38         var bcolor=args.split(" ")[3]||"#000000"; 
    39         var bstyle=args.split(" ")[4]||"solid"; 
    4037                         
    4138        this.color=bgcolor; 
    4239        this.cornerRoundness=roundness; 
    43         this.borderWidth=bwidth; 
    44         this.borderColor=bcolor; 
    45         this.borderStyle=bstyle; 
    4640         
    4741        this.args=args;  
     
    4943         
    5044        this.setInspectorConfig([ 
    51                 {name:"cornerRoundness",value:thisPtr.cornerRoundness,label:"% Corner Roundness",type:"number",input:"text"}, 
    52                 {name:"borderWidth",value:thisPtr. borderWidth,label:"Border Width",type:"number",input:"text"}, 
    53                 {name:"borderColor",value:thisPtr. borderColor,label:"Border Color",type:"text",input:"text"},                           
    54                 {name:"borderStyle",value:thisPtr. borderStyle,label:"Border Style",type:"string",options:[ 
    55                         {label:"None",value:"none"}, 
    56                         {label:"Dashed",value:"dashed"}, 
    57                         {label:"Dotted",value:"dotted"}, 
    58                         {label:"Double",value:"double"}, 
    59                         {label:"Groove",value:"groove"}, 
    60                         {label:"Inset",value:"inset"}, 
    61                         {label:"Outset",value:"outset"}, 
    62                         {label:"Ridge",value:"ridge"}, 
    63                         {label:"Solid",value:"solid"} 
    64                 ],input:"select"} 
     45                {name:"cornerRoundness",value:thisPtr.cornerRoundness,label:"% Corner Roundness",type:"number",input:"text"} 
    6546        ]);      
    6647         
     
    7455                         
    7556                //update the arg str 
    76                 this.args=this.color+" "+vals["cornerRoundness"]+" "+vals["borderWidth"]+" "+vals["borderColor"]+" "+vals["borderStyle"]
     57                this.args=this.color+" "+vals["cornerRoundness"]
    7758 
    7859//              this.controller.objResizeControl.clearSize(); 
    7960                this.displayElement.style.MozBorderRadius=vals["cornerRoundness"]+"%"; 
    80                 this.displayElement.style.borderWidth=vals["borderWidth"]+"px"; 
    81                 this.displayElement.style.borderColor=vals["borderColor"]; 
    82                 this.displayElement.style.borderStyle=vals["borderStyle"]; 
    8361//              this.controller.objResizeControl.resetSize(); 
    8462                         
     
    8664 
    8765        //custom html 
    88         this.ui=new LilyObjectView(this,"<div style=\"-moz-border-radius:"+roundness+"%;border:"+bwidth+"px "+bcolor+" "+bstyle+";width:100px;height:100px;background:" + bgcolor + "\" id=\""+ this.createElID("panel") +"\"></div>"); 
     66        this.ui=new LilyObjectView(this,"<div style=\"-moz-border-radius:"+roundness+"%;border:0px #000000 solid;width:100px;height:100px;background:" + bgcolor + "\" id=\""+ this.createElID("panel") +"\"></div>"); 
    8967        this.ui.draw(); 
    9068         
  • trunk/lily/lily/chrome/content/externals/slider.js

    r83 r117  
    4343        var bgcolor=argsArr[0]||"#FF0000"; 
    4444        var roundness=argsArr[1]||0; 
    45         var bwidth=argsArr[2]||0; 
    46         var bcolor=argsArr[3]||"#000000"; 
    47         var bstyle=argsArr[4]||"solid"; 
    4845        this.orientation=(argsArr.length>=6&&typeof argsArr[5]!="undefined")?argsArr[5]:"horizontal"; //slider orientation       
    4946        this.rangeStart=(argsArr.length>=7&&typeof argsArr[6]!="undefined")?parseInt(argsArr[6]):1; //slider range 
     
    5249        this.handleColor=bgcolor; 
    5350        this.cornerRoundness=roundness; 
    54         this.borderWidth=bwidth; 
    55         this.borderColor=bcolor; 
    56         this.borderStyle=bstyle; 
    5751         
    5852        //default size 
     
    8175                {name:"handleColor",value:thisPtr.handleColor,label:"Handle Color",type:"text",input:"text"}, 
    8276                {name:"cornerRoundness",value:thisPtr.cornerRoundness,label:"% Corner Roundness",type:"number",input:"text"}, 
    83                 {name:"borderWidth",value:thisPtr. borderWidth,label:"Border Width",type:"number",input:"text"}, 
    84                 {name:"borderColor",value:thisPtr. borderColor,label:"Border Color",type:"text",input:"text"},                           
    85                 {name:"borderStyle",value:thisPtr. borderStyle,label:"Border Style",type:"string",options:[ 
    86                         {label:"None",value:"none"}, 
    87                         {label:"Dashed",value:"dashed"}, 
    88                         {label:"Dotted",value:"dotted"}, 
    89                         {label:"Double",value:"double"}, 
    90                         {label:"Groove",value:"groove"}, 
    91                         {label:"Inset",value:"inset"}, 
    92                         {label:"Outset",value:"outset"}, 
    93                         {label:"Ridge",value:"ridge"}, 
    94                         {label:"Solid",value:"solid"} 
    95                 ],input:"select"}, 
    9677                {name:"orientation",value:thisPtr.orientation,label:"Orientation",type:"string",options:[{label:"Vertical",value:"vertical"},{label:"Horizontal",value:"horizontal"}],input:"radio"}, 
    9778                {name:"rangeStart",value:thisPtr.rangeStart,label:"Range Start",type:"number",input:"text"}, 
     
    10889                         
    10990                //update the arg str 
    110                 this.args=vals["handleColor"]+" "+vals["cornerRoundness"]+" "+vals["borderWidth"]+" "+vals["borderColor"]+" "+vals["borderStyle"]+" "+vals["orientation"]+" "+vals["rangeStart"]+" "+vals["rangeEnd"]; 
     91                this.args=vals["handleColor"]+" "+vals["cornerRoundness"]+" "+vals["orientation"]+" "+vals["rangeStart"]+" "+vals["rangeEnd"]; 
    11192 
    11293                handle.style.background=vals["handleColor"]; 
    11394                handle.style.MozBorderRadius=vals["cornerRoundness"]+"%"; 
    114                 handle.style.borderWidth=vals["borderWidth"]+"px"; 
    115                 handle.style.borderColor=vals["borderColor"]; 
    116                 handle.style.borderStyle=vals["borderStyle"]; 
    11795                 
    11896                thisPtr.init(); 
     
    12199                 
    122100        //custom html 
    123         var slider_html = "<div style=\"width:"+default_width+"px;height:"+default_height+"px\" id=\""+ this.createElID("slider") +"\">"+ 
    124         "<div id=\""+ this.createElID("sliderHandle") +"\" style=\"-moz-border-radius:"+roundness+"%;border:"+bwidth+"px "+bcolor+" "+bstyle+";position:relative;height:"+handleHeight+";width:"+handleWidth+";background:"+bgcolor+"\"></div>" + 
     101        var slider_html = "<div style=\"border:0px #000000 solid;width:"+default_width+"px;height:"+default_height+"px\" id=\""+ this.createElID("slider") +"\">"+ 
     102        "<div id=\""+ this.createElID("sliderHandle") +"\" style=\"-moz-border-radius:"+roundness+"%;position:relative;height:"+handleHeight+";width:"+handleWidth+";background:"+bgcolor+"\"></div>" + 
    125103        "</div>"; 
    126104                 
  • trunk/lily/lily/chrome/content/lily.js

    r109 r117  
    12571257                        var color = this.patchObj[this.currPatch].obj.patchController.getSelectedObjectsProperty("fontColor"); 
    12581258                        height = 350; 
     1259                } else if(type=="border") { 
     1260                        var color = this.patchObj[this.currPatch].obj.patchController.getSelectedObjectsProperty("borderColor"); 
     1261                        height = 350; 
    12591262                } else { 
    12601263                        var color = this.patchObj[this.currPatch].obj.patchController.getSelectedObjectsProperty("color"); 
     
    12701273                        else if(type=="font") { 
    12711274                                Lily.setFont("fontColor",val,null); 
    1272                         } else { 
     1275                        } else if(type=="border") { 
     1276                                        Lily.setBorder("borderColor",val,null); 
     1277                        }else { 
    12731278                                Lily.setColor(val,null,true);    
    12741279                        }        
     
    14231428         
    14241429        /* 
     1430                Method: setBorder 
     1431                        dispatch menu command. 
     1432                         
     1433                Arguments:  
     1434                        name - border style,  
     1435                        value - border size,  
     1436                        pID - patch ID.                                                                                  
     1437        */ 
     1438        setBorder: function(name, value, pID) { 
     1439                var id=pID||this.currPatch;              
     1440                if(this.patchObj[id]) { 
     1441                        this.patchObj[id].obj.patchController.setSelectedBorder(name,value); //store the updated value in the current patch      
     1442                        this.patchObj[id].obj.patchController.setBorder(); //notify patch listeners that the font has changed. 
     1443                } 
     1444        },       
     1445         
     1446        /* 
    14251447                Method: setSharedValue 
    14261448                        set shared value. 
  • trunk/lily/lily/chrome/content/menus.js

    r20 r117  
    486486                } 
    487487                                 
    488         }, 
     488        },      
    489489         
    490490        deselectFontValue: function(menu) { 
     
    585585                menu.statusText="true"; 
    586586        }, 
     587         
     588        initBorderMenus:function(win) { 
     589                //preload the font menu 
     590                if(win && win.document.getElementById("menu_ObjectBorderPopup")&&win.document.getElementById("contextMenu_ObjectBorderPopup")) { 
     591                        this.setBorderList(win.document.getElementById("menu_ObjectBorderPopup")); 
     592                        this.setBorderList(win.document.getElementById("contextMenu_ObjectBorderPopup")); 
     593                }                
     594        }, 
     595 
     596        setBorderValue: function(menu) { 
     597                this.deselectBorderValue(menu); //clear the font menu 
     598 
     599                var menuArr=menu.childNodes; 
     600 
     601                var patch=Lily.getCurrentPatch().patchController; 
     602                var size=patch.getSelectedObjectsProperty("borderStyle"); 
     603                var style=patch.getSelectedObjectsProperty("borderWidth"); 
     604                 
     605                for(var i=0;i<menuArr.length;i++) { 
     606 
     607                        var label=menuArr[i].getAttribute("label");      
     608                        //FIXME XXXX *** hack until we normalize the patches.                    
     609                        if(size==label||style && (style.toString().toLowerCase()==label.toLowerCase())) { 
     610                                menuArr[i].setAttribute("checked",true);                         
     611                        } 
     612 
     613                } 
     614        },       
     615 
     616        deselectBorderValue: function(menu) {                    
     617                var menuArr=menu.childNodes; 
     618 
     619                for(var i=0;i<menuArr.length;i++) { 
     620                        menuArr[i].setAttribute("checked",false); 
     621                } 
     622        },       
     623         
     624        setBorderList: function(menu) { 
     625                                 
     626                if(menu.statusText=="true") { 
     627                        return;  
     628                } 
     629                 
     630                var styleArray = [ 
     631                        "none", 
     632                        "dashed", 
     633                        "dotted", 
     634                        "double", 
     635                        "groove", 
     636                        "inset", 
     637                        "outset", 
     638                        "ridge", 
     639                        "solid" 
     640                ]; 
     641                 
     642                var win = LilyUtils.getActiveXULWindow(); ///get the chrome window for the patch.                                
     643 
     644        // For each search term, create a menu item element 
     645        var tempItem = null; 
     646        tempItem = win.document.createElement("menuitem"); 
     647 
     648                //set attributes                         
     649        tempItem.setAttribute("label", "Color..."); 
     650        tempItem.setAttribute("name", "borderColor"); 
     651        tempItem.setAttribute("id", "bc"); 
     652        tempItem.setAttribute("type", "radio");  
     653                 
     654        tempItem.setAttribute("oncommand", "opener.Lily.openColorPicker('border')");     
     655 
     656        // Add the item to our menu 
     657        menu.appendChild(tempItem); 
     658                 
     659                menu.appendChild(win.document.createElement("menuseparator"));           
     660                 
     661            // Load the search terms into our menu 
     662            for(var i=0; i<15; i++) 
     663            { 
     664                // For each search term, create a menu item element 
     665                var tempItem = null; 
     666                tempItem = win.document.createElement("menuitem"); 
     667 
     668                        //set attributes                         
     669                tempItem.setAttribute("label", i); 
     670                tempItem.setAttribute("name", "borderWidth"); 
     671                tempItem.setAttribute("id", "bs"+i);     
     672                tempItem.setAttribute("type", "radio");  
     673                         
     674                tempItem.setAttribute("oncommand", "opener.Lily.setBorder(\"borderWidth\","+ i +")");    
     675 
     676                // Add the item to our menu 
     677                menu.appendChild(tempItem); 
     678            }            
     679                 
     680            // Load the search terms into our menu 
     681            for(var i=15; i<150; i+=5) 
     682            { 
     683                // For each search term, create a menu item element 
     684                var tempItem = null; 
     685                tempItem = win.document.createElement("menuitem"); 
     686 
     687                        //set attributes                         
     688                tempItem.setAttribute("label", i); 
     689                tempItem.setAttribute("name", "borderWidth"); 
     690                tempItem.setAttribute("id", "bs"+i);     
     691                tempItem.setAttribute("type", "radio");  
     692                         
     693                tempItem.setAttribute("oncommand", "opener.Lily.setBorder(\"borderWidth\","+ i +")");    
     694 
     695                // Add the item to our menu 
     696                menu.appendChild(tempItem); 
     697            }    
     698 
     699                menu.appendChild(win.document.createElement("menuseparator")); 
     700 
     701            // Load the search terms into our menu 
     702            for(var i=0; i<styleArray.length; i++) 
     703            { 
     704                // For each search term, create a menu item element 
     705                var tempItem = null; 
     706                tempItem = win.document.createElement("menuitem"); 
     707 
     708                        //set attributes                         
     709                tempItem.setAttribute("label", styleArray[i]); 
     710                tempItem.setAttribute("id", styleArray[i]);      
     711                tempItem.setAttribute("name", "borderStyle"); 
     712                tempItem.setAttribute("type", "radio"); 
     713                         
     714                tempItem.setAttribute("oncommand", "opener.Lily.setBorder(\"borderStyle\",\""+styleArray[i]+"\")");      
     715 
     716                // Add the item to our menu 
     717                menu.appendChild(tempItem); 
     718            }            
     719                menu.statusText="true"; 
     720        },       
    587721                                 
    588722        setObjectList: function(menu,help,context,opener) { 
  • trunk/lily/lily/chrome/content/object/base.js

    r94 r117  
    4343        this.fontFamily=this.parent.fontFamily; //font family 
    4444        this.fontColor="#000000"; //font color- maps to style property "color"   
     45        this.borderColor="#000000"; //color 
     46        this.borderStyle="solid"; 
     47        this.borderWidth=0; 
     48        this.customBorder=false; //if true then the border is saved.     
    4549        this.hiddenInPerf=false; 
    4650        this.opacity=1.0; //transparency 
     
    111115        } 
    112116         
    113         //set group name property 
     117        //set custom border property 
     118        this.setCustomBorder=function(val) { 
     119                if(val=="true") { 
     120                        this.customBorder=true; 
     121                } else { 
     122                        this.customBorder=false;         
     123                } 
     124        }        
     125         
     126        //set custom color property 
    114127        this.setCustomColor=function(val) { 
    115128                if(val=="true") { 
     
    123136        this.setPermColor=function(color) { 
    124137                this.setColor(color,true); 
    125         }                        
     138        } 
     139                 
     140        this.setBorderColor=function(bcolor,perm) { 
     141                 
     142                if(bcolor) { 
     143                        var ui=this.controller.objView.getInputWrapper(); 
     144 
     145                        if(ui) ui.style.borderColor=bcolor; 
     146                                 
     147                        if(this.displayElement) //update custom ui 
     148                                this.displayElement.style.borderColor=bcolor; 
     149                                         
     150                        this.borderColor=bcolor; 
     151                         
     152                        if(perm||false) 
     153                                this.customBorder=true; //               
     154                } 
     155        }  
     156         
     157        this.setBorderStyle=function(bstyle,perm) { 
     158                                 
     159                if(bstyle) { 
     160                        var ui=this.controller.objView.getInputWrapper(); 
     161                         
     162                        if(ui) ui.style.borderStyle=bstyle; 
     163                                 
     164                        if(this.displayElement) //update custom ui 
     165                                this.displayElement.style.borderStyle=bstyle; 
     166                                 
     167                        this.borderStyle=bstyle; 
     168 
     169                        this.objectMoved(); //notifiy listeners- make this object moved. 
     170                        this.controller.updatePos(); //update model 
     171        //              this.controller.objView.updateObjSize(); 
     172         
     173                        if(perm||false) 
     174                                this.customBorder=true; //                               
     175                } 
     176        } 
     177         
     178        this.setBorderSize=function(bsize,perm) { 
     179                 
     180                if(bsize) { 
     181                         
     182                        var ui=this.controller.objView.getInputWrapper(); 
     183                         
     184                        if(ui) ui.style.borderWidth=bsize+"px"; 
     185                                 
     186                        if(this.displayElement) //update custom ui 
     187                                this.displayElement.style.borderWidth=bsize+"px"; 
     188                                 
     189                        this.borderWidth=bsize; 
     190 
     191                        this.objectMoved(); //notifiy listeners- make this object moved. 
     192                        this.controller.updatePos(); //update model 
     193        //              this.controller.objView.updateObjSize(); 
     194         
     195                        if(perm||false) 
     196                                this.customBorder=true; //                               
     197                } 
     198        }                                
    126199         
    127200        //color 
  • trunk/lily/lily/chrome/content/object/controller.js

    r113 r117  
    110110                        this.patchController.startConnection(id,true); 
    111111                } 
    112 //              LilyDebugWindow.print("out connect " + id); 
     112//              log("out connect " + id); 
    113113                return false;            
    114114        } 
     115         
     116        this.updateBorder=function() { 
     117                var borderArr=thisPtr.patch.patchController.getBorder(); 
     118 
     119                thisPtr.objView.parent.setBorderStyle(borderArr[0],true); 
     120                thisPtr.objView.parent.setBorderSize(parseInt(borderArr[1]),true); 
     121                thisPtr.objView.parent.setBorderColor(borderArr[2],true);                                
     122 
     123                //log(borderArr.toSource()); 
     124        }        
    115125         
    116126        this.updateFont=function() { 
     
    121131                thisPtr.objView.parent.setFontColor(fontArr[2]);                                 
    122132                 
    123 //              LilyDebugWindow.print(fontArr.toSource()); 
     133//              log(fontArr.toSource()); 
    124134        } 
    125135         
     
    170180                                fontFace:thisPtr.objView.parent.fontFamily, 
    171181                                fontColor:thisPtr.objView.parent.fontColor, 
     182                                borderWidth:thisPtr.objView.parent.borderWidth, 
     183                                borderStyle:thisPtr.objView.parent.borderStyle, 
     184                                borderColor:thisPtr.objView.parent.borderColor,                          
    172185                                className:thisPtr.objView.parent.name, 
    173186                                hideInPerf:thisPtr.objView.parent.hiddenInPerf 
     
    187200                //font 
    188201                thisPtr.patchController.attachPatchObserver(thisPtr.id,"fontChanged",thisPtr.updateFont,"select"); 
    189  
    190                 //name 
    191 //              thisPtr.patchController.attachPatchObserver(thisPtr.id,"nameChanged",thisPtr.updateNames,"select"); 
     202                 
     203                //border 
     204                thisPtr.patchController.attachPatchObserver(thisPtr.id,"borderChanged",thisPtr.updateBorder,"select");           
    192205                 
    193206                //color 
     
    300313                thisPtr.patchController.removePatchObserver(thisPtr.id,"fontChanged",thisPtr.updateFont,"select"); 
    301314 
    302                 //name 
    303 //             thisPtr.patchController.removePatchObserver(thisPtr.id,"nameChanged",thisPtr.updateNames,"select"); 
     315                //border listener 
     316               thisPtr.patchController.removePatchObserver(thisPtr.id,"borderChanged",thisPtr.updateBorder,"select"); 
    304317                 
    305318                //color 
  • trunk/lily/lily/chrome/content/patch/base.js

    r108 r117  
    442442                        o.setFontFamily(o.fontFamily); 
    443443                        o.setFontSize(o.fontSize); 
    444                         o.setFontColor(o.fontColor);                     
     444                        o.setFontColor(o.fontColor);                                            
    445445                         
    446446                        //set to the default color 
     
    504504                if(replaceWithSame) { 
    505505                        //set some object properties 
     506                        //font 
    506507                        if(typeof oldObj.fontSize!="undefined") 
    507508                                o.setFontSize(oldObj.fontSize); 
     
    509510                                o.setFontFamily(oldObj.fontFamily); 
    510511                        if(typeof oldObj.fontColor!="undefined") 
    511                                 o.setFontColor(oldObj.fontColor);                                        
     512                                o.setFontColor(oldObj.fontColor); 
     513                        //border 
     514                        if(typeof oldObj.customBorder!="undefined") 
     515                                o.setCustomBorder(oldObj.customBorder); 
     516                        if(typeof oldObj.borderWidth!="undefined" && o.customBorder) 
     517                                o.setBorderSize(oldObj.borderWidth,true);                                                        
     518                        if(typeof oldObj.borderStyle!="undefined" && o.customBorder) 
     519                                o.setBorderStyle(oldObj.borderStyle,true); 
     520                        if(typeof oldObj.borderColor!="undefined" && o.customBorder) 
     521                                o.setBorderColor(oldObj.borderColor,true); 
     522                        //opacity,zindex,size,visibility                                                                                 
    512523                        if(typeof oldObj.opacity!="undefined") 
    513524                                o.setTransparency(oldObj.opacity); 
     
    520531                        if(typeof oldObj.height!="undefined") 
    521532                                o.setHeight(oldObj.height); 
     533                        //name,cssname,hideinperf        
    522534                        if(typeof oldObj.hiddenInPerf!="undefined") 
    523535                                o.controller.setHiddenInPerf(oldObj.hiddenInPerf); 
     
    526538                        if(typeof oldObj.cssName!="undefined" && oldObj.cssName) 
    527539                                o.setCSSName(oldObj.cssName); 
     540                        //color  
    528541                        if(typeof oldObj.customColor!="undefined") 
    529542                                o.setCustomColor(oldObj.customColor); 
     
    867880                                                o.setFontFamily(oArray[x].fontFamily); 
    868881                                        if(typeof oArray[x].fontColor!="undefined") 
    869                                                 o.setFontColor(oArray[x].fontColor);                                     
     882                                                o.setFontColor(oArray[x].fontColor); 
     883                                        if(typeof oArray[x].customBorder!="undefined") 
     884                                                o.setCustomBorder(oArray[x].customBorder);                                                                                               
     885                                        if(typeof oArray[x].borderWidth!="undefined" && o.customBorder) 
     886                                                o.setBorderSize(oArray[x].borderWidth,true); 
     887                                        if(typeof oArray[x].borderStyle!="undefined" && o.customBorder) 
     888                                                o.setBorderStyle(oArray[x].borderStyle,true); 
     889                                        if(typeof oArray[x].borderColor!="undefined" && o.customBorder) 
     890                                                o.setBorderColor(oArray[x].borderColor,true);                                                                                    
    870891                                        if(typeof oArray[x].opacity!="undefined") 
    871892                                                o.setTransparency(oArray[x].opacity); 
  • trunk/lily/lily/chrome/content/patch/controller.js

    r107 r117  
    8888                                        fontSize:this.patch.getObj(selObj[i]).fontSize, 
    8989                                        fontFace:this.patch.getObj(selObj[i]).fontFamily, 
    90                                         fontColor:this.patch.getObj(selObj[i]).fontColor,                                        
     90                                        fontColor:this.patch.getObj(selObj[i]).fontColor, 
     91                                        borderWidth:this.patch.getObj(selObj[i]).borderWidth, 
     92                                        borderStyle:this.patch.getObj(selObj[i]).borderStyle, 
     93                                        borderColor:this.patch.getObj(selObj[i]).borderColor,                                                                            
    9194                                        className:this.patch.getObj(selObj[i]).name, 
    9295                                        hideInPerf:this.patch.getObj(selObj[i]).hiddenInPerf 
     
    152155        } 
    153156         
     157////////////////////////////////////////////////////////////////// 
     158 
     159        //where we store updated border info destined for selected objects 
     160        this.selectedBorder={borderStyle:null,borderWidth:null,borderColor:null}; 
     161 
     162        //notify objects that are registered for the border changed event. 
     163        this.setBorder=function() { 
     164                this.notifyPatchListeners("borderChanged"); 
     165                this.refreshSelectedObjects(); 
     166                setTimeout(function(){thisPtr.revertBorderToDefault();},100); //clear the font after we've notified the listeners. 
     167        } 
     168 
     169        //return the new border info. 
     170        this.getBorder=function() { 
     171                return [this.selectedBorder["borderStyle"],this.selectedBorder["borderWidth"]+("px"),this.selectedBorder["borderColor"]]; 
     172        }        
     173 
     174        //store the new border info. 
     175        this.setSelectedBorder=function(name,value) { 
     176                this.selectedBorder[name]=value; 
     177        } 
     178 
     179        //clear new border 
     180        this.revertBorderToDefault=function() { 
     181                this.selectedBorder["borderStyle"]=null; 
     182                this.selectedBorder["borderWidth"]=null; 
     183                this.selectedBorder["borderColor"]=null;                 
     184        } 
     185 
    154186////////////////////////////////////////////////////////////////// 
    155187         
  • trunk/lily/lily/chrome/content/patch/model.js

    r95 r117  
    120120                        } 
    121121                         
    122                         if(this.objArray[x].getObjectType()=="object") { 
    123                          
     122                        if(this.objArray[x].getObjectType()=="object") {                         
    124123                                j+="'name':"+quote+this.objArray[x].name+quote+comma; 
    125124                                j+="'top':"+this.objArray[x].top+comma; 
     
    129128                                j+="'fontFamily':"+quote+this.objArray[x].fontFamily+quote+comma; 
    130129                                j+="'fontColor':"+quote+this.objArray[x].fontColor+quote+comma;                          
     130                                j+="'borderWidth':"+quote+this.objArray[x].borderWidth+quote+comma; 
     131                                j+="'borderStyle':"+quote+this.objArray[x].borderStyle+quote+comma; 
     132                                j+="'borderColor':"+quote+this.objArray[x].borderColor+quote+comma;                                                      
    131133                                j+="'opacity':"+this.objArray[x].opacity+comma; 
    132134                                j+="'zIndex':"+this.objArray[x].zIndex+comma; 
     
    137139                                j+="'groupName':"+quote+this.objArray[x].groupName+quote+comma; 
    138140                                j+="'cssName':"+quote+this.objArray[x].cssName+quote+comma; 
    139                                 j+="'customColor':"+quote+this.objArray[x].customColor+quote+comma;      
     141                                j+="'customColor':"+quote+this.objArray[x].customColor+quote+comma; 
     142                                j+="'customBorder':"+quote+this.objArray[x].customBorder+quote+comma;                                    
    140143                                j+="'hasBeenResized':"+quote+this.objArray[x].hasBeenResized+quote+comma;                                        
    141144                                                                                                                                                                                                                                                                                                                                                         
  • trunk/lily/lily/chrome/content/patch/view.js

    r108 r117  
    328328                thisPtr.oWin.addEventListener("contextmenu",LilyMenuBar.onContextMenu,false); //move this function. 
    329329                //preload the font menus 
    330                 setTimeout(function(){LilyMenuBar.initFontMenus(thisPtr.xulWin)},2000);          
     330                setTimeout(function(){LilyMenuBar.initFontMenus(thisPtr.xulWin)},2000);  
     331                 
     332                //preload the font menus 
     333                setTimeout(function(){LilyMenuBar.initBorderMenus(thisPtr.xulWin)},2000);                        
    331334                                 
    332335                //add patch listeners 
  • trunk/lily/lily/chrome/content/xul/patch.xul

    r90 r117  
    102102                                <menupopup statustext="false" id="menu_ObjectFontPopup" onpopupshowing="opener.LilyMenuBar.setFontValue(this);"/> 
    103103                                </menu> 
     104                                <menu id="menu_ObjectBorder" label="&lily.Border;"> 
     105                                <menupopup statustext="false" id="menu_ObjectBorderPopup" onpopupshowing="opener.LilyMenuBar.setBorderValue(this);"/> 
     106                                </menu>                          
    104107                                <menuitem id="menu_ObjectColor" label="&lily.Color;" oncommand="opener.Lily.openColorPicker('object')"/>                                                                                                                 
    105108                                <menuitem id="bringForwardItem" key="lilyBringForwardKey" label="&lily.BringForward;" oncommand="opener.Lily.bringForward()"/> 
     
    176179                <menupopup id="contextMenu_ObjectFontPopup" onpopupshowing="opener.LilyMenuBar.setFontValue(this);"/> 
    177180                </menu> 
     181                <menu style="display:none" id="contextMenu_ObjectBorder" label="&lily.Border;"> 
     182                <menupopup id="contextMenu_ObjectBorderPopup" onpopupshowing="opener.LilyMenuBar.setBorderValue(this);"/> 
     183                </menu>          
    178184                <menuitem style="display:none" id="contextBringForwardItem" label="&lily.BringForward;" oncommand="opener.Lily.bringForward()"/> 
    179185                <menuitem style="display:none" id="contextSendBackItem" label="&lily.SendBack;" oncommand="opener.Lily.sendBack()"/>