Debian Codegraph @

dojox/gfx/tests/svgweb/test_resize.html

raw symbols SCIP
1 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
2 <head>
3 <title>Testing surface resizing</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <style type="text/css">
6 @import "../../../../dojo/resources/dojo.css";
7 @import "../../../../dijit/tests/css/dijitTests.css";
8 </style>
9 <!-- SVGWEB { -->
10 <meta name="svg.render.forceflash" content="true"/>
11 <script src="svgweb/src/svg.js" data-path="svgweb/src"></script>
12 <script src="../../../../dojo/dojo.js" data-dojo-config="isDebug:true,forceGfxRenderer:'svg'" type="text/javascript"></script>
13 <!-- } -->
14 <script type="text/javascript">
15 dojo.require("dojox.gfx");
16
17 var surface;
18
19 makeShapes = function(){
20 surface = dojox.gfx.createSurface("test", 500, 500);
21 /* SVGWEB { */
22 surface.whenLoaded(function() {
23 surface.createRect({width: 300, height: 300}).setFill([255, 0, 0, 0.3]).setStroke("red");
24 surface.createRect({x: 200, y: 200, width: 300, height: 300}).setFill([0, 0, 255, 0.3]).setStroke("green");
25 });
26 /* } */
27 };
28
29 getDim = function(){
30 var t = surface.getDimensions();
31 alert("dimensions: " + t.width + " by " + t.height);
32 };
33
34 make500x500 = function(){ surface.setDimensions(500, 500); };
35 make400x400 = function(){ surface.setDimensions(400, 400); };
36 make300x300 = function(){ surface.setDimensions(300, 300); };
37
38 dojo.addOnLoad(makeShapes);
39
40 </script>
41 </head>
42 <body>
43 <h1>Testing surface resizing</h1>
44 <!--<p><button onclick="makeShapes();">Go</button></p>-->
45 <p>
46 <button onclick="getDim();">getDimensions</button>
47 &nbsp;
48 <button onclick="make300x300();">Make 300x300</button>
49 &nbsp;
50 <button onclick="make400x400();">Make 400x400</button>
51 &nbsp;
52 <button onclick="make500x500();">Make 500x500</button>
53 </p>
54 <div id="test" style="width: 500px; height: 500px;"></div>
55 <p>That's all Folks!</p>
56 </body>
57 </html>