2150 |
mathias |
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 |
<!--
|
|
|
10 |
The next line should include Microsoft's Silverligth.js, if you plan to use the silverlight backend
|
|
|
11 |
<script type="text/javascript" src="Silverlight.js"></script>
|
|
|
12 |
-->
|
|
|
13 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
|
|
|
14 |
<script type="text/javascript" src="../_base.js"></script>
|
|
|
15 |
<script type="text/javascript" src="../shape.js"></script>
|
|
|
16 |
<script type="text/javascript" src="../path.js"></script>
|
|
|
17 |
<script type="text/javascript" src="../arc.js"></script>
|
|
|
18 |
<!--<script type="text/javascript" src="../vml.js"></script>-->
|
|
|
19 |
<!--<script type="text/javascript" src="../svg.js"></script>-->
|
|
|
20 |
<!--<script type="text/javascript" src="../canvas.js"></script>-->
|
|
|
21 |
<!--<script type="text/javascript" src="../silverlight.js"></script>-->
|
|
|
22 |
<script type="text/javascript">
|
|
|
23 |
dojo.require("dojox.gfx");
|
|
|
24 |
|
|
|
25 |
var surface;
|
|
|
26 |
|
|
|
27 |
makeShapes = function(){
|
|
|
28 |
surface = dojox.gfx.createSurface("test", 500, 500);
|
|
|
29 |
surface.createRect({width: 300, height: 300}).setFill([255, 0, 0, 0.3]).setStroke("red");
|
|
|
30 |
surface.createRect({x: 200, y: 200, width: 300, height: 300}).setFill([0, 0, 255, 0.3]).setStroke("green");
|
|
|
31 |
};
|
|
|
32 |
|
|
|
33 |
getDim = function(){
|
|
|
34 |
var t = surface.getDimensions();
|
|
|
35 |
alert("dimensions: " + t.width + " by " + t.height);
|
|
|
36 |
};
|
|
|
37 |
|
|
|
38 |
make500x500 = function(){ surface.setDimensions(500, 500); };
|
|
|
39 |
make400x400 = function(){ surface.setDimensions(400, 400); };
|
|
|
40 |
make300x300 = function(){ surface.setDimensions(300, 300); };
|
|
|
41 |
|
|
|
42 |
dojo.addOnLoad(makeShapes);
|
|
|
43 |
|
|
|
44 |
</script>
|
|
|
45 |
</head>
|
|
|
46 |
<body>
|
|
|
47 |
<h1>Testing surface resizing</h1>
|
|
|
48 |
<!--<p><button onclick="makeShapes();">Go</button></p>-->
|
|
|
49 |
<p>
|
|
|
50 |
<button onclick="getDim();">getDimensions</button>
|
|
|
51 |
|
|
|
52 |
<button onclick="make300x300();">Make 300x300</button>
|
|
|
53 |
|
|
|
54 |
<button onclick="make400x400();">Make 400x400</button>
|
|
|
55 |
|
|
|
56 |
<button onclick="make500x500();">Make 500x500</button>
|
|
|
57 |
</p>
|
|
|
58 |
<div id="test" style="width: 500px; height: 500px;"></div>
|
|
|
59 |
<p>That's all Folks!</p>
|
|
|
60 |
</body>
|
|
|
61 |
</html>
|