My favorites |
Project Home Wiki Issues
Search
for
wzjsgraphicsjs  
Updated Sep 24, 2010 by jrobin...@kitchenpages.com

wz_jsgraphics.js

This is optional

The optional modified file can be seen at: http://www.kitchenpages.com/library/i3/jsdhtml32/

wz_jsgraphics.js is maintained at http://www.devira.com, and http://www.walterzorn.de/ ?? Testing in 2010; Shows 404 errors :-( ??

wz_jsgraphics.js (v. 2.36) needs the following code to be added for KitCAD i3:

/*-#-#-#-#-#-# Modified code below for KitCADi3 Canvas.render() function */
var wz_jsgraphicsjs = true;
try{if(!Canvas){var Canvas = new Object();}}catch(error){}
Canvas.render = function ()
{
var mxc = "<scr" + "ipt> xcanvas = new jsGraphics(" + Canvas.dgcan + "document.getElementById('cAKGraphicControl" + ID + "'));" +
" var x1, x2, y1, y2; " +
" xcanvas.height = " + Height + "; " +
" xcanvas.width = " + Width + "; ";
var mca = " ";`
var mxx = " <\/scr" + "ipt>";`
Canvas.Ktype = "render";`
Canvas.Header_def = "";`
Canvas.Groups_def = mxc; `
Canvas.Draws_def = mca;`
OBColor = -1;`
Canvas.Drawe_def = " ";`
Canvas.Path_def = "); y1=Math.floor(";`
Canvas.LineTo_def = " x1=Math.floor(";`
Canvas.LineTo_def_ = "); xcanvas.drawLine(x2,y2,x1,y1); xcanvas.paint(); x2=x1; y2=y1;";
Canvas.MoveTo_def = " xcanvas.setColor(\""+ Canvas.Pen.GetColor() +"\"); x1=Math.floor(";
Canvas.MoveTo_def_ = "); x2=x1; y2=y1;";
Canvas.ArcTo_def = " x1=Math.floor(";
Canvas.ArcTo_def_ = "); xcanvas.drawArc(x2,y2,x1,y1); xcanvas.paint(); x2=x1; y2=y1;";
Canvas.Groupe_def = mxx;
Canvas.Footer_def = "";
}
/*-#-#-#-#-#-# Original code below */

----

A 2008 edition was found in downloads of 'VCL for PHP' (pre DelphiPHP) but failed to function after testing with KitCAD i3 javascript online. Running an extra function of outputHTML.replace(/canvas/g,'div') will fix the bug. The filename of the 2008 (v. 3.03) edition is 2008_wz_jsgraphics.js and will need to be renamed to wz_jsgraphics.js if required.

2008_wz_jsgraphics.js (v. 3.03) needs the following code to be added for KitCAD i3:

/*-#-#-#-#-#-# Modified code below for KitCADi3 Canvas.render() function */
var wz_jsgraphicsjs = true;
try{if(!Canvas){var Canvas = new Object();}}catch(error){}
Canvas.render = function ()
{
var fix303 = "<scr" + "ipt> document.getElementById('cAKGraphicControl" + ID + "').outerHTML = document.getElementById('cAKGraphicControl" + ID + "').outerHTML.replace(/canvas/g,'div'); <\/scr" + "ipt>";
var mxc = "<scr" + "ipt> xcanvas = new jsGraphics(" + Canvas.dgcan + "document.getElementById('cAKGraphicControl" + ID + "'));" +
" var x1, x2, y1, y2; " +
" xcanvas.height = " + Height + "; " +
" xcanvas.width = " + Width + "; ";
var mca = " ";`
var mxx = " <\/scr" + "ipt>" + fix303;
Canvas.Ktype = "render";`
Canvas.Header_def = "";`
Canvas.Groups_def = mxc; `
Canvas.Draws_def = mca;`
OBColor = -1;`
Canvas.Drawe_def = " ";`
Canvas.Path_def = "); y1=Math.floor(";`
Canvas.LineTo_def = " x1=Math.floor(";`
Canvas.LineTo_def_ = "); xcanvas.drawLine(x2,y2,x1,y1); xcanvas.paint(); x2=x1; y2=y1;";
Canvas.MoveTo_def = " xcanvas.setColor(\""+ Canvas.Pen.GetColor() +"\"); x1=Math.floor(";
Canvas.MoveTo_def_ = "); x2=x1; y2=y1;";
Canvas.ArcTo_def = " x1=Math.floor(";
Canvas.ArcTo_def_ = "); xcanvas.drawArc(x2,y2,x1,y1); xcanvas.paint(); x2=x1; y2=y1;";
Canvas.Groupe_def = mxx;
Canvas.Footer_def = "";
}
/*-#-#-#-#-#-# Original code below */