/* BAE_ZOOM (STD) -- BAE Zoom Action */ /* BAE_ZOOM (STD) -- BAE Zoom-Aktion */ /* -- EXECUTED AFTER CHANGEING THE CURRENT ZOOM WINDOW -- */ /* // Copyright (c) 1997-2013 Bartels System GmbH, Muenchen // Author: Roman Ludwig // Changes History: // rl (131029) RELEASED FOR BAE V8.0. // rl (120427) RELEASED FOR BAE V7.8. // rl (101019) RELEASED FOR BAE V7.6. // rl (091027) RELEASED FOR BAE V7.4. // rl (081118) ENHANCEMENT: // Added grid display support. // rl (081014) RELEASED FOR BAE V7.2. // rl (071029) RELEASED FOR BAE V7.0. // rl (070129) ENHANCEMENT: // Added dialog box management support. // rl (061027) ENHANCEMENT: // Added power layer color button support. // rl (060829) RELEASED FOR BAE V6.8. // rl (050906) RELEASED FOR BAE V6.6. // rl (040811) RELEASED FOR BAE V6.4. // rl (040301) ENHANCEMENT: // Added documentary layer color button support. // rl (030904) RELEASED FOR BAE V6.2. // rl (030514) ENHANCEMENT: // Added layer color button support. // rl (030512) ENHANCEMENT: // Added inverted color palette correction. // rl (030326) BIGFIX: // Fixed problem with wrong display offset of portrait elements. // rl (021209) RELEASED FOR BAE V6.0. // rl (020125) ENHANCEMENT: // Added user specific program call support. // rl (020618) RELEASED FOR BAE V5.4. // rl (010702) RELEASED FOR BAE V5.0. // rl (010412) ENHANCEMENT: // Added board outline display in bird's eye view. // rl (000508) RELEASED FOR BAE V4.6. // rl (990625) RELEASED FOR BAE V4.4. // rl (990511) ENHANCEMENT: // Added call of module specific zoom action programs. // rl (980910) RELEASED FOR BAE V4.2. // rl (980910) ENHANCEMENT: // Changed to V4.2 general access program. // rl (971105) IMPROVEMENT: // Added draw switch variable. // rl (970929) RELEASED FOR BAE V4.0. // rl (970606) ORIGINAL CODING. // // DESCRIPTION // // The bae_zoom User Language program is automatically // activated when changing the current zoom window. // bae_zoom checks for pending toolbar zoom update requests // and updates the display overview window of the design // view management facility accordingly. */ // Includes #include "pop.ulh" // User Language popup utilities #include "popdraw.ulh" // User Language popup draw. util. #include "sql.ulh" // User Language SQL utilities #include "scm.ulh" // User Language SCM utilities #include "lay.ulh" // User Language layout utilities // Enforce standard caller type #pragma ULCALLERSTD // Disable undo state request #pragma ULCALLERNOUNDO // Messages string UPRGRID01 = M("1/10\"","1/10\""); string UPRGRID02 = M("1/20\"","1/20\""); string UPRGRID03 = M("1/40\"","1/40\""); string UPRGRID04 = M("1/60\"","1/60\""); string UPRGRID05 = M("1/80\"","1/80\""); string UPRGRID06 = M("1/100\"","1/100\""); string UPRGRID07 = M("1/120\"","1/120\""); string UPRGRID08 = M("1/160\"","1/160\""); string UPRGRID09 = M("1/200\"","1/200\""); string UPRGRID10 = M("1/240\"","1/240\""); string UPRGRID11 = M("1/480\"","1/480\""); string UPRGRID12 = M("1 mil","1 mil"); string UPRGRID13 = M("1/10 mil","1/10 mil"); // INI file parameter name definitions #define PAR_USERZPROG "USERZPROG_STD" // User defined zoom program name #define PAR_VARTCOLOR "VARTEXTCOL_STD"// Variant text color // Global definitions #define AREASHRINK 0.9 // Area shrink factor #define SMALLVAL 0.00000001 // Small compare value // SQL command definitions #define V_SELECTN "select name from varinfo where variant=%d;" string sqlcommand /* SQL command string */; string curvarname /* Current variant name */; // Globals static double dalx,daly /* Draw area lower corner */; static double daux,dauy /* Draw area upper corner */; static double xoff,yoff /* Offsets */; static double xscale /* X scale factor */; static int callertype = uliptype() /* Calling environment type */; static string userzprog = bae_inistrval(PAR_USERZPROG,"") /* User definied zoom prog. name */; static int vartcolor = bae_iniintval(PAR_VARTCOLOR,COLOR_LBLUE) /* Variant name display color */; // Main program void main() { index L_POLY poly /* Polygon index */; index L_POINT point /* Polygon point index */; double zwlx,zwly /* Zoom window lower corner */; double zwux,zwuy /* Zoom window upper corner */; double dvlx,dvly /* Design view lower corner */; double dvux,dvuy /* Design view upper corner */; int dvdraw = 0 /* Design view draw flag */; double wslx,wsly /* Workspace lower corner */; double wsux,wsuy /* Workspace upper corner */; double wsnx,wsny /* Workspace origin */; double ailx,aily /* Area of interest lower corner */; double aiux,aiuy /* Area of interest upper corner */; double xtsize,ytsize /* Enlarged total area size */; double xdsize,ydsize /* Drawing area size */; double yscale /* Scaling factors */; double tsize /* Text size */; double tx, ty /* Text position */; double gridx,gridy /* Grid dimensions */; double wscx,wscy /* Workspace middle point */; double wsxdim,wsydim /* Workspace dimensions */; int wmirror /* Window mirror mode */; string name /* Name buffer */; int histmax /* History max. count */; int histpos /* History position count */; int histidx /* History buffer index */; int histbase /* History base position */; int outlcol /* Board outline color */; int drawflag /* Zoom window draw flag */; int expertmode /* Expert mode */; int varnumber = 0 /* Variant number */; string varname /* Variable name */; int boxidx /* Dialog box index */; int boxmode /* Dialog box mode */; int boxcall /* Dialog box call index */; string actseq /* Action sequence */; // Check if extra user specific ULC program call requested if (userzprog!="") ulsystem(userzprog,0); // Check if any color/window specific dialog boxes should be updated for (boxidx=1;boxidx=daux || daly>=dauy) // Invalid drawing area return; // Get the background grid text position if (varget(GV_TB_BGRIDX,tx)==0 && varget(GV_TB_BGRIDY,ty)==0) { bae_getbackgrid(gridx,gridy); dispgridtext(tx,ty,gridx,gridy,0); } // Get the input grid text position if (varget(GV_TB_IGRIDX,tx)==0 && varget(GV_TB_IGRIDY,ty)==0) { bae_getinpgrid(gridx,gridy); dispgridtext(tx,ty,gridx,gridy,1); } // Get the design view drawing area if (varget(GV_TB_DVLX,dvlx)==0 && varget(GV_TB_DVLY,dvly)==0 && varget(GV_TB_DVUX,dvux)==0 && varget(GV_TB_DVUY,dvuy)==0) { dvlx*=pop_aspectratio(); dvux*=pop_aspectratio(); dvdraw=1; } // Abort if invalid plan class if (bae_planddbclass()==DDBCLUNDEF) { // Activate the toolbar drawing area bae_popsetarea(1); // Clear the background pop_drawrect( dalx,daly,daux-dalx,dauy-daly,TCOLOR_WHITE,COLOR_NONE); // Check if layer buttons available switch (callertype) { case ULIPGED : case ULIPAR : case ULIPCAM : case ULIPCV : // Update the layer button colors layerbuttonupd(); break; } // Reactivate the standard popup drawing area bae_popsetarea(0); return; } // Get the draw area size xdsize=daux-dalx; ydsize=dauy-daly; // Get the zoom window size zwlx=bae_wswinlx()*pop_aspectratio(); zwly=bae_wswinly(); zwux=bae_wswinux()*pop_aspectratio(); zwuy=bae_wswinuy(); // Get the workspace size ailx=wslx=bae_planwslx()*pop_aspectratio(); aily=wsly=bae_planwsly(); aiux=wsux=bae_planwsux()*pop_aspectratio(); aiuy=wsuy=bae_planwsuy(); wsnx=bae_planwsnx()*pop_aspectratio(); wsny=bae_planwsny(); // Get the area of interest if (ailx>zwlx) ailx=zwlx; if (aiuxzwly) aily=zwly; if (aiuyytsize/ydsize) { // Set the scaling factors xscale=AREASHRINK*xdsize/xtsize; yscale=xscale; // Get the offsets xoff=dalx-ailx*xscale+0.5*(1.0-AREASHRINK)*xdsize; yoff=daly+aiuy*yscale+0.5*(1.0-AREASHRINK)*ydsize +0.5*(AREASHRINK*ydsize-ytsize*yscale); } else { // Set the scaling factors yscale=AREASHRINK*ydsize/ytsize; xscale=yscale; // Get the offsets yoff=daly+aiuy*yscale+0.5*(1.0-AREASHRINK)*ydsize; xoff=dalx-ailx*xscale+0.5*(1.0-AREASHRINK)*xdsize +0.5*(AREASHRINK*xdsize-xtsize*xscale); } bae_getintpar(24,wmirror); if (wmirror==1) { yoff=dauy-(yoff-daly); yscale=(-yscale); } else if (wmirror==2) { xoff=daux-(xoff-dalx); xscale=(-xscale); } wsnx*=xscale; wsny*=yscale; // Store the zoom window transf. matrix varset(GV_TB_ZOOMXO,xoff); varset(GV_TB_ZOOMXS,xscale*pop_aspectratio()); varset(GV_TB_ZOOMYO,yoff); varset(GV_TB_ZOOMYS,yscale); // Draw the zoom window pop_drawrect(xoff+zwlx*xscale,yoff-zwuy*yscale, (zwux-zwlx)*xscale,(zwuy-zwly)*yscale,COLOR_DGRAY,COLOR_NONE); // Draw the workspace window pop_drawrect(xoff+wslx*xscale,yoff-wsuy*yscale, (wsux-wslx)*xscale,(wsuy-wsly)*yscale,COLOR_NONE,COLOR_WHITE); // Draw the design view window if (dvdraw) pop_drawrect(xoff+dvlx*xscale,yoff-dvuy*yscale, (dvux-dvlx)*xscale,(dvuy-dvly)*yscale,COLOR_NONE,COLOR_YELLOW); // Run the caller type specific zoom action function switch (callertype) { case ULIPSCM : // Query the current active variant if (bae_planddbclass()!=DDBCLSCM || cap_rulequery( RS_OCSCMDB,0,RS_SCMSUBJ,RS_VARIANT,"?d",varnumber)<1) // Set default variant varnumber=0; break; case ULIPGED : case ULIPAR : case ULIPCAM : if ((outlcol=bae_getcolor(-2))>0) forall (poly where poly.TYP==L_POLYBRDOUT) { // Clear the polygon list bae_clearpoints(); xscale*=pop_aspectratio(); forall (point of poly) bae_storepoint(xoff+point.X*xscale, yoff-point.Y*yscale, (point.TYP!=0 && !wmirror) ? (point.TYP==2 ? 1 : 2) : point.TYP); // Draw the polygon bae_popdrawpoly(outlcol,DM_REPLACE,PPFM_CLINE); break; } if (bae_planddbclass()!=DDBCLLAY || lay_rulequery( RS_OCPLAN,0,RS_PCBSUBJ,RS_VARIANT,"?d",varnumber)<1) // Set default variant varnumber=0; case ULIPCV : // Update the layer button colors layerbuttonupd(); break; default : // Reactivate the standard popup drawing area bae_popsetarea(0); bae_storepoint(0.0,0.0,expertmode); exit(0); } // Draw the origin marker cross pop_drawline(xoff+wsnx,yoff-wsny+(1.0-AREASHRINK)*ydsize, xoff+wsnx,yoff-wsny-(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx-(1.0-AREASHRINK)*xdsize,yoff-wsny, xoff+wsnx+(1.0-AREASHRINK)*xdsize,yoff-wsny,COLOR_WHITE); if (wmirror==1) { // Draw the mirror markers pop_drawline(xoff+wsnx,yoff-wsny+(1.0-AREASHRINK)*ydsize, xoff+wsnx+0.25*(1.0-AREASHRINK)*xdsize, yoff-wsny+0.5*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx,yoff-wsny+(1.0-AREASHRINK)*ydsize, xoff+wsnx-0.25*(1.0-AREASHRINK)*xdsize, yoff-wsny+0.5*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx,yoff-wsny-(1.0-AREASHRINK)*ydsize, xoff+wsnx+0.25*(1.0-AREASHRINK)*xdsize, yoff-wsny-0.5*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx,yoff-wsny-(1.0-AREASHRINK)*ydsize, xoff+wsnx-0.25*(1.0-AREASHRINK)*xdsize, yoff-wsny-0.5*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); } else if (wmirror==2) { // Draw the mirror markers pop_drawline(xoff+wsnx+(1.0-AREASHRINK)*xdsize,yoff-wsny, xoff+wsnx+0.5*(1.0-AREASHRINK)*xdsize, yoff-wsny+0.25*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx+(1.0-AREASHRINK)*xdsize,yoff-wsny, xoff+wsnx+0.5*(1.0-AREASHRINK)*xdsize, yoff-wsny-0.25*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx-(1.0-AREASHRINK)*xdsize,yoff-wsny, xoff+wsnx-0.5*(1.0-AREASHRINK)*xdsize, yoff-wsny+0.25*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); pop_drawline(xoff+wsnx-(1.0-AREASHRINK)*xdsize,yoff-wsny, xoff+wsnx-0.5*(1.0-AREASHRINK)*xdsize, yoff-wsny-0.25*(1.0-AREASHRINK)*ydsize,COLOR_WHITE); } // Draw the variant number if (varnumber>0) { // Get the draw area size xscale=pop_aspectratio(); // Select variant table entry curvarname=""; sprintf(sqlcommand,V_SELECTN,varnumber); // Build the variant number string sqlcmd(bae_planfname(),sqlcommand,ndatafunc); if (curvarname=="") sprintf(curvarname,"%d",varnumber); // Get the text size tsize=3.0*xscale/strlen(curvarname); if (tsize>0.25*ydsize) tsize=0.25*ydsize; // Get the centered string position xoff=dalx+0.5*xdsize-(strlen(curvarname)*tsize/3.0)*xscale; yoff=(-0.375*ydsize+0.5*tsize); // Draw vectorized text if (callertype==ULIPSCM) cap_vecttext( 0.0,0.0,0.0,0,tsize,0,curvarname,tlinefunc); else lay_vecttext( 0.0,0.0,0.0,0,tsize,0,0,0,curvarname,tlinefunc); // Build the variant number string sprintf(curvarname,"%d",varnumber); // Get the text size tsize=3.0*xscale/strlen(curvarname); if (tsize>0.25*ydsize) tsize=0.25*ydsize; // Get the centered string position xoff=dalx+0.5*xdsize-(strlen(curvarname)*tsize/3.0)*xscale; yoff=(-0.625*ydsize+0.5*tsize); // Draw vectorized text if (callertype==ULIPSCM) cap_vecttext( 0.0,0.0,0.0,0,tsize,0,curvarname,tlinefunc); else lay_vecttext( 0.0,0.0,0.0,0,tsize,0,0,0,curvarname,tlinefunc); } if (varget(GV_TB_HISTMAX,histmax) || histmax<=0 || varget(GV_TB_HISTPOS,histpos) || varget(GV_TB_HISTBASE,histbase)) { histmax=histbase=0; histpos=0; } histidx=histmax==0 ? 0 : histpos%HISTMAX; // Check if element really still in history sprintf(curvarname,GV_TB_HISTFN,histidx); if (varget(curvarname,name)!=0 || name!=bae_planfname()) { bae_popsetarea(0); bae_storepoint(0.0,0.0,expertmode); exit(0); } sprintf(curvarname,GV_TB_HISTEN,histidx); if (varget(curvarname,name)!=0 || name!=bae_planename()) { bae_popsetarea(0); bae_storepoint(0.0,0.0,expertmode); exit(0); } // Update history buttons if (varget(GV_TB_HISTPX,xoff)==0 && varget(GV_TB_HISTPY,yoff)==0) popicon_left(xoff,yoff,BUTSCALE, histpos<=histbase ? 0 : 1,1,""); if (varget(GV_TB_HISTNX,xoff)==0 && varget(GV_TB_HISTNY,yoff)==0) popicon_right(xoff,yoff,BUTSCALE, (histpos-histbase+1)>=histmax ? 0 : 1,1,""); // Reactivate the standard popup drawing area bae_popsetarea(0); bae_storepoint(0.0,0.0,expertmode); // Store current zoom window for history restore wslx=bae_wswinlx(); wsly=bae_wswinly(); wsux=bae_wswinux(); wsuy=bae_wswinuy(); // Get the window center point wscx=0.5*(wslx+wsux); wscy=0.5*(wsly+wsuy); // Get the workspace dimensions wsxdim=wsux-wslx; wsydim=wsuy-wsly; // Do some zoom reduction wsxdim*=0.95; wsydim*=0.95; // Store the adjusted workspace size sprintf(curvarname,GV_TB_HISTLX,histidx); varset(curvarname,wscx-0.5*wsxdim); sprintf(curvarname,GV_TB_HISTLY,histidx); varset(curvarname,wscy-0.5*wsydim); sprintf(curvarname,GV_TB_HISTUX,histidx); varset(curvarname,wscx+0.5*wsxdim); sprintf(curvarname,GV_TB_HISTUY,histidx); varset(curvarname,wscy+0.5*wsydim); } static int tlinefunc(double x1,double y1,double x2,double y2) /* // Draw a text line as path // Return value : // zero if done or (-1) on error // Parameters : // double x1 : First line point X coordinate // double y1 : First line point Y coordinate // double x2 : Second line point X coordinate // double y2 : Second line point Y coordinate */ { // Draw the line bae_clearpoints(); bae_storepoint(x1*xscale+xoff,dauy-y1+yoff,0); bae_storepoint(x2*xscale+xoff,dauy-y2+yoff,0); bae_popdrawpoly(vartcolor,DM_SET,PPFM_LINE); // Return without errors return(0); } int ndatafunc(string dstr,int dint,double ddbl, int dval,int dtype,string dtable,string dfield,int didx) /* // Name data query callback function // Return value : // zero if done or (-1) on data error // Parameters : // string dstr : String/Date data // int dint : Integer/Boolean data // double ddbl : Float data // int dval : Data valid flag // int dtype : Data type // string dtable : Data table name // string dfield : Data field name // int didx : Data output field index */ { // Check the data field switch (didx) { case 1 : curvarname=dstr; break; default : ; } // Return without errors return(0); } static void layerbuttonupd() /* // Update the layer color buttons */ { int crcolflags[] = { // Cross color black flags 0,0,0,1, 0,0,0,1, 0,0,1,1, 1,1,1,1 }; string varname /* Global variable name */; string layname /* Layer name */; double x /* Layer color button X pos. */; double y /* Layer color button Y pos. */; double w /* Layer color button width */; double h /* Layer color button height */; int color /* Layer color index */; int ccolor /* Layer cross color index */; int laybase /* Documentary layer base */; int laycode /* Documentary layer code */; int i, j /* Loop control variables */; int oldpicklay = LAYERINV /* Old pick layer */; int newpicklay = LAYERINV /* New pick layer */; int oldtoplay = LAYERINV /* Old plan top layer */; int newtoplay = LAYERINV /* New plan top layer */; int olditoplay = LAYERINV /* Old plan inner top layer */; int newitoplay = LAYERINV /* New plan inner top layer */; // Get the old and new pick layer varget(GV_TB_PICKLAY,oldpicklay); if (callertype==ULIPGED) { if (ged_getpickmode()==0) newpicklay=ged_getpickpreflay(); } else if (varget(GV_TB_PICKLAST,newpicklay)) { oldpicklay=LAYERINV; } if (oldpicklay!=newpicklay) varset(GV_TB_PICKLAY,newpicklay); // Get the plan top layer if (callertype==ULIPGED || callertype==ULIPCAM || callertype==ULIPAR) { varget(GV_TB_TOPLAY,oldtoplay); newtoplay=lay_plantoplay(); if (oldtoplay!=newtoplay) varset(GV_TB_TOPLAY,newtoplay); varget(GV_TB_ITOPLAY,olditoplay); if (newtoplay==1 && (newitoplay=lay_planmidlaycnt())>0) newitoplay++; else newitoplay=LAYERINV; if (olditoplay!=newitoplay) varset(GV_TB_ITOPLAY,newitoplay); } // Update all signal layer button color fields for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Check if color faded out if (ccolor>=0) crossbox(ccolor,x,y,w,h); } // Update all power layer button color fields for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Check if color faded out if (ccolor>=0) crossbox(ccolor,x,y,w,h); } // Update any layer button color fields for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Check if color faded out if (ccolor>=0) crossbox(ccolor,x,y,w,h); } // Update all documentary layer button color fields for (i=0;i15 || crcolflags[color]) ? COLOR_BLACK : COLOR_WHITE; } else { color=color&0x0FFFFF; ccolor=(-1); } // Draw the layer button rectangle pop_drawrect(x,y,w,h,color,TCOLOR_BLACK); // Check if color faded out if (ccolor>=0) crossbox(ccolor,x,y,w,h); } } } void crossbox(int ccolor,double x,double y,double w, double h) /* // Cross out rectangle box // Parameters : // int ccolor : Cross color index // double x : Rectangle X pos. // double y : Rectangle Y pos. // double w : Rectangle width // double h : Rectangle height */ { // Draw cross lines bae_clearpoints(); bae_storepoint(x,y,0); bae_storepoint(x+w,y+h,0); bae_popdrawpoly(ccolor,DM_REPLACE,PPFM_LINE); bae_clearpoints(); bae_storepoint(x+w,y,0); bae_storepoint(x,y+h,0); bae_popdrawpoly(ccolor,DM_REPLACE,PPFM_LINE); } void complementbox(double lx,double ly,double ux, double uy) /* // Complement rectangle box // Parameters : // double lx : Lower X pos. // double ly : Lower Y pos. // double ux : Upper X pos. // double uy : Upper Y pos. */ { // Complement rectangle content bae_clearpoints(); bae_storepoint(lx,ly,0); bae_storepoint(ux,ly,0); bae_storepoint(ux,uy,0); bae_storepoint(lx,uy,0); bae_popdrawpoly(TCOLOR_WHITE,DM_COMPLEMENT,PPFM_FILL); } void dispgridtext(double tx,double ty,double gridx,double gridy,int inpflag) /* // Display grid text // Parameters : // double tx : Grid text X pos. // double ty : Grid text Y pos. // double gridx : Grid X pos. // double gridy : Grid Y pos. // int inpflag : Input grid flag */ { struct gvaldes { // Grid value descriptor double gdim /* Grid dimension */; string name /* Grid menu name */; }; struct gvaldes gridl[] = { // Grid list { 0.0254/10.0, UPRGRID01 }, { 0.0254/20.0, UPRGRID02 }, { 0.0254/40.0, UPRGRID03 }, { 0.0254/60.0, UPRGRID04 }, { 0.0254/80.0, UPRGRID05 }, { 0.0254/100.0, UPRGRID06 }, { 0.0254/120.0, UPRGRID07 }, { 0.0254/160.0, UPRGRID08 }, { 0.0254/200.0, UPRGRID09 }, { 0.0254/240.0, UPRGRID10 }, { 0.0254/480.0, UPRGRID11 }, { 0.0254/1000.0, UPRGRID12 }, { 0.0254/10000.0, UPRGRID13 } }; int gridn = arylength(gridl) /* Grid count */; string dispstr = "" /* Grid display string */; int i /* Loop control variable */; // Check if standard inch grid for (i=0;iSMALLVAL) { if (callertype==ULIPCED) sprintf(dispstr,"%sum", bae_numstring(cvtlength(gridx,0,4),3)); else sprintf(dispstr,"%smm", bae_numstring(cvtlength(gridx,0,2),4)); } else dispstr="----"; } if (inpflag && !bae_getgridlock()) dispstr="----"; // Activate the toolbar drawing area bae_popsetarea(1); // Display text sprintf(dispstr,"%-8s",dispstr); bae_popdrawtext(ty,tx,TCOLOR_BLACK,TPOPBACKCOL,dispstr); // Reactivate the standard popup drawing area bae_popsetarea(0); } // User Language program end