Changeset 7504 for dijit/trunk/tests/test_ProgressBar.html
- Timestamp:
- 03/01/07 12:02:26 (23 months ago)
- Files:
-
- 1 modified
-
dijit/trunk/tests/test_ProgressBar.html (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/tests/test_ProgressBar.html
r7501 r7504 14 14 dojo.require("dojo.io.*"); 15 15 dojo.require("dojo.io.IframeIO"); 16 dojo.require("dojo.string.extras"); 16 17 dojo.hostenv.writeIncludes(); 17 18 </script> … … 20 21 dojo.addOnLoad(go); 21 22 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")); 23 29 dojo.event.connect(dojo.byId("start"), "onclick", dojo.lang.hitch(theBar,theBar.startAnimation)); 24 30 dojo.event.connect(dojo.byId("stop"), "onclick", dojo.lang.hitch(theBar,theBar.stopAnimation)); … … 48 54 } 49 55 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}); 53 57 } 54 58 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}); 59 63 } 60 64 </script> … … 69 73 <input type="button" name="set" id="set" value="set!" /> 70 74 <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> 73 77 <br /> 74 78 <br /> … … 77 81 <br /> 78 82 <br /> 79 <div width="400" numeric="true" 80 maximum="256" id="testBar" duration="2000" dojoType="dijit.ProgressBar"></div> 83 <div id="testBar"></div> 81 84 <input type="button" name="start" id="start" value="start" /> 82 85 <input type="button" name="stop" id="stop" value="stop" /> … … 88 91 <br /> 89 92 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> 92 95 <br /> 93 96 <div style="position:absolute;top:70px;left:530px"> 94 97 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" 96 99 maximum="256" id="testBar2" dojoType="dijit.ProgressBar"></div> 97 100 </div> 98 101 <h3>Test 3</h3> 99 102 No explicit maximum (both 25%) 100 <div width="400" numeric="true"103 <div width="400" annotate="true" 101 104 id="implied1" progress="25" dojoType="dijit.ProgressBar"></div> 102 <div width="400" numeric="true" 105 <br /> 106 <div width="400" annotate="true" 103 107 id="implied2" progress="25%" dojoType="dijit.ProgressBar"></div> 104 108 </body>