Show
Ignore:
Timestamp:
03/01/07 12:02:26 (23 months ago)
Author:
peller
Message:

ProgressBar?: more "craptastic" functions, more tweaks

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/tests/test_ProgressBar.html

    r7501 r7504  
    1414                        dojo.require("dojo.io.*"); 
    1515                        dojo.require("dojo.io.IframeIO"); 
     16                        dojo.require("dojo.string.extras"); 
    1617                        dojo.hostenv.writeIncludes(); 
    1718                </script> 
     
    2021                        dojo.addOnLoad(go); 
    2122                        function go(){ 
    22                                 var theBar = dijit.byId("testBar"); 
     23                                //TODO: it's a little strange that id must be specified again?   
     24                                var theBar = new dijit.ProgressBar({id: "testBar", width: 400, annotate: true, maximum: 256, duration: 2000, 
     25                                        report:function(percent){ 
     26                                                return dojo.string.substitute("${0} out of ${1} max chars", [this.progress, this.maximum]); 
     27                                        } 
     28                                }, dojo.byId("testBar")); 
    2329                                dojo.event.connect(dojo.byId("start"), "onclick", dojo.lang.hitch(theBar,theBar.startAnimation)); 
    2430                                dojo.event.connect(dojo.byId("stop"), "onclick", dojo.lang.hitch(theBar,theBar.stopAnimation)); 
     
    4854                        } 
    4955                        function setParameters(){ 
    50                                 dijit.byId("setTestBar").setMaximum(dojo.byId("maximum").value, true); 
    51                                 dijit.byId("setTestBar").setProgress(dojo.byId("progressValue").value, true); 
    52                                 dijit.byId("setTestBar").render(); 
     56                                dijit.byId("setTestBar").update({maximum: dojo.byId("maximum").value, progress: dojo.byId("progressValue").value}); 
    5357                        } 
    5458                        function keyUpHandler(){ 
    55                                 dijit.byId("testBar").setProgress(dojo.byId("test").value.length); 
    56                                 dijit.byId("testBarInt").setProgress(dojo.byId("test").value.length); 
    57                                 dijit.byId("testBar2").setProgress(dojo.byId("test").value.length); 
    58                                 dijit.byId("smallTestBar").setProgress(dojo.byId("test").value.length); 
     59                                dijit.byId("testBar").update({progress:dojo.byId("test").value.length}); 
     60                                dijit.byId("testBarInt").update({progress:dojo.byId("test").value.length}); 
     61                                dijit.byId("testBar2").update({progress:dojo.byId("test").value.length}); 
     62                                dijit.byId("smallTestBar").update({progress:dojo.byId("test").value.length}); 
    5963                        } 
    6064                </script> 
     
    6973                <input type="button" name="set" id="set" value="set!" /> 
    7074                <br /> 
    71                 <div width="400" numeric="true" 
    72                         maximum="200" id="setTestBar" progress="20" dojoType="dijit.ProgressBar"></div>          
     75                <div width="400" annotate="true" 
     76                        maximum="200" id="setTestBar" progress="20" dojoType="dijit.ProgressBar"></div> 
    7377                <br /> 
    7478                <br /> 
     
    7781                <br /> 
    7882                <br /> 
    79                 <div width="400" numeric="true"   
    80                         maximum="256" id="testBar" duration="2000" dojoType="dijit.ProgressBar"></div>           
     83                <div id="testBar"></div>                 
    8184                <input type="button" name="start" id="start" value="start" /> 
    8285                <input type="button" name="stop" id="stop" value="stop" /> 
     
    8891                <br /> 
    8992                Show decimal place: 
    90                 <div places="1" width="400" numeric="true" orientation="horizontal"  
    91                         maximum="256" id="testBarInt" dojoType="dijit.ProgressBar"></div>                
     93                <div places="1" width="400" annotate="true" orientation="horizontal" 
     94                        maximum="256" id="testBarInt" dojoType="dijit.ProgressBar"></div> 
    9295                <br /> 
    9396                <div style="position:absolute;top:70px;left:530px"> 
    9497                Vertical: 
    95                 <div progress="0" height="420" width="50" numeric="true" orientation="vertical"  
     98                <div progress="0" height="420" width="50" annotate="true" orientation="vertical"  
    9699                                maximum="256" id="testBar2" dojoType="dijit.ProgressBar"></div> 
    97100                </div> 
    98101                <h3>Test 3</h3> 
    99102                No explicit maximum (both 25%) 
    100                 <div width="400" numeric="true" 
     103                <div width="400" annotate="true" 
    101104                        id="implied1" progress="25" dojoType="dijit.ProgressBar"></div>          
    102                 <div width="400" numeric="true" 
     105                <br /> 
     106                <div width="400" annotate="true" 
    103107                        id="implied2" progress="25%" dojoType="dijit.ProgressBar"></div> 
    104108        </body>