| 1 |
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" > |
| 2 |
<head> |
| 3 |
<title>Drawing GFX Toolbar Test</title> |
| 4 |
<link href="../resources/drawing.css" rel="stylesheet" /> |
| 5 |
<link href="../resources/toolbar.css" rel="stylesheet" /> |
| 6 |
|
| 7 |
<style> |
| 8 |
href, body{ |
| 9 |
overflow:hidden; |
| 10 |
} |
| 11 |
.drawing{ |
| 12 |
width:800px; |
| 13 |
height:400px; |
| 14 |
border:1px solid #ccc; |
| 15 |
cursor:crosshair; |
| 16 |
} |
| 17 |
#data{ |
| 18 |
display:block; |
| 19 |
height:100px; |
| 20 |
width:855px; |
| 21 |
margin-top:5px; |
| 22 |
} |
| 23 |
button{ |
| 24 |
border:2px solid #ccc; |
| 25 |
border-color:#D9E1F9 #B5BCD0 #878E9D #C6CEE4; |
| 26 |
background-color:#CDDCF3; |
| 27 |
cursor:pointer; |
| 28 |
} |
| 29 |
.gfxToolbar{ |
| 30 |
width:800px; |
| 31 |
height:50px; |
| 32 |
margin-bottom:10px; |
| 33 |
border:1px solid #ccc; |
| 34 |
} |
| 35 |
</style> |
| 36 |
|
| 37 |
<script> |
| 38 |
djConfig = { |
| 39 |
isDebug:false, |
| 40 |
parseOnLoad:true |
| 41 |
}; |
| 42 |
</script> |
| 43 |
<script src="../../../dojo/dojo.js"></script> |
| 44 |
<script> |
| 45 |
dojo.require("dojo.parser"); |
| 46 |
dojo.require("dojox.drawing"); |
| 47 |
|
| 48 |
|
| 49 |
// custom Tools and Plugins need to be required |
| 50 |
dojo.require("dojox.drawing.tools.TextBlock"); |
| 51 |
dojo.require("dojox.drawing.tools.Rect"); |
| 52 |
dojo.require("dojox.drawing.tools.Ellipse"); |
| 53 |
dojo.require("dojox.drawing.tools.Line"); |
| 54 |
dojo.require("dojox.drawing.tools.Path"); |
| 55 |
|
| 56 |
dojo.require("dojox.drawing.plugins.drawing.Grid"); |
| 57 |
|
| 58 |
dojo.require("dojox.drawing.ui.Toolbar"); |
| 59 |
dojo.require("dojox.drawing.ui.Button"); |
| 60 |
|
| 61 |
|
| 62 |
dojo.addOnLoad(function(){ |
| 63 |
dojo.connect(myDrawing, "onSurfaceReady", function(){ |
| 64 |
|
| 65 |
var image = myDrawing.addStencil("image", {data:{x:450, y:125, width:320, height:240, src:"../resources/CrazyTruck.jpg"}, shadow:{place:"BR", size:8, mult:6}}); |
| 66 |
|
| 67 |
myDrawing.addStencil("rect", {data:{x:50, y:25, width:100, height:50}, shadow:{color:"#0000ff", place:"TL"}}); |
| 68 |
myDrawing.addStencil("rect", {data:{x:50, y:100, width:100, height:50, r:10}, shadow:{place:"C", color:"#ff0000", size:8, mult:6}}); |
| 69 |
myDrawing.addStencil("rect", {data:{x:50, y:175, width:100, height:50, r:10}, shadow:{place:"BR"}}); |
| 70 |
|
| 71 |
myDrawing.addStencil("ellipse", {data:{cx:300, cy:60, rx:100, ry:50, fill:{r:200,g:200,b:0,a:1}}, shadow:{place:"TL"}}); |
| 72 |
myDrawing.addStencil("ellipse", {data:{cx:300, cy:175, rx:100, ry:50, fill:{r:200,g:200,b:0,a:1}}, shadow:{place:"C", size:6, mult:4, color:"#ffff00"}}); |
| 73 |
myDrawing.addStencil("ellipse", {data:{cx:300, cy:290, rx:100, ry:50, fill:{r:200,g:200,b:0,a:1}}, shadow:{place:"BR"}}); |
| 74 |
|
| 75 |
myDrawing.addStencil("line", {data:{x1:500, y1:70, x2:700, y2:10}, shadow:{place:"BR", size:4, mult:2}}); |
| 76 |
myDrawing.addStencil("line", {data:{x1:500, y1:100, x2:700, y2:100}, shadow:{place:"C", size:4, mult:4, color:"#00ff00"}}); |
| 77 |
|
| 78 |
myDrawing.addStencil("path", {points:[{x:10, y:390},{x:50, y:250},{x:175,y:330}, {x:100,y:300} ], shadow:{place:"C", size:4, mult:4, color:"#00ff00"}});// |
| 79 |
|
| 80 |
}); |
| 81 |
}) |
| 82 |
</script> |
| 83 |
|
| 84 |
</head> |
| 85 |
<body> |
| 86 |
<h2>Drawing Test</h2> |
| 87 |
<div id="conEdit" contenteditable="true"></div> |
| 88 |
<div id="wrapper"> |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
<div dojoType="dojox.drawing.Drawing" id="drawingNode" data-dojo-id="myDrawing" class="drawing" |
| 94 |
plugins="[{'name':'dojox.drawing.plugins.drawing.Grid', 'options':{minor:20, major:100}}]"> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
|
| 98 |
</body> |
| 99 |
</html> |