//**************************************************************** // icEdit.js (_ic305.txt) // // Copyright (c) 2006 Clifford L. Collins // All rights are Reserved // // Collins Software // 7710 Janak Drive, Houston Texas // //---------------------------------------------------------------- // No distribution/publication/use of this code is permitted //**************************************************************** var editMode; var editDC; var editUrl = ''; var editEmail = ''; var editMenu = false; //====================================================================== // editInit //====================================================================== function editInit() { try { window.cursor = 'default'; G.isMake = false; if (editDC) return; editDC = new ic$dc('line'); editDC.shapeStyle = 63; editDC.shapeLineWidth = 1; editDC.textFont = 'arial'; editDC.textSize = 10; editDC.textBold = false; editDC.textItalic = false; editDC.textUnderline = false; } catch (e) {}; } //====================================================================== // setEdit //====================================================================== function setEditTable(checked) { if (checked) {toolbarTable.style.display = ""; } else {toolbarTable.style.display = "none"; } } //====================================================================== // showToolbar //====================================================================== function showToolbar() { if (autoToolbar.checked) return "" return "none"; } //====================================================================== // setEdit //====================================================================== function setEditTool(name) { editMode = name.toLowerCase(); editInit(); G.isBuild = false; lineFillcolorSpan.style.display = "none"; toolbarLine.style.display = "none"; toolbarSymbol.style.display = "none"; toolbarText.style.display = "none"; toolbarSelect.style.display = "none"; toolbarOption.style.display = "none"; toolbarFile.style.display = "none"; toolbarShape.style.display = "none"; toolbarImage.style.display = "none"; //-------------------------- main tool bars -------------- if (editMode == 'select') { setModeSelect(); make.area('onSelect'); return; } if (editMode == 'options') { setModePan(); toolbarOption.style.display = ""; return; } if (editMode == 'file') { setModePan(); toolbarFile.style.display = ""; return; } //------------------------ Graphic Toolbar --------------- if (editMode == 'line') { G.isBuild = true; setModeEdit(); toolbarLine.style.display = showToolbar(); make.line('onNewLine'); return; } if (editMode == 'rectangle') { G.isBuild = true; setModeEdit(); lineFillcolorSpan.style.display = ""; toolbarLine.style.display = showToolbar(); make.rectangle('onNewRectangle'); return; } if (editMode == 'sketch') { G.isBuild = true; setModeEdit(); toolbarLine.style.display = showToolbar(); make.sketch('onNewSketch'); return; } if (editMode == 'arc') { G.isBuild = true; setModeEdit(); toolbarLine.style.display = showToolbar(); make.arc('onNewArc'); return; } if (editMode == 'circle') { G.isBuild = true; setModeEdit(); lineFillcolorSpan.style.display = showToolbar(); toolbarLine.style.display = showToolbar(); make.circle('onNewCircle'); return; } if (editMode == 'pline') { G.isBuild = true; setModeEdit(); toolbarLine.style.display = showToolbar(); make.pline('onNewPline'); return; } if (editMode == 'image') { G.isBuild = true; setModeEdit(); toolbarImage.style.display = showToolbar(); make.image('onNewImage'); return; } if (editMode == 'polygon') { G.isBuild = true; setModeEdit(); lineFillcolorSpan.style.display = showToolbar(); toolbarLine.style.display = showToolbar(); make.polygon('onNewPolygon'); return; } if (editMode == 'symbol') { G.isBuild = true; setModeEdit(); toolbarSymbol.style.display = showToolbar(); make.symbol('onNewSymbol'); return; } if (editMode == 'text') { G.isBuild = true; setModeEdit(); toolbarText.style.display = showToolbar(); make.text('onNewText'); return; } if (editMode == 'textbox') { G.isBuild = true; setModeEdit(); toolbarText.style.display = showToolbar(); make.textbox('onNewTextbox'); return; } if (editMode == 'shape') { G.isBuild = true; setModeEdit(); toolbarShape.style.display = showToolbar(); make.shape('onNewShape'); return; } } //====================================================================== // setToolbarByName //====================================================================== function setToolbarByName(name) { try { lineFillcolorSpan.style.display = "none"; toolbarLine.style.display = "none"; toolbarSymbol.style.display = "none"; toolbarText.style.display = "none"; toolbarShape.style.display = "none"; toolbarSelect.style.display = "none"; toolbarOption.style.display = "none"; toolbarFile.style.display = "none"; } catch (e) { return } //-------------------------- main tool bars -------------- if (name == 'select') { return; } if (name == 'options') { toolbarOption.style.display = ""; return; } if (name == 'file') { toolbarFile.style.display = ""; return; } //------------------------ Graphic Toolbar --------------- if (name == 'line') { toolbarLine.style.display = showToolbar(); return; } if (name == 'rectangle') { toolbarLine.style.display = showToolbar(); return; } if (name == 'sketch') { toolbarLine.style.display = showToolbar(); return; } if (name == 'arc') { toolbarLine.style.display = showToolbar(); return; } if (name == 'circle') { lineFillcolorSpan.style.display = showToolbar(); toolbarLine.style.display = showToolbar(); return; } if (name == 'pline') { toolbarLine.style.display = showToolbar(); return; } if (name == 'image') { toolbarImage.style.display = showToolbar(); return; } if (name == 'polygon') { lineFillcolorSpan.style.display = showToolbar(); toolbarLine.style.display = showToolbar(); return; } if (name == 'symbol') { toolbarSymbol.style.display = showToolbar(); return; } if (name == 'text') { toolbarText.style.display = showToolbar(); return; } if (name == 'textbox') { toolbarText.style.display = showToolbar(); return; } if (name == 'shape') { toolbarShape.style.display = showToolbar(); return; } } //====================================================================== // setEdit //====================================================================== function setEdit(checked) { try { toolLine.checked = true; toolbarLine.style.display = "none"; toolbarSymbol.style.display = "none"; toolbarText.style.display = "none"; toolbarShape.style.display = "none"; toolbarImage.style.display = "none"; toolbarSelect.style.display = "none"; toolbarOption.style.display = "none"; toolbarFile.style.display = "none"; toolbarTable.style.display = "none"; } catch (e) {}; try { if (checked) { disableMainEvents(); G.startEdit(); setEditTool('line'); toolbarEdit.style.display = ""; if (toolTable.checked) toolbarTable.style.display = ""; } else { enableMainEvents(); toolbarEdit.style.display = "none"; G.L.clear(); G.E.clear(); } } catch (e) {}; } //========================================================================= // onSelect //========================================================================= function onSelect(m,x1,y1,x2,y2) { var dx,dy; G.select(x1,y1,x2,y2); if (! singleSelect) m.area('onSelect'); singleSelect = false; } //========================================================================= // onNewLine //========================================================================= function onNewLine(m,x1,y1,x2,y2) { var gra; gra = new ic$Line(x1,y1,x2,y2); G.addGraphic('notes',gra,true); m.line('onNewLine'); } //========================================================================= // onNewCircle //========================================================================= function onNewCircle(m,x1,y1,x2,y2) { var cx,cy,radius var gra; cx = x1; cy = y1; radius = length$(x1,y1,x2,y2); if (radius > 0.0001) { gra = new ic$Circle(cx,cy,radius); G.addGraphic('notes',gra,true); } m.circle('onNewCircle'); } //========================================================================= // onNewRectangle //========================================================================= function onNewRectangle(m,x1,y1,x2,y2) { var gra; gra = new ic$Rectangle(x1,y1,x2,y2); G.addGraphic('notes',gra,true); m.rectangle('onNewRectangle'); } //========================================================================= // onNewPolygon //========================================================================= function onNewPolygon(m,np,xlist,ylist) { var gra; if (np > 2) { gra = new ic$Polygon(np,xlist,ylist); G.addGraphic('notes',gra,true); } m.polygon('onNewPolygon'); } //========================================================================= // onNewPline //========================================================================= function onNewPline(m,np,xlist,ylist) { var gra; if (np > 1) { gra = new ic$Pline(np,xlist,ylist); G.addGraphic('notes',gra,true); } m.pline('onNewPline'); } //========================================================================= // onNewImage //========================================================================= function onNewImage(m,x1,y1,x2,y2) { var gra; gra = new ic$Image(x1,y1,x2,y2); G.addGraphic('notes',gra,true); m.image('onNewImage'); } //========================================================================= // onNewArc //========================================================================= function onNewArc(m,cx,cy,radius,start,sweep) { var gra; if ((radius > 0.0001) && (sweep > 0.001)) { gra = new ic$Arc(cx,cy,radius,start,sweep); G.addGraphic('notes',gra,true); } m.arc('onNewArc'); } //========================================================================= // onNewSketch //========================================================================= function onNewSketch(m,np,xlist,ylist) { var gra; if (np > 2) { gra = new ic$Sketch(np,xlist,ylist); G.addGraphic('notes',gra,true); } m.sketch('onNewSketch'); } //========================================================================= // onNewSymbol //========================================================================= function onNewSymbol(m,x,y,angle) { var gra; gra = new ic$Symbol(x,y,angle); G.addGraphic('notes',gra,true); m.symbol('onNewSymbol'); } //========================================================================= // onNewText //========================================================================= function onNewText(m,x,y,angle) { var gra; gra = new ic$Text(x,y,angle); G.addGraphic('notes',gra,true); m.text('onNewText'); } //========================================================================= // onNewTextbox //========================================================================= function onNewTextbox(m,xmin,ymin,xmax,ymax,height,width) { var gra; if (! ((height < 10) && (width < 10))) { gra = new ic$Textbox(xmin,ymin,xmax,ymax,height,width); G.addGraphic('notes',gra,true); } m.textbox('onNewTextbox'); } //========================================================================= // onNewShape //========================================================================= function onNewShape(m,xmin,ymin,xmax,ymax,height,width) { var gra; if (! ((height < 10) && (width < 10))) { gra = new ic$Shape(xmin,ymin,xmax,ymax,height,width); G.addGraphic('notes',gra,true); } m.shape('onNewShape'); } //========================================================================= // editStyle //========================================================================= function editStyle(type) { var text; if (! editDC) editInit(); editDC.setType(type); editGetDC(editDC,type); text = editDC.style(); return text; } //================================================================ // strToColor //================================================================ function strToColor(text) { var name,temp; n = parseInt(text); if (text.length = 0) return 0; if (text.substr(0,1) == '#') { temp = '0x' + text.substr(1); n = parseInt(temp); } if (n) return n; name = text.toLowerCase(); if (name == 'black') return parseInt('0x000000'); if (name == 'nave') return parseInt('0x800000'); if (name == 'blue') return parseInt('0xFF000'); if (name == 'green') return parseInt('0x008000'); if (name == 'teal') return parseInt('0x808000'); if (name == 'lime') return parseInt('0x00FF00'); if (name == 'aqua') return parseInt('0xFFFF00'); if (name == 'maroon') return parseInt('0x000080'); if (name == 'purple') return parseInt('0x800080'); if (name == 'olive') return parseInt('0x008080'); if (name == 'gray') return parseInt('0x808080'); if (name == 'silver') return parseInt('0xC0C0C0'); if (name == 'red') return parseInt('0x0000FF'); if (name == 'fuchia') return parseInt('0xFF00FF'); if (name == 'yellow') return parseInt('9x00FFFF'); if (name == 'white') return parseInt('0xFFFFFF'); return 0; } //================================================================ // edtGetDC //================================================================ function editGetDC(dc,type) { try { if (! editDC) editInit(); if ((type == 'line') || (type == 'arc') || (type == 'circle') || (type == 'rectangle') || (type == 'sketch') || (type == 'pline') || (type == 'polygon')) { dc.lineColor = "black"; dc.lineFillcolor = ""; dc.lineFill = true; dc.lineWidth = 1; dc.lineDashStyle = ''; dc.lineStyle = 'solid'; dc.lineJoin = 0; dc.lineTransparent = false; dc.lineFillTransparent = 0; dc.lineGradient = false; dc.lineShadow = false; dc.z = 0; dc.lineColor = getColor(lineColor); dc.lineFillcolor = getColor(lineFillcolor); dc.lineFill = lineFill.checked; dc.lineWidth = lineWidth.value; dc.lineDashStyle = lineDashStyle.value; dc.lineStyle = lineStyle.value; dc.lineJoin = lineJoin.value; dc.lineTransparent = lineTransparent.value; dc.lineFillTransparent = lineFillTransparent.value; dc.lineGradient = lineGradient.checked; dc.lineShadow = lineShadow.checked; dc.z = parseInt(lineZ.value); dc.fixed = lineFixed.checked return; } if (type == 'symbol') { dc.symbolColor = "black"; dc.symbolFillcolor = "red"; dc.symbolFill = true; dc.symbolName = "icSymbolbox"; dc.symbolSize = 8; dc.symbolFillTransparent = 80; dc.z = 0; dc.fixed = true; dc.symbolLine = 1; //----------------- dc.symbolColor = getColor(symbolColor); dc.symbolFillcolor = getColor(symbolFillcolor); dc.symbolFill = symbolFill.checked; dc.symbolName = symbolName.value; dc.symbolSize = parseInt(symbolSize.value); dc.symbolFillTransparent = parseInt(symbolFillTransparent.value); dc.z = parseInt(symbolZ.value); dc.fixed = symbolFixed.checked return; } if ((type == 'text') || (type == 'textbox')) { dc.textColor = "Black"; dc.textBgcolor = ""; dc.textFill = false; dc.textFont = "arial"; dc.textSize = 10; dc.textBold = false; dc.textItalic = false; dc.textUnderline = false; dc.textText = "none"; dc.textLineWidth = 0; dc.fixed = true; dc.z = 0; //---------------------------- dc.textColor = getColor(textColor); dc.textBgcolor = getColor(textBgcolor); dc.textFill = textFill.checked; dc.textFont = editDC.textFont; dc.textSize = editDC.textSize; dc.textBold = editDC.textBold; dc.textItalic = editDC.textItalic; dc.textUnderline = editDC.textUnderline; dc.textText = textText.value; dc.textLineWidth = textLineWidth.value; dc.fixed = textFixed.checked; dc.z = parseInt(textZ.value); return; } //------------------------------- if (type == 'shape') { dc.shapeStyle = 62; // Callout Shape dc.textColor = "Black"; dc.textBgcolor = ""; dc.textFill = false; dc.textFont = "arial"; dc.textSize = 10; dc.textBold = false; dc.textItalic = false; dc.textUnderline = false; dc.textText = ""; dc.textLineWidth = 0; dc.shapeLineWidth = 0; dc.fixed = true; dc.z = 0; //---------------------------- dc.textColor = getColor(shapeColor); dc.textBgcolor = getColor(shapeBgcolor); dc.textFill = shapeFill.checked; dc.textFont = editDC.textFont; dc.textSize = editDC.textSize; dc.textBold = editDC.textBold; dc.textItalic = editDC.textItalic; dc.textUnderline = editDC.textUnderline; dc.textText = shapeText.value; dc.textLineWidth = textLineWidth.value; dc.fixed = shapeFixed.checked; dc.z = parseInt(shapeZ.value); dc.shapeStyle = parseInt(shapeStyle.value); dc.shapeLineWidth = shapeLineWidth.value; return; } if (type == 'image') { dc.imageName = imageName.value; dc.z = imageZ.value; dc.fixed = imageFixed.checked; if (dc.imageName == '') dc.imageName = 'images/pen.bmp'; } } catch (e) {}; } //================================================================ // DCNames //================================================================ function DCNames(type) { var text; text = 'gid:I4,id:A255,tag:A2048,link:a2048'; if ((type == 'line') || (type == 'arc') || (type == 'circle') || (type == 'rectangle') || (type == 'sketch') || (type == 'pline') || (type == 'polygon')) { text = text + ',Color:A32,' + 'Fillcolor:A32,' + 'Fill:A5,' + 'LineWidth:I4,' + 'Z:I4,' + 'DashStyle:A32,' + 'Style:A32,' + 'Join:A32,' + 'Transparent:A32,' + 'FillTransparent:A32,' + 'Gradient:I4,' + 'Shadow:A5'; return text; } if (type == 'symbol') { text = text + ',Color:A32,' + 'Name:A32,' + 'Size:I4,' + 'Z:I4,' + 'Fill:A5,' + 'Fillcolor:A32,' + 'FillTransparent:A32'; return text; } if ((type == 'text') || (type == 'textbox')) { text = text + ',Font:a64,' + 'Color:A32,' + 'Size:I4,' + 'Z:I4,' + 'Text:A2048,' + 'Bold:A5,' + 'Italic:A5,' + 'Underline:A5,' + 'Fill:A5,' + 'Bgcolor:A64,' + 'LineWidth:I4'; return text; } if ((type == 'shape')) { text = text + ',Style:I4,' + 'Font:a64,' + 'Color:A32,' + 'Size:I4,' + 'Z:I4,' + 'Text:A2048,' + 'Bold:A5,' + 'Italic:A5,' + 'Underline:A5,' + 'Fill:A5,' + 'Bgcolor:A64,' + 'LineWidth:I4'; return text; } if (type == 'image') { text = text + ',ImageName:A255,z:I4,fixed:I4'; return text; } return text; } //================================================================ // DCValues //================================================================ function DCValues(gra) { var text; text = Q(gra.gid) + ',' + Q(gra.id) + ',' + Q(gra.tag) + ',' + Q(gra.link); if ((gra.type == 'line') || (gra.type == 'arc') || (gra.type == 'circle') || (gra.type == 'rectangle') || (gra.type == 'sketch') || (gra.type == 'pline') || (gra.type == 'polygon')) { text = text + ',' + Q(gra.dc.lineColor) + ',' + Q(gra.dc.lineFillcolor) + ',' + Q(gra.dc.lineFill) + ',' + Q(gra.dc.lineWidth) + ',' + Q(gra.dc.z) + ',' + Q(gra.dc.lineDashStyle) + ',' + Q(gra.dc.lineStyle) + ',' + Q(gra.dc.lineJoin) + ',' + Q(gra.dc.lineTransparent) + ',' + Q(gra.dc.lineFillTransparent) + ',' + Q(gra.dc.lineGradient) + ',' + Q(gra.dc.lineShadow); return text; } if (gra.type == 'symbol') { text = text + ',' + Q(gra.dc.symbolColor) + ',' + Q(gra.dc.symbolName) + ',' + Q(gra.dc.symbolSize) + ',' + Q(gra.dc.z) + ',' + Q(gra.dc.symbolFill) + ',' + Q(gra.dc.symbolFillcolor) + ',' + Q(gra.dc.symbolFillTransparent); return text; } if ((gra.type == 'text') || (gra.type == 'textbox')) { text = text + ',' + Q(gra.dc.textFont) + ',' + Q(gra.dc.textColor) + ',' + Q(gra.dc.textSize) + ',' + Q(gra.dc.z) + ',' + Q(gra.dc.textText) + ',' + Q(gra.dc.textBold) + ',' + Q(gra.dc.textItalic) + ',' + Q(gra.dc.textUnderline) + ',' + Q(gra.dc.textFill) + ',' + Q(gra.dc.textBgcolor) + ',' + Q(gra.dc.textLineWidth); return text; } if ((gra.type == 'shape')) { text = text + ',' + Q(gra.dc.shapeStyle) + ',' + Q(gra.dc.textFont) + ',' + Q(gra.dc.textColor) + ',' + Q(gra.dc.textSize) + ',' + Q(gra.dc.z) + ',' + Q(gra.dc.textText) + ',' + Q(gra.dc.textBold) + ',' + Q(gra.dc.textItalic) + ',' + Q(gra.dc.textUnderline) + ',' + Q(gra.dc.textFill) + ',' + Q(gra.dc.textBgcolor) + ',' + Q(gra.dc.textLineWidth); return text; } if ((gra.type == 'image')) { text = text + ',' + Q(gra.dc.imageName) + Q(gra.dc.z) + ',' + Q(gra.dc.fixed); return text; } return text; } //================================================================ // hexColor //================================================================ function hex2(value) { var n1,n2,v; var a,b; var h = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); v = value; n1 = v & 0xF0; n1 = n1 / 16; n2 = v & 0x0F; a = h[n1]; b = h[n2]; return a + b; } //================================================================ // hexColor //================================================================ function hexColor(color) { var c,R,G,B; c = Math.floor(color); R = c % 256; c = Math.floor(c / 256); G = c % 256; c = Math.floor(c / 256); B = c % 256; text = '#' + hex2(R) + hex2(G) + hex2(B); return text; } //================================================================ // swapColor //================================================================ function swapColor_old(color) { var c,R,G,B; c = Math.floor(color); R = c % 256; c = Math.floor(c / 256); G = c % 256; c = Math.floor(c / 256); B = c % 256; //------- BGR --> RGB --------- c = R; c = c * 256 + G; c = c * 256 + B; return c; } //================================================================ // getColor //================================================================ function getColor(obj) { return obj.style.backgroundColor; } //================================================================ // setColor //================================================================ function setColor(obj,color) { obj.style.backgroundColor = color; } //================================================================ // getColor //================================================================ function dlg_getColor(obj) { var c; c = getColor(obj); c = strToColor(c); return c; } //================================================================ // setColor //================================================================ function dlg_setColor(obj,color) { var c; setColor(obj,hexColor(color)); } //================================================================ // edtPutDC //================================================================ function editPutDC(dc,type) { //try { if (! editDC) editInit(); if (! editMenu) return; if ((type == 'line') || (type == 'arc') || (type == 'circle') || (type == 'pline') || (type == 'rectangle') || (type == 'sketch') || (type == 'polygon')) { setColor(lineColor,dc.lineColor); setColor(lineFillcolor,dc.lineFillcolor); lineFill.value = dc.lineFill; lineWidth.value = dc.lineWidth; lineDashStyle.value = dc.lineDashStyle; lineStyle.value = dc.lineStyle; lineJoin.value = dc.lineJoin; lineTransparent.value = dc.lineTransparent; lineFillTransparent.value = dc.lineFillTransparent; lineGradient.checked = dc.lineGradient; lineShadow.checked = dc.lineShadow; lineZ.value = dc.z; lineFixed.checked = dc.fixed; return; } if (type == 'symbol') { setColor(symbolColor,dc.symbolColor); setColor(symbolFillcolor,dc.symbolFillcolor); symbolFill.checked = dc.symbolFill; symbolName.value = dc.symbolName; symbolSize.value = dc.symbolSize; symbolZ.value = dc.z; symbolFixed.checked = dc.fixed; return; } if ((type == 'text') || (type == 'textbox')) { setColor(textBgcolor,dc.textBgcolor); setColor(textColor,dc.textColor); textText.value = dc.textText; textLineWidth.value = dc.textLineWidth; textZ.value = dc.z; textFixed.checked = dc.fixed; textFill.checked = dc.textFill; editDC.textFont = dc.textFont; editDC.textSize = dc.textSize; editDC.textBold = dc.textBold; editDC.textItalic = dc.textItalic; editDC.textUnderline = dc.textUnderline; return; } if (type == 'shape') { shapeStyle.value = dc.shapeStyle; setColor(shapeBgcolor,dc.textBgcolor); setColor(shapeColor,dc.textColor); shapeText.value = dc.textText; shapeLineWidth.value = dc.LineWidth; shapeZ.value = dc.z; shapeFixed.checked = dc.fixed; shapeFill.checked = dc.textFill; editDC.textFont = dc.textFont; editDC.textSize = dc.textSize; editDC.textBold = dc.textBold; editDC.textItalic = dc.textItalic; editDC.textUnderline = dc.textUnderline; return; } if (type == 'image') { imageName.value = dc.imageName; imageZ.value = dc.z; imageFixed.checked = dc.fixed; return; } } //catch (e) { alert('error');} } //=================================================== // doFile //=================================================== function doFile() { if ((editFileOp == 'save') || (editFileOp == 'saveas')) { if (! fileOverWrite$(fileName.value)) return; } if (editFileOp == 'save') G.saveToFile(fileName.value); if (editFileOp == 'open') G.loadFromFile(fileName.value); } //=================================================== // doFileSaveAs //=================================================== function doFileSaveAs() { if (! fileOverWrite$(fileName.value)) return; alert('Save As: ' + fileName.value); } //=================================================== // doFileOpen //=================================================== function doFileOpen() { alert('Open: ' + fileName.value); } //=================================================== // File Open / Save / SaveAs //=================================================== function fileOpen() { var filename; if (! DialogOpen()) return; G.loadFromFile(dialog.FileName); } function fileSave() { var filename; dialog.FileName = G.dbname; if (G.dbname == '') if (! DialogSave()) return; G.saveToFile(dialog.FileName); } function fileSaveAs() { if (! DialogSave()) return; G.saveToFile(dialog.FileName); } //========================================================================= // DialogFont //========================================================================= void function DialogFont(font) { var fScreen = 1; // screen Fonts var fPrinter = 2; // printer Fonts var fBoth = 3; // both fonts dialog.Flags = fScreen; dialog.FontName = editDC.textFont; dialog.FontBold = editDC.textBold; dialog.FontItalic = editDC.textItalic; dialog.FontSize = editDC.textSize; dialog.FontUnderLine = editDC.textUnderline; dialog.CancelError = 1; try { dialog.ShowFont(); } catch (e) { return }; editDC.textFont = dialog.FontName; editDC.textBold = dialog.FontBold; editDC.textItalic = dialog.FontItalic; editDC.textUnderline = dialog.FontUnderline; editDC.textSize = dialog.FontSize; G.autoRefresh(); } //========================================================================= // DialogColor //========================================================================= void function DialogColor(obj) { dialog.Color = dlg_getColor(obj); dialog.CancelError = 1; try { dialog.ShowColor(); } catch (e) { return null }; dlg_setColor(obj,dialog.Color); G.autoRefresh(); } //========================================================================= // DialogSave //========================================================================= function DialogSave() { dialog.Filter="Common Ground Files (*.cg2)|*.cg2"; dialog.DialogTitle = 'Collins Software, Save ICMap Graphic Database'; dialog.DefaultExt = 'cg2'; dialog.CancelError = 1; try { dialog.ShowSave(); } catch (e) { return null }; return dialog.FileName; } //========================================================================= // DialogOpen //========================================================================= function DialogOpen() { dialog.Filter="Common Ground Files (*.cg2)|*.cg2"; dialog.DefaultExt = 'cg2'; dialog.DialogTitle = 'Collins Software, Open ICMap Graphic File (*.cg2)'; dialog.CancelError = 1; try { dialog.ShowOpen(); } catch (e) { return null }; return dialog.FileName; } //========================================================================= // fileUpload //========================================================================= function fileUpload() { var url; var text; url = editUrl; url = prompt("URL of server script (asp,php,cgi,...) to accept graphics as a form\r\n" + "Form name = icSendForm, Field name = icSendData",url); if (!url) return; editUrl = url; text = G.data(); icSendForm.icSendData.innerText = text; icSendForm.action = editUrl; icSendForm.submit(); } //========================================================================= // fileEmail //========================================================================= function fileEmail() { var text; email = editEmail; email = prompt("EMail address to send graphics as a text message\r\n" + "ctrl-a / ctrl-c to copy from email, ctrl-v to paste to map" ,email); if (!email) return; text = G.data(); editEmail = email; icSendForm.icSendData.innerText = text; icSendForm.action = "mail" + "to:" + editEmail + "?subject=ICMap Graphic Database"; icSendForm.submit(); } //========================================================================= // fileDownload //========================================================================= function fileDownload() { var url; var text; url = editUrl; url = prompt("URL of graphic file (*.cg2) to copy into the map",url); if (!url) return; editUrl = url; text = urlToStr(editUrl); G.data(text); }