! supersubscriptLJ in all radio and checkbox labels ! more automation in checkbox read routines? !! HHLib begins ! include animation button revisions in all horizontal sliders ! 11000 ! 01100 ! 00110 ! 00011 ! 00110 ! 01100 ! 11000 ! window grids need param for first value!! ! fix vertical first value in axis ticks and labels ! multiplier needs to be active in labeling of axes MODULE Interface DECLARE PUBLIC PCflag,M68kflag,Mac5flag,Unixflag,xmax,ymax DECLARE PUBLIC toolLft,toolRgt,toolBas,toolTop,toolhdr,toolHgt,toolWid ! tool boundaries DECLARE PUBLIC winLft,winRgt,winBas,winTop,winHgt,winWid ! window DECLARE PUBLIC workLft,workRgt,workBas,workTop,workMidx ! work area DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr,rightsclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr,headerclr,btnclr DECLARE PUBLIC largefonts, title$ ! --- tool panel buttons --- PUBLIC qLft,qRgt,qBas,qTop PUBLIC infLft,infRgt,infBas,infTop DEF InfoWithin(wx,wy,ms) IF wx>infLft and wxinfTop and wyqLft and wxqTop and wycbtnLft and mxcbtnTop and myWidth or Rgtpnt=endofpar LET line$ = trim$(para$(Lftpnt:Rgtpnt)) LET p= pos(line$,"[") IF p<>0 then CALL SuperSubScriptLJ(txtLft,Basln,line$,clr) ELSE CALL PlotTextLJ(txtLft,Basln,line$,clr) END IF LET Basln = Basln + lnspc LET Lftpnt= min(Rgtpnt+1,endofpar) LOOP until Lftpnt=endofpar END SUB END SUB END MODULE !MODULE OddsAndEnds ! SUB CopyCoords(cx1,cy1,cx2,cy2) ! LET cx2= cx1 ! LET cy2= cy1 ! END SUB !END MODULE ! ---- external support libraries --- ! ---- graphing methods --- ! ---- GraphPlane objects --- MODULE w1GraphPlane DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr PUBLIC w1Lft,w1Rgt,w1Bas,w1Top,w1Midx,w1Midy PUBLIC w1fLft,w1fRgt,w1fBas,w1fTop,w1x0,w1y0 PUBLIC w1xFirst, w1xSTik, w1xLTik, w1xLabel, w1xGridstep PUBLIC w1yFirst, w1ySTik, w1yLTik, w1yLabel, w1yGridstep PUBLIC w1wWid,w1wHgt,w1fWid,w1fHgt PUBLIC w1fxRatio,w1fyRatio,w1wxRatio,w1wyRatio,w1Aspect PUBLIC w1xPiFlag, w1xMult, w1yPiFlag, w1yMult SHARE w1GridLayer$,w1GraphLayer$ DEF w1Fncx(wx)= w1xMult * (w1fLft + w1fxRatio*(wx-w1Lft)) ! window to function DEF w1Fncy(wy)= w1yMult * (w1fBas + w1fyRatio*(w1Bas-wy)) DEF w1wndx(fx)= w1Lft + w1wxRatio * (fx/w1xMult - w1fLft) ! function to window DEF w1wndy(fy)= w1Bas - w1wyRatio * (fy/w1yMult - w1fBas) DEF w1Within(wx,wy) DECLARE DEF WithinWnd LET w1Within= WithinWnd(wx,wy,w1Lft-7,w1Rgt+7,w1Bas+7,w1Top-7) END DEF DEF w1wWithin(wx,wy) DECLARE DEF WithinWnd LET w1wWithin= WithinWnd(wx,wy,w1Lft,w1Rgt,w1Bas,w1Top) END DEF DEF w1fWithin(x,y) DECLARE DEF WithinFnc LET w1fWithin= WithinFnc(x,y,w1fLft,w1fRgt,w1fBas,w1fTop) END DEF SUB w1GetDragValues(mx,my,ms,rx,ry,x,y) DECLARE DEF w1Fncx,w1Fncy GET MOUSE: mx,my,ms LET x = w1Fncx(min(max(mx,w1Lft),w1Rgt)) LET x = round(x,rx) LET y = w1Fncy(min(max(my,w1Top),w1Bas)) LET y = round(y,ry) END SUB SUB w1ShowGridLayer BOX SHOW w1GridLayer$ at w1Lft-6,w1Bas+6 END SUB SUB w1ShowGraphLayer BOX SHOW w1GraphLayer$ at w1Lft-6,w1Bas+6 END SUB SUB w1KeepGridLayer BOX KEEP w1Lft-6,w1Rgt+6,w1Bas+6,w1Top-6 in w1GridLayer$ END SUB SUB w1KeepGraphLayer BOX KEEP w1Lft-6,w1Rgt+6,w1Bas+6,w1Top-6 in w1GraphLayer$ END SUB SUB w1Clear CALL BoxArea(w1Lft+1,w1Rgt-1,w1Bas-1,w1Top+1,planeclr) END SUB SUB w1PixelsToMath(wx,wy,fx,fy) DECLARE DEF w1Fncx,w1Fncy LET fx= w1Fncx(wx) LET fy= w1Fncy(wy) END SUB SUB w1MathToPixels(fx,fy,wx,wy) DECLARE DEF w1Wndx,w1Wndy LET wx= round(w1Wndx(fx)) LET wy= round(w1Wndy(fy)) END SUB SUB w1wClamp(wx,wy) DECLARE DEF clamp LET wx= clamp(wx,w1Lft,w1Rgt) LET wy= clamp(wy,w1Top,w1Bas) END SUB SUB w1fClamp(fx,fy) DECLARE DEF clamp LET fx= clamp(fx,w1fLft,w1fRgt) LET fy= clamp(fy,w1fTop,w1fBas) END SUB SUB w1Variables DECLARE DEF w1Wndx,w1Wndy CALL WndParams(w1Lft,w1Rgt,w1Bas,w1Top,w1wWid,w1wHgt,w1Midx,w1Midy) CALL FncParams(w1fLft,w1fRgt,w1fBas,w1fTop,w1fWid,w1fHgt,w1fMidx,w1fMidy) CALL PlaneRatios(w1fWid,w1fHgt,w1wWid,w1wHgt,w1fxRatio,w1fyRatio,w1wxRatio,w1wyRatio) LET w1Aspect = (w1wWid/w1fWid)/(w1wHgt/w1fHgt) LET w1x0 = w1wndx(0) LET w1y0 = w1wndy(0) END SUB SUB w1DrawPlane(xFlag,yFlag,zeroFlag) CALL GraphPlane(w1Lft,w1Rgt,w1Bas,w1Top) IF w1xGridstep<>0 then CALL xGrid(w1Lft,w1Rgt,w1Bas,w1Top,w1fLft,w1fRgt,w1xGridstep,gridclr) END IF IF w1yGridstep<>0 then CALL yGrid(w1Lft,w1Rgt,w1Bas,w1Top,w1fBas,w1fTop,w1yGridstep,gridclr) END IF IF yFlag<>0 then ! axis visible? IF w1yPiFlag=1 then ! pi axis? IF yFlag=1 then ! left side of plane CALL EdgesVrtPi(w1Lft,w1Bas,w1Top,w1fBas,w1fTop,w1yFirst,w1ySTik,w1yLTik,w1yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrtPi(w1Rgt,w1Bas,w1Top,w1fBas,w1fTop,w1yFirst,w1ySTik,w1yLTik,w1yLabel, 1) END IF ELSE ! normal scale axis IF yFlag=1 then ! left side of plane CALL EdgesVrt(w1Lft,w1Bas,w1Top,w1fBas,w1fTop,w1yFirst,w1ySTik,w1yLTik,w1yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrt(w1Rgt,w1Bas,w1Top,w1fBas,w1fTop,w1yFirst,w1ySTik,w1yLTik,w1yLabel, 1) END IF END IF END IF IF xFlag<>0 then ! axis visible? IF w1xPiFlag=1 then ! pi axis? IF xFlag=1 then ! bottom of plane CALL EdgesHrzPi(w1Lft,w1Rgt,w1Bas,w1fLft,w1fRgt,w1xFirst,w1xSTik,w1xLTik,w1xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrzPi(w1Lft,w1Rgt,w1Top,w1fLft,w1fRgt,w1xFirst,w1xSTik,w1xLTik,w1xLabel,-1) END IF ELSE ! normal scale axis IF xFlag=1 then ! bottom of plane CALL EdgesHrz(w1Lft,w1Rgt,w1Bas,w1fLft,w1fRgt,w1xFirst,w1xSTik,w1xLTik,w1xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrz(w1Lft,w1Rgt,w1Top,w1fLft,w1fRgt,w1xFirst,w1xSTik,w1xLTik,w1xLabel,-1) END IF END IF END IF IF abs(zeroFlag)= 1 then ! zero axes on? CALL ZeroAxes(w1x0,w1y0,w1Lft,w1Rgt,w1Bas,w1Top,zeroflag,axisclr) END IF END SUB END MODULE MODULE w2GraphPlane DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr PUBLIC w2Lft,w2Rgt,w2Bas,w2Top,w2Midx,w2Midy PUBLIC w2fLft,w2fRgt,w2fBas,w2fTop,w2x0,w2y0 PUBLIC w2xFirst, w2xSTik, w2xLTik, w2xLabel, w2xGridstep PUBLIC w2yFirst, w2ySTik, w2yLTik, w2yLabel, w2yGridstep PUBLIC w2wWid,w2wHgt,w2fWid,w2fHgt PUBLIC w2fxRatio,w2fyRatio,w2wxRatio,w2wyRatio,w2Aspect PUBLIC w2xPiFlag, w2xMult, w2yPiFlag, w2yMult SHARE w2GridLayer$,w2GraphLayer$ DEF w2Fncx(wx)= w2xMult * (w2fLft + w2fxRatio*(wx-w2Lft)) ! window to function DEF w2Fncy(wy)= w2yMult * (w2fBas + w2fyRatio*(w2Bas-wy)) DEF w2wndx(fx)= w2Lft + w2wxRatio * (fx/w2xMult - w2fLft) ! function to window DEF w2wndy(fy)= w2Bas - w2wyRatio * (fy/w2yMult - w2fBas) DEF w2Within(wx,wy) DECLARE DEF WithinWnd LET w2Within= WithinWnd(wx,wy,w2Lft-7,w2Rgt+7,w2Bas+7,w2Top-7) END DEF DEF w2wWithin(wx,wy) DECLARE DEF WithinWnd LET w2wWithin= WithinWnd(wx,wy,w2Lft,w2Rgt,w2Bas,w2Top) END DEF DEF w2fWithin(x,y) DECLARE DEF WithinFnc LET w2fWithin= WithinFnc(x,y,w2fLft,w2fRgt,w2fBas,w2fTop) END DEF SUB w2GetDragValues(mx,my,ms,rx,ry,x,y) DECLARE DEF w2Fncx,w2Fncy GET MOUSE: mx,my,ms LET x = w2Fncx(min(max(mx,w2Lft),w2Rgt)) LET x = round(x,rx) LET y = w2Fncy(min(max(my,w2Top),w2Bas)) LET y = round(y,ry) END SUB SUB w2ShowGridLayer BOX SHOW w2GridLayer$ at w2Lft-6,w2Bas+6 END SUB SUB w2ShowGraphLayer BOX SHOW w2GraphLayer$ at w2Lft-6,w2Bas+6 END SUB SUB w2KeepGridLayer BOX KEEP w2Lft-6,w2Rgt+6,w2Bas+6,w2Top-6 in w2GridLayer$ END SUB SUB w2KeepGraphLayer BOX KEEP w2Lft-6,w2Rgt+6,w2Bas+6,w2Top-6 in w2GraphLayer$ END SUB SUB w2Clear CALL BoxArea(w2Lft+1,w2Rgt-1,w2Bas-1,w2Top+1,planeclr) END SUB SUB w2PixelsToMath(wx,wy,fx,fy) DECLARE DEF w2Fncx,w2Fncy LET fx= w2Fncx(wx) LET fy= w2Fncy(wy) END SUB SUB w2MathToPixels(fx,fy,wx,wy) DECLARE DEF w2Wndx,w2Wndy LET wx= round(w2Wndx(fx)) LET wy= round(w2Wndy(fy)) END SUB SUB w2wClamp(wx,wy) DECLARE DEF clamp LET wx= clamp(wx,w2Lft,w2Rgt) LET wy= clamp(wy,w2Top,w2Bas) END SUB SUB w2fClamp(fx,fy) DECLARE DEF clamp LET fx= clamp(fx,w2fLft,w2fRgt) LET fy= clamp(fy,w2fTop,w2fBas) END SUB SUB w2Variables DECLARE DEF w2Wndx,w2Wndy CALL WndParams(w2Lft,w2Rgt,w2Bas,w2Top,w2wWid,w2wHgt,w2Midx,w2Midy) CALL FncParams(w2fLft,w2fRgt,w2fBas,w2fTop,w2fWid,w2fHgt,w2fMidx,w2fMidy) CALL PlaneRatios(w2fWid,w2fHgt,w2wWid,w2wHgt,w2fxRatio,w2fyRatio,w2wxRatio,w2wyRatio) LET w2Aspect = (w2wWid/w2fWid)/(w2wHgt/w2fHgt) LET w2x0 = w2wndx(0) LET w2y0 = w2wndy(0) END SUB SUB w2DrawPlane(xFlag,yFlag,zeroFlag) CALL GraphPlane(w2Lft,w2Rgt,w2Bas,w2Top) IF w2xGridstep<>0 then CALL xGrid(w2Lft,w2Rgt,w2Bas,w2Top,w2fLft,w2fRgt,w2xGridstep,gridclr) END IF IF w2yGridstep<>0 then CALL yGrid(w2Lft,w2Rgt,w2Bas,w2Top,w2fBas,w2fTop,w2yGridstep,gridclr) END IF IF yFlag<>0 then ! axis visible? IF w2yPiFlag=1 then ! pi axis? IF yFlag=1 then ! left side of plane CALL EdgesVrtPi(w2Lft,w2Bas,w2Top,w2fBas,w2fTop,w2yFirst,w2ySTik,w2yLTik,w2yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrtPi(w2Rgt,w2Bas,w2Top,w2fBas,w2fTop,w2yFirst,w2ySTik,w2yLTik,w2yLabel, 1) END IF ELSE ! normal scale axis IF yFlag=1 then ! left side of plane CALL EdgesVrt(w2Lft,w2Bas,w2Top,w2fBas,w2fTop,w2yFirst,w2ySTik,w2yLTik,w2yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrt(w2Rgt,w2Bas,w2Top,w2fBas,w2fTop,w2yFirst,w2ySTik,w2yLTik,w2yLabel, 1) END IF END IF END IF IF xFlag<>0 then ! axis visible? IF w2xPiFlag=1 then ! pi axis? IF xFlag=1 then ! bottom of plane CALL EdgesHrzPi(w2Lft,w2Rgt,w2Bas,w2fLft,w2fRgt,w2xFirst,w2xSTik,w2xLTik,w2xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrzPi(w2Lft,w2Rgt,w2Top,w2fLft,w2fRgt,w2xFirst,w2xSTik,w2xLTik,w2xLabel,-1) END IF ELSE ! normal scale axis IF xFlag=1 then ! bottom of plane CALL EdgesHrz(w2Lft,w2Rgt,w2Bas,w2fLft,w2fRgt,w2xFirst,w2xSTik,w2xLTik,w2xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrz(w2Lft,w2Rgt,w2Top,w2fLft,w2fRgt,w2xFirst,w2xSTik,w2xLTik,w2xLabel,-1) END IF END IF END IF IF abs(zeroFlag)= 1 then ! zero axes on? CALL ZeroAxes(w2x0,w2y0,w2Lft,w2Rgt,w2Bas,w2Top,zeroflag,axisclr) END IF END SUB END MODULE MODULE w3GraphPlane DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr PUBLIC w3Lft,w3Rgt,w3Bas,w3Top,w3Midx,w3Midy PUBLIC w3fLft,w3fRgt,w3fBas,w3fTop,w3x0,w3y0 PUBLIC w3xFirst, w3xSTik, w3xLTik, w3xLabel, w3xGridstep PUBLIC w3yFirst, w3ySTik, w3yLTik, w3yLabel, w3yGridstep PUBLIC w3wWid,w3wHgt,w3fWid,w3fHgt PUBLIC w3fxRatio,w3fyRatio,w3wxRatio,w3wyRatio,w3Aspect PUBLIC w3xPiFlag, w3xMult, w3yPiFlag, w3yMult SHARE w3GridLayer$,w3GraphLayer$ DEF w3Fncx(wx)= w3xMult * (w3fLft + w3fxRatio*(wx-w3Lft)) ! window to function DEF w3Fncy(wy)= w3yMult * (w3fBas + w3fyRatio*(w3Bas-wy)) DEF w3wndx(fx)= w3Lft + w3wxRatio * (fx/w3xMult - w3fLft) ! function to window DEF w3wndy(fy)= w3Bas - w3wyRatio * (fy/w3yMult - w3fBas) DEF w3Within(wx,wy) DECLARE DEF WithinWnd LET w3Within= WithinWnd(wx,wy,w3Lft-7,w3Rgt+7,w3Bas+7,w3Top-7) END DEF DEF w3wWithin(wx,wy) DECLARE DEF WithinWnd LET w3wWithin= WithinWnd(wx,wy,w3Lft,w3Rgt,w3Bas,w3Top) END DEF DEF w3fWithin(x,y) DECLARE DEF WithinFnc LET w3fWithin= WithinFnc(x,y,w3fLft,w3fRgt,w3fBas,w3fTop) END DEF SUB w3GetDragValues(mx,my,ms,rx,ry,x,y) DECLARE DEF w3Fncx,w3Fncy GET MOUSE: mx,my,ms LET x = w3Fncx(min(max(mx,w3Lft),w3Rgt)) LET x = round(x,rx) LET y = w3Fncy(min(max(my,w3Top),w3Bas)) LET y = round(y,ry) END SUB SUB w3ShowGridLayer BOX SHOW w3GridLayer$ at w3Lft-6,w3Bas+6 END SUB SUB w3ShowGraphLayer BOX SHOW w3GraphLayer$ at w3Lft-6,w3Bas+6 END SUB SUB w3KeepGridLayer BOX KEEP w3Lft-6,w3Rgt+6,w3Bas+6,w3Top-6 in w3GridLayer$ END SUB SUB w3KeepGraphLayer BOX KEEP w3Lft-6,w3Rgt+6,w3Bas+6,w3Top-6 in w3GraphLayer$ END SUB SUB w3Clear CALL BoxArea(w3Lft+1,w3Rgt-1,w3Bas-1,w3Top+1,planeclr) END SUB SUB w3PixelsToMath(wx,wy,fx,fy) DECLARE DEF w3Fncx,w3Fncy LET fx= w3Fncx(wx) LET fy= w3Fncy(wy) END SUB SUB w3MathToPixels(fx,fy,wx,wy) DECLARE DEF w3Wndx,w3Wndy LET wx= round(w3Wndx(fx)) LET wy= round(w3Wndy(fy)) END SUB SUB w3wClamp(wx,wy) DECLARE DEF clamp LET wx= clamp(wx,w3Lft,w3Rgt) LET wy= clamp(wy,w3Top,w3Bas) END SUB SUB w3fClamp(fx,fy) DECLARE DEF clamp LET fx= clamp(fx,w3fLft,w3fRgt) LET fy= clamp(fy,w3fTop,w3fBas) END SUB SUB w3Variables DECLARE DEF w3Wndx,w3Wndy CALL WndParams(w3Lft,w3Rgt,w3Bas,w3Top,w3wWid,w3wHgt,w3Midx,w3Midy) CALL FncParams(w3fLft,w3fRgt,w3fBas,w3fTop,w3fWid,w3fHgt,w3fMidx,w3fMidy) CALL PlaneRatios(w3fWid,w3fHgt,w3wWid,w3wHgt,w3fxRatio,w3fyRatio,w3wxRatio,w3wyRatio) LET w3Aspect = (w3wWid/w3fWid)/(w3wHgt/w3fHgt) LET w3x0 = w3wndx(0) LET w3y0 = w3wndy(0) END SUB SUB w3DrawPlane(xFlag,yFlag,zeroFlag) CALL GraphPlane(w3Lft,w3Rgt,w3Bas,w3Top) IF w3xGridstep<>0 then CALL xGrid(w3Lft,w3Rgt,w3Bas,w3Top,w3fLft,w3fRgt,w3xGridstep,gridclr) END IF IF w3yGridstep<>0 then CALL yGrid(w3Lft,w3Rgt,w3Bas,w3Top,w3fBas,w3fTop,w3yGridstep,gridclr) END IF IF yFlag<>0 then ! axis visible? IF w3yPiFlag=1 then ! pi axis? IF yFlag=1 then ! left side of plane CALL EdgesVrtPi(w3Lft,w3Bas,w3Top,w3fBas,w3fTop,w3yFirst,w3ySTik,w3yLTik,w3yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrtPi(w3Rgt,w3Bas,w3Top,w3fBas,w3fTop,w3yFirst,w3ySTik,w3yLTik,w3yLabel, 1) END IF ELSE ! normal scale axis IF yFlag=1 then ! left side of plane CALL EdgesVrt(w3Lft,w3Bas,w3Top,w3fBas,w3fTop,w3yFirst,w3ySTik,w3yLTik,w3yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrt(w3Rgt,w3Bas,w3Top,w3fBas,w3fTop,w3yFirst,w3ySTik,w3yLTik,w3yLabel, 1) END IF END IF END IF IF xFlag<>0 then ! axis visible? IF w3xPiFlag=1 then ! pi axis? IF xFlag=1 then ! bottom of plane CALL EdgesHrzPi(w3Lft,w3Rgt,w3Bas,w3fLft,w3fRgt,w3xFirst,w3xSTik,w3xLTik,w3xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrzPi(w3Lft,w3Rgt,w3Top,w3fLft,w3fRgt,w3xFirst,w3xSTik,w3xLTik,w3xLabel,-1) END IF ELSE ! normal scale axis IF xFlag=1 then ! bottom of plane CALL EdgesHrz(w3Lft,w3Rgt,w3Bas,w3fLft,w3fRgt,w3xFirst,w3xSTik,w3xLTik,w3xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrz(w3Lft,w3Rgt,w3Top,w3fLft,w3fRgt,w3xFirst,w3xSTik,w3xLTik,w3xLabel,-1) END IF END IF END IF IF abs(zeroFlag)= 1 then ! zero axes on? CALL ZeroAxes(w3x0,w3y0,w3Lft,w3Rgt,w3Bas,w3Top,zeroflag,axisclr) END IF END SUB END MODULE MODULE w4GraphPlane DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr PUBLIC w4Lft,w4Rgt,w4Bas,w4Top,w4Midx,w4Midy PUBLIC w4fLft,w4fRgt,w4fBas,w4fTop,w4x0,w4y0 PUBLIC w4xFirst, w4xSTik, w4xLTik, w4xLabel, w4xGridstep PUBLIC w4yFirst, w4ySTik, w4yLTik, w4yLabel, w4yGridstep PUBLIC w4wWid,w4wHgt,w4fWid,w4fHgt PUBLIC w4fxRatio,w4fyRatio,w4wxRatio,w4wyRatio,w4Aspect PUBLIC w4xPiFlag, w4xMult, w4yPiFlag, w4yMult SHARE w4GridLayer$,w4GraphLayer$ DEF w4Fncx(wx)= w4xMult * (w4fLft + w4fxRatio*(wx-w4Lft)) ! window to function DEF w4Fncy(wy)= w4yMult * (w4fBas + w4fyRatio*(w4Bas-wy)) DEF w4wndx(fx)= w4Lft + w4wxRatio * (fx/w4xMult - w4fLft) ! function to window DEF w4wndy(fy)= w4Bas - w4wyRatio * (fy/w4yMult - w4fBas) DEF w4Within(wx,wy) DECLARE DEF WithinWnd LET w4Within= WithinWnd(wx,wy,w4Lft-7,w4Rgt+7,w4Bas+7,w4Top-7) END DEF DEF w4wWithin(wx,wy) DECLARE DEF WithinWnd LET w4wWithin= WithinWnd(wx,wy,w4Lft,w4Rgt,w4Bas,w4Top) END DEF DEF w4fWithin(x,y) DECLARE DEF WithinFnc LET w4fWithin= WithinFnc(x,y,w4fLft,w4fRgt,w4fBas,w4fTop) END DEF SUB w4GetDragValues(mx,my,ms,rx,ry,x,y) DECLARE DEF w4Fncx,w4Fncy GET MOUSE: mx,my,ms LET x = w4Fncx(min(max(mx,w4Lft),w4Rgt)) LET x = round(x,rx) LET y = w4Fncy(min(max(my,w4Top),w4Bas)) LET y = round(y,ry) END SUB SUB w4ShowGridLayer BOX SHOW w4GridLayer$ at w4Lft-6,w4Bas+6 END SUB SUB w4ShowGraphLayer BOX SHOW w4GraphLayer$ at w4Lft-6,w4Bas+6 END SUB SUB w4KeepGridLayer BOX KEEP w4Lft-6,w4Rgt+6,w4Bas+6,w4Top-6 in w4GridLayer$ END SUB SUB w4KeepGraphLayer BOX KEEP w4Lft-6,w4Rgt+6,w4Bas+6,w4Top-6 in w4GraphLayer$ END SUB SUB w4Clear CALL BoxArea(w4Lft+1,w4Rgt-1,w4Bas-1,w4Top+1,planeclr) END SUB SUB w4PixelsToMath(wx,wy,fx,fy) DECLARE DEF w4Fncx,w4Fncy LET fx= w4Fncx(wx) LET fy= w4Fncy(wy) END SUB SUB w4MathToPixels(fx,fy,wx,wy) DECLARE DEF w4Wndx,w4Wndy LET wx= round(w4Wndx(fx)) LET wy= round(w4Wndy(fy)) END SUB SUB w4wClamp(wx,wy) DECLARE DEF clamp LET wx= clamp(wx,w4Lft,w4Rgt) LET wy= clamp(wy,w4Top,w4Bas) END SUB SUB w4fClamp(fx,fy) DECLARE DEF clamp LET fx= clamp(fx,w4fLft,w4fRgt) LET fy= clamp(fy,w4fTop,w4fBas) END SUB SUB w4Variables DECLARE DEF w4Wndx,w4Wndy CALL WndParams(w4Lft,w4Rgt,w4Bas,w4Top,w4wWid,w4wHgt,w4Midx,w4Midy) CALL FncParams(w4fLft,w4fRgt,w4fBas,w4fTop,w4fWid,w4fHgt,w4fMidx,w4fMidy) CALL PlaneRatios(w4fWid,w4fHgt,w4wWid,w4wHgt,w4fxRatio,w4fyRatio,w4wxRatio,w4wyRatio) LET w4Aspect = (w4wWid/w4fWid)/(w4wHgt/w4fHgt) LET w4x0 = w4wndx(0) LET w4y0 = w4wndy(0) END SUB SUB w4DrawPlane(xFlag,yFlag,zeroFlag) CALL GraphPlane(w4Lft,w4Rgt,w4Bas,w4Top) IF w4xGridstep<>0 then CALL xGrid(w4Lft,w4Rgt,w4Bas,w4Top,w4fLft,w4fRgt,w4xGridstep,gridclr) END IF IF w4yGridstep<>0 then CALL yGrid(w4Lft,w4Rgt,w4Bas,w4Top,w4fBas,w4fTop,w4yGridstep,gridclr) END IF IF yFlag<>0 then ! axis visible? IF w4yPiFlag=1 then ! pi axis? IF yFlag=1 then ! left side of plane CALL EdgesVrtPi(w4Lft,w4Bas,w4Top,w4fBas,w4fTop,w4yFirst,w4ySTik,w4yLTik,w4yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrtPi(w4Rgt,w4Bas,w4Top,w4fBas,w4fTop,w4yFirst,w4ySTik,w4yLTik,w4yLabel, 1) END IF ELSE ! normal scale axis IF yFlag=1 then ! left side of plane CALL EdgesVrt(w4Lft,w4Bas,w4Top,w4fBas,w4fTop,w4yFirst,w4ySTik,w4yLTik,w4yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrt(w4Rgt,w4Bas,w4Top,w4fBas,w4fTop,w4yFirst,w4ySTik,w4yLTik,w4yLabel, 1) END IF END IF END IF IF xFlag<>0 then ! axis visible? IF w4xPiFlag=1 then ! pi axis? IF xFlag=1 then ! bottom of plane CALL EdgesHrzPi(w4Lft,w4Rgt,w4Bas,w4fLft,w4fRgt,w4xFirst,w4xSTik,w4xLTik,w4xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrzPi(w4Lft,w4Rgt,w4Top,w4fLft,w4fRgt,w4xFirst,w4xSTik,w4xLTik,w4xLabel,-1) END IF ELSE ! normal scale axis IF xFlag=1 then ! bottom of plane CALL EdgesHrz(w4Lft,w4Rgt,w4Bas,w4fLft,w4fRgt,w4xFirst,w4xSTik,w4xLTik,w4xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrz(w4Lft,w4Rgt,w4Top,w4fLft,w4fRgt,w4xFirst,w4xSTik,w4xLTik,w4xLabel,-1) END IF END IF END IF IF abs(zeroFlag)= 1 then ! zero axes on? CALL ZeroAxes(w4x0,w4y0,w4Lft,w4Rgt,w4Bas,w4Top,zeroflag,axisclr) END IF END SUB END MODULE MODULE w5GraphPlane DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr PUBLIC w5Lft,w5Rgt,w5Bas,w5Top,w5Midx,w5Midy PUBLIC w5fLft,w5fRgt,w5fBas,w5fTop,w5x0,w5y0 PUBLIC w5xFirst, w5xSTik, w5xLTik, w5xLabel, w5xGridstep PUBLIC w5yFirst, w5ySTik, w5yLTik, w5yLabel, w5yGridstep PUBLIC w5wWid,w5wHgt,w5fWid,w5fHgt PUBLIC w5fxRatio,w5fyRatio,w5wxRatio,w5wyRatio,w5Aspect PUBLIC w5xPiFlag, w5xMult, w5yPiFlag, w5yMult SHARE w5GridLayer$,w5GraphLayer$ DEF w5Fncx(wx)= w5xMult * (w5fLft + w5fxRatio*(wx-w5Lft)) ! window to function DEF w5Fncy(wy)= w5yMult * (w5fBas + w5fyRatio*(w5Bas-wy)) DEF w5wndx(fx)= w5Lft + w5wxRatio * (fx/w5xMult - w5fLft) ! function to window DEF w5wndy(fy)= w5Bas - w5wyRatio * (fy/w5yMult - w5fBas) DEF w5Within(wx,wy) DECLARE DEF WithinWnd LET w5Within= WithinWnd(wx,wy,w5Lft-7,w5Rgt+7,w5Bas+7,w5Top-7) END DEF DEF w5wWithin(wx,wy) DECLARE DEF WithinWnd LET w5wWithin= WithinWnd(wx,wy,w5Lft,w5Rgt,w5Bas,w5Top) END DEF DEF w5fWithin(x,y) DECLARE DEF WithinFnc LET w5fWithin= WithinFnc(x,y,w5fLft,w5fRgt,w5fBas,w5fTop) END DEF SUB w5GetDragValues(mx,my,ms,rx,ry,x,y) DECLARE DEF w5Fncx,w5Fncy GET MOUSE: mx,my,ms LET x = w5Fncx(min(max(mx,w5Lft),w5Rgt)) LET x = round(x,rx) LET y = w5Fncy(min(max(my,w5Top),w5Bas)) LET y = round(y,ry) END SUB SUB w5ShowGridLayer BOX SHOW w5GridLayer$ at w5Lft-6,w5Bas+6 END SUB SUB w5ShowGraphLayer BOX SHOW w5GraphLayer$ at w5Lft-6,w5Bas+6 END SUB SUB w5KeepGridLayer BOX KEEP w5Lft-6,w5Rgt+6,w5Bas+6,w5Top-6 in w5GridLayer$ END SUB SUB w5KeepGraphLayer BOX KEEP w5Lft-6,w5Rgt+6,w5Bas+6,w5Top-6 in w5GraphLayer$ END SUB SUB w5Clear CALL BoxArea(w5Lft+1,w5Rgt-1,w5Bas-1,w5Top+1,planeclr) END SUB SUB w5PixelsToMath(wx,wy,fx,fy) DECLARE DEF w5Fncx,w5Fncy LET fx= w5Fncx(wx) LET fy= w5Fncy(wy) END SUB SUB w5MathToPixels(fx,fy,wx,wy) DECLARE DEF w5Wndx,w5Wndy LET wx= round(w5Wndx(fx)) LET wy= round(w5Wndy(fy)) END SUB SUB w5wClamp(wx,wy) DECLARE DEF clamp LET wx= clamp(wx,w5Lft,w5Rgt) LET wy= clamp(wy,w5Top,w5Bas) END SUB SUB w5fClamp(fx,fy) DECLARE DEF clamp LET fx= clamp(fx,w5fLft,w5fRgt) LET fy= clamp(fy,w5fTop,w5fBas) END SUB SUB w5Variables DECLARE DEF w5Wndx,w5Wndy CALL WndParams(w5Lft,w5Rgt,w5Bas,w5Top,w5wWid,w5wHgt,w5Midx,w5Midy) CALL FncParams(w5fLft,w5fRgt,w5fBas,w5fTop,w5fWid,w5fHgt,w5fMidx,w5fMidy) CALL PlaneRatios(w5fWid,w5fHgt,w5wWid,w5wHgt,w5fxRatio,w5fyRatio,w5wxRatio,w5wyRatio) LET w5Aspect = (w5wWid/w5fWid)/(w5wHgt/w5fHgt) LET w5x0 = w5wndx(0) LET w5y0 = w5wndy(0) END SUB SUB w5DrawPlane(xFlag,yFlag,zeroFlag) CALL GraphPlane(w5Lft,w5Rgt,w5Bas,w5Top) IF w5xGridstep<>0 then CALL xGrid(w5Lft,w5Rgt,w5Bas,w5Top,w5fLft,w5fRgt,w5xGridstep,gridclr) END IF IF w5yGridstep<>0 then CALL yGrid(w5Lft,w5Rgt,w5Bas,w5Top,w5fBas,w5fTop,w5yGridstep,gridclr) END IF IF yFlag<>0 then ! axis visible? IF w5yPiFlag=1 then ! pi axis? IF yFlag=1 then ! left side of plane CALL EdgesVrtPi(w5Lft,w5Bas,w5Top,w5fBas,w5fTop,w5yFirst,w5ySTik,w5yLTik,w5yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrtPi(w5Rgt,w5Bas,w5Top,w5fBas,w5fTop,w5yFirst,w5ySTik,w5yLTik,w5yLabel, 1) END IF ELSE ! normal scale axis IF yFlag=1 then ! left side of plane CALL EdgesVrt(w5Lft,w5Bas,w5Top,w5fBas,w5fTop,w5yFirst,w5ySTik,w5yLTik,w5yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrt(w5Rgt,w5Bas,w5Top,w5fBas,w5fTop,w5yFirst,w5ySTik,w5yLTik,w5yLabel, 1) END IF END IF END IF IF xFlag<>0 then ! axis visible? IF w5xPiFlag=1 then ! pi axis? IF xFlag=1 then ! bottom of plane CALL EdgesHrzPi(w5Lft,w5Rgt,w5Bas,w5fLft,w5fRgt,w5xFirst,w5xSTik,w5xLTik,w5xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrzPi(w5Lft,w5Rgt,w5Top,w5fLft,w5fRgt,w5xFirst,w5xSTik,w5xLTik,w5xLabel,-1) END IF ELSE ! normal scale axis IF xFlag=1 then ! bottom of plane CALL EdgesHrz(w5Lft,w5Rgt,w5Bas,w5fLft,w5fRgt,w5xFirst,w5xSTik,w5xLTik,w5xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrz(w5Lft,w5Rgt,w5Top,w5fLft,w5fRgt,w5xFirst,w5xSTik,w5xLTik,w5xLabel,-1) END IF END IF END IF IF abs(zeroFlag)= 1 then ! zero axes on? CALL ZeroAxes(w5x0,w5y0,w5Lft,w5Rgt,w5Bas,w5Top,zeroflag,axisclr) END IF END SUB END MODULE MODULE w6GraphPlane DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr PUBLIC w6Lft,w6Rgt,w6Bas,w6Top,w6Midx,w6Midy PUBLIC w6fLft,w6fRgt,w6fBas,w6fTop,w6x0,w6y0 PUBLIC w6xFirst, w6xSTik, w6xLTik, w6xLabel, w6xGridstep PUBLIC w6yFirst, w6ySTik, w6yLTik, w6yLabel, w6yGridstep PUBLIC w6wWid,w6wHgt,w6fWid,w6fHgt PUBLIC w6fxRatio,w6fyRatio,w6wxRatio,w6wyRatio,w6Aspect PUBLIC w6xPiFlag, w6xMult, w6yPiFlag, w6yMult SHARE w6GridLayer$,w6GraphLayer$ DEF w6Fncx(wx)= w6xMult * (w6fLft + w6fxRatio*(wx-w6Lft)) ! window to function DEF w6Fncy(wy)= w6yMult * (w6fBas + w6fyRatio*(w6Bas-wy)) DEF w6wndx(fx)= w6Lft + w6wxRatio * (fx/w6xMult - w6fLft) ! function to window DEF w6wndy(fy)= w6Bas - w6wyRatio * (fy/w6yMult - w6fBas) DEF w6Within(wx,wy) DECLARE DEF WithinWnd LET w6Within= WithinWnd(wx,wy,w6Lft-7,w6Rgt+7,w6Bas+7,w6Top-7) END DEF DEF w6wWithin(wx,wy) DECLARE DEF WithinWnd LET w6wWithin= WithinWnd(wx,wy,w6Lft,w6Rgt,w6Bas,w6Top) END DEF DEF w6fWithin(x,y) DECLARE DEF WithinFnc LET w6fWithin= WithinFnc(x,y,w6fLft,w6fRgt,w6fBas,w6fTop) END DEF SUB w6GetDragValues(mx,my,ms,rx,ry,x,y) DECLARE DEF w6Fncx,w6Fncy GET MOUSE: mx,my,ms LET x = w6Fncx(min(max(mx,w6Lft),w6Rgt)) LET x = round(x,rx) LET y = w6Fncy(min(max(my,w6Top),w6Bas)) LET y = round(y,ry) END SUB SUB w6ShowGridLayer BOX SHOW w6GridLayer$ at w6Lft-6,w6Bas+6 END SUB SUB w6ShowGraphLayer BOX SHOW w6GraphLayer$ at w6Lft-6,w6Bas+6 END SUB SUB w6KeepGridLayer BOX KEEP w6Lft-6,w6Rgt+6,w6Bas+6,w6Top-6 in w6GridLayer$ END SUB SUB w6KeepGraphLayer BOX KEEP w6Lft-6,w6Rgt+6,w6Bas+6,w6Top-6 in w6GraphLayer$ END SUB SUB w6Clear CALL BoxArea(w6Lft+1,w6Rgt-1,w6Bas-1,w6Top+1,planeclr) END SUB SUB w6PixelsToMath(wx,wy,fx,fy) DECLARE DEF w6Fncx,w6Fncy LET fx= w6Fncx(wx) LET fy= w6Fncy(wy) END SUB SUB w6MathToPixels(fx,fy,wx,wy) DECLARE DEF w6Wndx,w6Wndy LET wx= round(w6Wndx(fx)) LET wy= round(w6Wndy(fy)) END SUB SUB w6wClamp(wx,wy) DECLARE DEF clamp LET wx= clamp(wx,w6Lft,w6Rgt) LET wy= clamp(wy,w6Top,w6Bas) END SUB SUB w6fClamp(fx,fy) DECLARE DEF clamp LET fx= clamp(fx,w6fLft,w6fRgt) LET fy= clamp(fy,w6fTop,w6fBas) END SUB SUB w6Variables DECLARE DEF w6Wndx,w6Wndy CALL WndParams(w6Lft,w6Rgt,w6Bas,w6Top,w6wWid,w6wHgt,w6Midx,w6Midy) CALL FncParams(w6fLft,w6fRgt,w6fBas,w6fTop,w6fWid,w6fHgt,w6fMidx,w6fMidy) CALL PlaneRatios(w6fWid,w6fHgt,w6wWid,w6wHgt,w6fxRatio,w6fyRatio,w6wxRatio,w6wyRatio) LET w6Aspect = (w6wWid/w6fWid)/(w6wHgt/w6fHgt) LET w6x0 = w6wndx(0) LET w6y0 = w6wndy(0) END SUB SUB w6DrawPlane(xFlag,yFlag,zeroFlag) CALL GraphPlane(w6Lft,w6Rgt,w6Bas,w6Top) IF w6xGridstep<>0 then CALL xGrid(w6Lft,w6Rgt,w6Bas,w6Top,w6fLft,w6fRgt,w6xGridstep,gridclr) END IF IF w6yGridstep<>0 then CALL yGrid(w6Lft,w6Rgt,w6Bas,w6Top,w6fBas,w6fTop,w6yGridstep,gridclr) END IF IF yFlag<>0 then ! axis visible? IF w6yPiFlag=1 then ! pi axis? IF yFlag=1 then ! left side of plane CALL EdgesVrtPi(w6Lft,w6Bas,w6Top,w6fBas,w6fTop,w6yFirst,w6ySTik,w6yLTik,w6yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrtPi(w6Rgt,w6Bas,w6Top,w6fBas,w6fTop,w6yFirst,w6ySTik,w6yLTik,w6yLabel, 1) END IF ELSE ! normal scale axis IF yFlag=1 then ! left side of plane CALL EdgesVrt(w6Lft,w6Bas,w6Top,w6fBas,w6fTop,w6yFirst,w6ySTik,w6yLTik,w6yLabel,-1) ELSE IF yFlag=-1 then ! right side of plane CALL EdgesVrt(w6Rgt,w6Bas,w6Top,w6fBas,w6fTop,w6yFirst,w6ySTik,w6yLTik,w6yLabel, 1) END IF END IF END IF IF xFlag<>0 then ! axis visible? IF w6xPiFlag=1 then ! pi axis? IF xFlag=1 then ! bottom of plane CALL EdgesHrzPi(w6Lft,w6Rgt,w6Bas,w6fLft,w6fRgt,w6xFirst,w6xSTik,w6xLTik,w6xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrzPi(w6Lft,w6Rgt,w6Top,w6fLft,w6fRgt,w6xFirst,w6xSTik,w6xLTik,w6xLabel,-1) END IF ELSE ! normal scale axis IF xFlag=1 then ! bottom of plane CALL EdgesHrz(w6Lft,w6Rgt,w6Bas,w6fLft,w6fRgt,w6xFirst,w6xSTik,w6xLTik,w6xLabel, 1) ELSE IF xFlag=-1 then ! top of plane CALL EdgesHrz(w6Lft,w6Rgt,w6Top,w6fLft,w6fRgt,w6xFirst,w6xSTik,w6xLTik,w6xLabel,-1) END IF END IF END IF IF abs(zeroFlag)= 1 then ! zero axes on? CALL ZeroAxes(w6x0,w6y0,w6Lft,w6Rgt,w6Bas,w6Top,zeroflag,axisclr) END IF END SUB END MODULE MODULE GraphingPlanes DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr DEF Fncx(wx,wLft,fLft,wxratio)= fLft + fWid/wWid*(wx-wLft) ! window to function DEF Fncy(wy,wBas,fBas,fxratio)= fBas + fHgt/wHgt*(wBas-wy) DEF wndx(fx,wLft,fLft,wyratio)= wLft + wWid/fWid*(fx-fLft) ! function to window DEF wndy(fy,wBas,fBas,fyratio)= wBas - wHgt/fHgt*(fy-fBas) ! ---- graphing plane subs ---- SUB WndParams(wLft,wRgt,wBas,wTop,wWid,wHgt,wMidx,wMidy) LET wWid = wRgt-wLft LET wHgt = wBas-wTop LET wMidy= int((wTop+wBas)/2) LET wMidx= int((wLft+wRgt)/2) END SUB SUB FncParams(fLft,fRgt,fBas,fTop,fWid,fHgt,fMidx,fMidy) LET fWid = fRgt-fLft LET fHgt = fTop-fBas LET fMidx= (fLft+fRgt)/2 LET fMidy= (fTop+fBas)/2 END SUB SUB PlaneRatios(fWid,fHgt,wWid,wHgt,fxratio,fyratio,wxratio,wyratio) LET fxratio= fWid/wWid LET fyratio= fHgt/wHgt LET wxratio= wWid/fWid LET wyratio= wHgt/fHgt END SUB SUB GraphPlane(wLft,wRgt,wBas,wTop) BOX CLEAR wLft-30,wRgt+20,wBas+15,wTop-7 SET COLOR planeclr BOX AREA wLft,wRgt,wBas,wTop SET COLOR rimclr BOX LINES wLft,wRgt,wBas,wTop END SUB SUB GridPlane(wLft,wRgt,wBas,wTop,fLft,fRgt,fBas,fTop,wxratio,wyratio,xstp,ystp,clr) CALL GraphPlane(wLft,wRgt,wBas,wTop) CALL Grid(wLft,wRgt,wBas,wTop,fLft,fRgt,fBas,fTop,xstp,ystp,clr) SET COLOR rimclr BOX LINES wLft,wRgt,wBas,wTop END SUB SUB xGrid(wLft,wRgt,wBas,wTop,fLft,fRgt,xstep,clr) LET wWid= wRgt-wLft LET fWid= fRgt-fLft DEF wndx(fx)= wLft + wWid/fWid*(fx-fLft) ! function to window SET COLOR clr IF xstep>0 then LET lines= abs(int(fWid/xstep)) FOR i= 1 to lines LET n = fLft + i*xstep LET wx= wndx(n) PLOT wx,wTop+1; wx,wBas-1 NEXT i END IF SET COLOR rimclr BOX LINES wLft,wRgt,wBas,wTop END SUB SUB yGrid(wLft,wRgt,wBas,wTop,fBas,fTop,ystep,clr) LET wHgt= wBas-wTop LET fHgt= fTop-fBas DEF wndy(fy)= wBas - wHgt/fHgt*(fy-fBas) SET COLOR clr IF ystep>0 then LET lines= abs(int(fHgt/ystep)) IF fHgt<0 then LET first= fTop else LET first= fBas ! negative half plane? FOR i= 1 to lines LET n = first + i*ystep LET wy= wndy(n) PLOT wLft+1,wy; wRgt-1,wy NEXT i END IF SET COLOR rimclr BOX LINES wLft,wRgt,wBas,wTop END SUB SUB Grid(wLft,wRgt,wBas,wTop,fLft,fRgt,fBas,fTop,xstp,ystp,clr) LET wWid= wRgt-wLft LET fWid= fRgt-fLft LET wHgt= wBas-wTop LET fHgt= fTop-fBas DEF wndx(fx)= wLft + wWid/fWid*(fx-fLft) ! function to window DEF wndy(fy)= wBas - wHgt/fHgt*(fy-fBas) SET COLOR clr IF xstp>0 then LET lines= abs(round(fWid/xstp)) FOR i= 0 to lines LET n = fLft + i*xstp LET wx= wndx(n) PLOT wx,wTop+1; wx,wBas-1 NEXT i END IF IF ystp>0 then LET lines= abs(round(fHgt/ystp)) IF fHgt<0 then LET first= fTop else LET first= fBas FOR i= 0 to lines LET n = first + i*ystp LET wy= wndy(n) PLOT wLft+1,wy; wRgt-1,wy NEXT i END IF SET COLOR rimclr BOX LINES wLft,wRgt,wBas,wTop END SUB SUB ZeroAxes(wx0,wy0,wLft,wRgt,wBas,wTop,dir,aclr) IF wy0>=wTop and wy0<=wBas then SET COLOR aclr PLOT wLft,wy0; wRgt+3,wy0 DRAW arrow3 with rotate(0) * shift(wRgt+3,wy0) END IF IF wx0>=wLft and wx0<=wRgt then SET COLOR aclr IF dir=1 then PLOT wx0,wBas; wx0,wTop-3 DRAW arrow3 with rotate(-pi/2) * shift(wx0,wTop-3) ELSE PLOT wx0,wBas+3; wx0,wTop DRAW arrow3 with rotate(pi/2) * shift(wx0,wBas+3) END IF END IF END SUB SUB EdgesVrt(wAxis,wBas,wTop,fBas,fTop,first,stp1,stp2,nstp,dir) IF dir=-1 then BOX CLEAR wAxis-35,wAxis-5,wBas+4,wTop-4 BOX CLEAR wAxis-4,wAxis,wBas,wTop ELSE IF dir=1 then BOX CLEAR wAxis+5,wAxis+35,wBas+4,wTop-4 BOX CLEAR wAxis,wAxis+4,wBas,wTop END IF CALL VNumberLineTiks(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,dir) CALL VNumberLineLabels(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,dir) END SUB SUB EdgesVrtPi(wAxis,wBas,wTop,fBas,fTop,first,stp1,stp2,nstp,dir) IF dir=-1 then BOX CLEAR wAxis-35,wAxis-5,wBas+4,wTop-4 BOX CLEAR wAxis-4,wAxis,wBas,wTop ELSE IF dir=1 then BOX CLEAR wAxis+5,wAxis+35,wBas+4,wTop-4 BOX CLEAR wAxis,wAxis+4,wBas,wTop END IF CALL VNumberLineTiks(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,dir) CALL VNumberLineLabelsPi(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,dir) END SUB SUB EdgesHrz(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,dir) IF dir=1 then BOX CLEAR wLft,wRgt,wBas+4,wBas+1 BOX CLEAR wLft-15,wRgt+20,wBas+5,wBas+15 ELSE IF dir=-1 then BOX CLEAR wLft,wRgt,wBas-1,wBas-4 BOX CLEAR wLft-15,wRgt+20,wBas-5,wBas-15 END IF CALL HNumberLineTiks(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,dir) CALL HNumberLineLabels(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,dir) END SUB SUB EdgesHrzPi(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,dir) BOX CLEAR wLft,wRgt,wBas+1,wBas+4 BOX CLEAR wLft-15,wRgt+20,wBas+4,wBas+15 CALL HNumberLineTiks(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,dir) CALL HNumberLineLabelsPi(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,dir) END SUB END MODULE MODULE MathGraphs ! general routines that serve both sliders and planes DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr DECLARE DEF roundn DEF WithinWnd(x,y,l,r,b,t) IF x>=l and x<=r and y>=t and y<=b then LET WithinWnd= 1 ELSE LET WithinWnd= 0 END IF END DEF DEF WithinFnc(x,y,l,r,b,t) IF x>=l and x<=r and y<=t and y>=b then LET WithinFnc= 1 ELSE LET WithinFnc= 0 END IF END DEF SUB VNumberLineTiks(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,ndir) LOCAL fy,wHgt,fHgt,ticks,i,n,wy,s,n$,sl,form$,places DEF wndy(fy)= wBas - wHgt/fHgt*(fy-fBas) LET wHgt = wBas-wTop LET fTop = round(fTop,5) LET fBas = round(fBas,5) LET fHgt = round(fTop-fBas,5) LET first= round(first,5) LET stp1 = round(stp1,5) LET stp2 = round(stp2,5) LET nstp = round(nstp,5) SET COLOR numberlineclr IF stp1>0 or stp2>0 or nstp>0 then PLOT wAxis,wBas; wAxis,wTop ! Y boundary axis END IF LET firstn= roundn(fbas,stp1) IF firstn0 then ! short ticks LET hgt = fHgt - abs(fBas-firstn) LET ticks = int(hgt/stp1) FOR i= 0 to ticks LET n = firstn + i*stp1 LET wy= wndy(n) IF ndir=-1 then PLOT wAxis,wy; wAxis-2,wy ELSE IF ndir=1 then PLOT wAxis,wy; wAxis+2,wy END IF NEXT i END IF LET firstn= roundn(fbas,stp2) IF firstn0 then ! long ticks LET hgt = fHgt - abs(fBas-firstn) LET ticks = int(hgt/stp2) FOR i= 0 to ticks LET n = firstn + i*stp2 LET wy= wndy(n) IF ndir=-1 then PLOT wAxis,wy; wAxis-4,wy ELSE IF ndir=1 then PLOT wAxis,wy; wAxis+4,wy END IF NEXT i END IF END SUB SUB VNumberLineLabels(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,ndir) LOCAL fx,wHgt,fHgt,ticks,i,n,wy,s,n$,sl,form$,places DEF wndy(fy)= wBas - wHgt/fHgt*(fy-fBas) LET wHgt = wBas-wTop LET fTop = round(fTop,5) LET fBas = round(fBas,5) LET fHgt = round(fTop-fBas,5) LET first= round(first,5) LET stp1 = round(stp1,5) LET stp2 = round(stp2,5) LET nstp = round(nstp,5) IF ndir=-1 then IF stp1=0 and stp2=0 then LET rgtln= wAxis-3 ELSE LET rgtln= wAxis-6 END IF ELSE IF ndir=1 then IF stp1=0 and stp2=0 then LET rgtln= wAxis+7 ELSE LET rgtln= wAxis+11 END IF END IF SET COLOR numberlineclr IF stp1>0 or stp2>0 then PLOT wAxis,wBas; wAxis,wTop ! Y boundary axis END IF IF nstp>0 then ! labels IF int(nstp)= nstp then ! build format LET form$= "------#" ELSE CALL DecimalPlaces(nstp,places) LET form$ = "--%." & repeat$("#",places) END IF CALL SetTextFont(1,9,"normal") LET first= roundn(fbas,nstp) !IF fbas<0 then IF first0 or stp2>0 then PLOT wAxis,wBas; wAxis,wTop ! Y boundary axis END IF IF nstp>0 then ! labels LET in= int(nstp) IF in<>nstp then LET frac = nstp-in LET frac$ = str$(frac) LET places= len(frac$) - 1 LET form$ = "--%." & repeat$("#",places) ELSE LET form$ = "----%" END IF ! IF int(nstp)= nstp then ! build format ! LET form$= "------#" ! ELSE ! LET places= abs(int(log10(nstp))) ! LET form$ = "--%." & repeat$("#",places) ! END IF CALL SetTextFont(1,9,"normal") LET hgt = fHgt - abs(fBas-first) LET ticks= int(hgt/nstp) FOR i= 0 to ticks LET n = first + i*nstp LET n = round(n,5) LET wy = wndy(n) LET abn= abs(n) LET s = sgn(n) CALL SetTextFont(1,9,"normal") SELECT CASE abn CASE 0 LET n$= "0" !CALL SetTextFont(1,9,"bold") CASE 0.5 LET n$= pi$ & "/2" CASE 1 LET n$= pi$ CASE 1.5 LET n$= "3" & pi$ & "/2" CASE 2.5 LET n$= "5" & pi$ & "/2" CASE 3.5 LET n$= "7" & pi$ & "/2" CASE 2,3,4,5,6,7,8,9,10,11,12 LET n$= trim$(str$(abn)) & pi$ CASE else END SELECT CALL StringWidth(n$,sl) LET left= rgtln - sl LET p= pos(n$,pi$) LET l= len(n$) LET basln= wy+3 IF p=0 then CALL PlotTextRJ(rgtln,basln,n$,numberlineclr) ELSE IF p=1 then LET n$= n$(2:l) DRAW pi9 with shift(left,basln) CALL PlotTextRJ(rgtln,basln,n$,numberlineclr) ELSE IF p=l then LET n$= n$(1:l-1) CALL PlotTextLJ(left,basln,n$,numberlineclr) CALL StringWidth(n$,sw) DRAW pi9 with shift(left+sw,basln) ELSE LET Lft$= n$(1:p-1) LET Rgt$= n$(p+1:l) CALL PlotTextLJ(left,basln,Lft$,numberlineclr) CALL StringWidth(Lft$,sw) DRAW pi9 with shift(left+sw,basln) CALL PlotTextLJ(left+sw+8,basln,Rgt$,numberlineclr) END IF IF s=-1 then CALL PlotTextRJ(left-1,basln,"-",numberlineclr) NEXT i END IF END SUB SUB HNumberLineTiks(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,ndir) LOCAL wWid,fWid,ticks,i,n,wx DEF wndx(fx)= wLft + wWid/fWid*(fx-fLft) ! function to window LET wWid= wRgt-wLft LET fWid= fRgt-fLft SET COLOR numberlineclr IF stp1<>0 or stp2<>0 or nstp>0 then PLOT wLft,wBas; wRgt,wBas ! axis line if ticks are on END IF IF stp1>0 then ! short ticks LET firstn= roundn(fLft,stp1) !IF flft<0 then IF firstn0 then ! long ticks LET firstn= roundn(fLft,stp2) !IF flft<0 then IF firstn0 or stp2<>0 then PLOT wLft,wBas; wRgt,wBas ! axis line if ticks are on END IF IF nstp>0 then ! labels LET in= int(nstp) IF in<>nstp then LET frac = nstp-in LET frac$ = str$(frac) LET places= len(frac$) - 1 LET form$ = "---%." & repeat$("#",places) ELSE LET form$ = "------%" END IF ! IF int(nstp)= nstp then ! build format ! LET form$ = "----#" ! ELSE ! LET places= abs(int(log10(nstp))) ! LET form$ = "--%.#" & repeat$("#",places) ! !LET form$ = "-%.#" ! END IF CALL SetTextFont(1,9,"normal") !IF fLft<0 then IF first0 or stp2<>0 then PLOT wLft,wBas; wRgt,wBas ! axis line if ticks are on END IF IF nstp>0 then ! labels IF int(nstp)= nstp then ! build format LET form$ = "----#" ELSE LET places= abs(int(log10(nstp))) LET form$ = "--%." & repeat$("#",places) END IF CALL SetTextFont(1,9,"normal") LET wid = fWid - abs(fLft-first) LET ticks= int(wid/nstp) FOR i= 0 to ticks LET n = first + i*nstp LET n = round(n,5) ! FOR n= fLft to fRgt step nstp ! LET n = round(n,5) LET wx = wndx(n) LET abn= abs(n) LET s = sgn(n) CALL SetTextFont(1,9,"normal") SELECT CASE abn CASE 0 LET n$= "0" !CALL SetTextFont(1,9,"bold") CASE 0.25 LET n$= pi$ & "/4" CASE 0.5 LET n$= pi$ & "/2" CASE 0.75 LET n$= "3" & pi$ & "/4" CASE 1 LET n$= pi$ CASE 1.5 LET n$= "3" & pi$ & "/2" CASE 2.5 LET n$= "5" & pi$ & "/2" CASE 3.5 LET n$= "7" & pi$ & "/2" CASE else LET n$= trim$(str$(abn)) & pi$ !CASE else END SELECT CALL StringWidth(n$,sl) LET left= wx - sl/2 + 1 LET p= pos(n$,pi$) LET l= len(n$) IF p=0 then CALL PlotTextLJ(left,basln,n$,numberlineclr) ELSE IF p=1 then LET n$= n$(2:l) DRAW pi9 with shift(left,basln) CALL PlotTextLJ(left+8,basln,n$,numberlineclr) ELSE IF p=l then LET n$= n$(1:l-1) CALL PlotTextLJ(left,basln,n$,numberlineclr) CALL StringWidth(n$,sw) DRAW pi9 with shift(left+sw,basln) ELSE LET Lft$= n$(1:p-1) LET Rgt$= n$(p+1:l) CALL PlotTextLJ(left,basln,Lft$,numberlineclr) CALL StringWidth(Lft$,sw) DRAW pi9 with shift(left+sw,basln) CALL PlotTextLJ(left+sw+8,basln,Rgt$,numberlineclr) END IF IF s=-1 then CALL PlotTextRJ(left-1,basln,"-",numberlineclr) NEXT i END IF END SUB END MODULE ! ----- library slider subs MODULE v0slider PUBLIC v0axis,v0wLft,v0wRgt,v0wBas,v0wTop,v0wHgt,v0sBas,v0sTop PUBLIC v0fBas,v0fTop,v0fHgt,v0First,v0STik,v0LTik,v0Label PUBLIC v0fRatio,v0wRatio,v0name$,v0form$,v0clr,v0slot$ PUBLIC v0PiAxis,v0Mult DEF v0Fncy(wy)= v0Mult * (v0fBas + v0fRatio*(v0wBas-wy)) ! window to function DEF v0Wndy(fy)= v0wBas - v0wRatio*(fy/v0Mult-v0fBas) ! function to window DEF v0Within(wx,wy) IF wx>=v0wLft and wx<=v0wRgt and wy>=v0sTop and wy<=v0sBas then LET v0Within= 1 ELSE LET v0Within= 0 END IF END DEF SUB v0wClampfVal(wy,fy) DECLARE DEF clamp,v0Fncy LET wy= clamp(wy,v0wTop,v0wBas) LET fy= v0Fncy(wy) END SUB SUB v0GetClickVal(ms,rn,n) DECLARE DEF v0Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v0Fncy(min(max(my,v0wTop),v0wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v0Mark(n) END SUB SUB v0GetDragVal(ms,r,n) DECLARE DEF v0Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v0Fncy(min(max(my,v0wTop),v0wBas)) LET n = round(n,r) IF oldn<>n then CALL v0Mark(n) END SUB SUB v0SliderVariables CALL vWnd(v0axis,v0wLft,v0wRgt,v0wBas,v0wTop,v0wHgt,v0sBas,v0sTop) CALL vFnc(v0fBas,v0fTop,v0fHgt) CALL vRatios(v0fHgt,v0wHgt,v0fRatio,v0wRatio) END SUB SUB v0DrawSlider(v0name$,n) CALL v0ClearSlider CALL SliderSlotV(v0wBas,v0wTop,v0axis) IF v0PiAxis=0 then CALL SliderAxisVrt(v0wBas,v0wTop,v0axis,v0fBas,v0fTop,v0first,v0STik,v0LTik,v0Label) ELSE CALL SliderAxisVrtPi(v0wBas,v0wTop,v0axis,v0fBas,v0fTop,v0first,v0STik,v0LTik,v0Label) END IF BOX KEEP v0axis,v0wRgt,v0sBas,v0sTop in v0slot$ CALL PlotVSliderName(v0axis,v0wBas,v0name$,v0clr) CALL v0Mark(n) END SUB SUB v0Mark(n) DECLARE DEF v0Wndy LET wy= v0Wndy(n) ! v0wBas - v0wRatio*(n-v0fBas) BOX SHOW v0slot$ at v0axis,v0sBas CALL SliderKnobV(v0wRgt-5,wy) LET n$= using$(v0form$,n*v0Mult) CALL PlotVSliderValue(v0axis,v0wTop-5,n$,v0Form$,v0clr) END SUB SUB v0ClearSlider CALL StringWidth(v0Name$,lw) CALL StringWidth(v0Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v0wLft+v0wRgt)/2) LET lft = min(v0wlft,midx-h) LET rgt = max(v0wrgt,midx+h) BOX CLEAR lft,rgt,v0wBas+15,v0wTop-20 END SUB END MODULE MODULE v1slider PUBLIC v1axis,v1wLft,v1wRgt,v1wBas,v1wTop,v1wHgt,v1sBas,v1sTop PUBLIC v1fBas,v1fTop,v1fHgt,v1First,v1STik,v1LTik,v1Label PUBLIC v1fRatio,v1wRatio,v1name$,v1form$,v1clr,v1slot$ PUBLIC v1PiAxis,v1Mult DEF v1Fncy(wy)= v1Mult * (v1fBas + v1fRatio*(v1wBas-wy)) ! window to function DEF v1Wndy(fy)= v1wBas - v1wRatio*(fy/v1Mult-v1fBas) ! function to window DEF v1Within(wx,wy) IF wx>=v1wLft and wx<=v1wRgt and wy>=v1sTop and wy<=v1sBas then LET v1Within= 1 ELSE LET v1Within= 0 END IF END DEF SUB v1wClampfVal(wy,fy) DECLARE DEF clamp,v1Fncy LET wy= clamp(wy,v1wTop,v1wBas) LET fy= v1Fncy(wy) END SUB SUB v1GetClickVal(ms,rn,n) DECLARE DEF v1Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v1Fncy(min(max(my,v1wTop),v1wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v1Mark(n) END SUB SUB v1GetDragVal(ms,r,n) DECLARE DEF v1Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v1Fncy(min(max(my,v1wTop),v1wBas)) LET n = round(n,r) IF oldn<>n then CALL v1Mark(n) END SUB SUB v1SliderVariables CALL vWnd(v1axis,v1wLft,v1wRgt,v1wBas,v1wTop,v1wHgt,v1sBas,v1sTop) CALL vFnc(v1fBas,v1fTop,v1fHgt) CALL vRatios(v1fHgt,v1wHgt,v1fRatio,v1wRatio) END SUB SUB v1DrawSlider(v1name$,n) CALL v1ClearSlider CALL SliderSlotV(v1wBas,v1wTop,v1axis) IF v1PiAxis=0 then CALL SliderAxisVrt(v1wBas,v1wTop,v1axis,v1fBas,v1fTop,v1first,v1STik,v1LTik,v1Label) ELSE CALL SliderAxisVrtPi(v1wBas,v1wTop,v1axis,v1fBas,v1fTop,v1first,v1STik,v1LTik,v1Label) END IF BOX KEEP v1axis,v1wRgt,v1sBas,v1sTop in v1slot$ CALL PlotVSliderName(v1axis,v1wBas,v1name$,v1clr) CALL v1Mark(n) END SUB SUB v1Mark(n) DECLARE DEF v1Wndy LET wy= v1Wndy(n) ! v1wBas - v1wRatio*(n-v1fBas) BOX SHOW v1slot$ at v1axis,v1sBas CALL SliderKnobV(v1wRgt-5,wy) LET n$= using$(v1form$,n*v1Mult) CALL PlotVSliderValue(v1axis,v1wTop-5,n$,v1Form$,v1clr) END SUB SUB v1ClearSlider CALL StringWidth(v1Name$,lw) CALL StringWidth(v1Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v1wLft+v1wRgt)/2) LET lft = min(v1wlft,midx-h) LET rgt = max(v1wrgt,midx+h) BOX CLEAR lft,rgt,v1wBas+15,v1wTop-20 END SUB END MODULE MODULE v2slider PUBLIC v2axis,v2wLft,v2wRgt,v2wBas,v2wTop,v2wHgt,v2sBas,v2sTop PUBLIC v2fBas,v2fTop,v2fHgt,v2First,v2STik,v2LTik,v2Label PUBLIC v2fRatio,v2wRatio,v2name$,v2form$,v2clr,v2slot$ PUBLIC v2PiAxis,v2Mult DEF v2Fncy(wy)= v2Mult * (v2fBas + v2fRatio*(v2wBas-wy)) ! window to function DEF v2Wndy(fy)= v2wBas - v2wRatio*(fy/v2Mult-v2fBas) ! function to window DEF v2Within(wx,wy) IF wx>=v2wLft and wx<=v2wRgt and wy>=v2sTop and wy<=v2sBas then LET v2Within= 1 ELSE LET v2Within= 0 END IF END DEF SUB v2wClampfVal(wy,fy) DECLARE DEF clamp,v2Fncy LET wy= clamp(wy,v2wTop,v2wBas) LET fy= v2Fncy(wy) END SUB SUB v2GetClickVal(ms,rn,n) DECLARE DEF v2Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v2Fncy(min(max(my,v2wTop),v2wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v2Mark(n) END SUB SUB v2GetDragVal(ms,r,n) DECLARE DEF v2Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v2Fncy(min(max(my,v2wTop),v2wBas)) LET n = round(n,r) IF oldn<>n then CALL v2Mark(n) END SUB SUB v2SliderVariables CALL vWnd(v2axis,v2wLft,v2wRgt,v2wBas,v2wTop,v2wHgt,v2sBas,v2sTop) CALL vFnc(v2fBas,v2fTop,v2fHgt) CALL vRatios(v2fHgt,v2wHgt,v2fRatio,v2wRatio) END SUB SUB v2DrawSlider(v2name$,n) CALL v2ClearSlider CALL SliderSlotV(v2wBas,v2wTop,v2axis) IF v2PiAxis=0 then CALL SliderAxisVrt(v2wBas,v2wTop,v2axis,v2fBas,v2fTop,v2first,v2STik,v2LTik,v2Label) ELSE CALL SliderAxisVrtPi(v2wBas,v2wTop,v2axis,v2fBas,v2fTop,v2first,v2STik,v2LTik,v2Label) END IF BOX KEEP v2axis,v2wRgt,v2sBas,v2sTop in v2slot$ CALL PlotVSliderName(v2axis,v2wBas,v2name$,v2clr) CALL v2Mark(n) END SUB SUB v2Mark(n) DECLARE DEF v2Wndy LET wy= v2Wndy(n) ! v2wBas - v2wRatio*(n-v2fBas) BOX SHOW v2slot$ at v2axis,v2sBas CALL SliderKnobV(v2wRgt-5,wy) LET n$= using$(v2form$,n*v2Mult) CALL PlotVSliderValue(v2axis,v2wTop-5,n$,v2Form$,v2clr) END SUB SUB v2ClearSlider CALL StringWidth(v2Name$,lw) CALL StringWidth(v2Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v2wLft+v2wRgt)/2) LET lft = min(v2wlft,midx-h) LET rgt = max(v2wrgt,midx+h) BOX CLEAR lft,rgt,v2wBas+15,v2wTop-20 END SUB END MODULE MODULE v3slider PUBLIC v3axis,v3wLft,v3wRgt,v3wBas,v3wTop,v3wHgt,v3sBas,v3sTop PUBLIC v3fBas,v3fTop,v3fHgt,v3First,v3STik,v3LTik,v3Label PUBLIC v3fRatio,v3wRatio,v3name$,v3form$,v3clr,v3slot$ PUBLIC v3PiAxis,v3Mult DEF v3Fncy(wy)= v3Mult * (v3fBas + v3fRatio*(v3wBas-wy)) ! window to function DEF v3Wndy(fy)= v3wBas - v3wRatio*(fy/v3Mult-v3fBas) ! function to window DEF v3Within(wx,wy) IF wx>=v3wLft and wx<=v3wRgt and wy>=v3sTop and wy<=v3sBas then LET v3Within= 1 ELSE LET v3Within= 0 END IF END DEF SUB v3wClampfVal(wy,fy) DECLARE DEF clamp,v3Fncy LET wy= clamp(wy,v3wTop,v3wBas) LET fy= v3Fncy(wy) END SUB SUB v3GetClickVal(ms,rn,n) DECLARE DEF v3Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v3Fncy(min(max(my,v3wTop),v3wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v3Mark(n) END SUB SUB v3GetDragVal(ms,r,n) DECLARE DEF v3Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v3Fncy(min(max(my,v3wTop),v3wBas)) LET n = round(n,r) IF oldn<>n then CALL v3Mark(n) END SUB SUB v3SliderVariables CALL vWnd(v3axis,v3wLft,v3wRgt,v3wBas,v3wTop,v3wHgt,v3sBas,v3sTop) CALL vFnc(v3fBas,v3fTop,v3fHgt) CALL vRatios(v3fHgt,v3wHgt,v3fRatio,v3wRatio) END SUB SUB v3DrawSlider(v3name$,n) CALL v3ClearSlider CALL SliderSlotV(v3wBas,v3wTop,v3axis) IF v3PiAxis=0 then CALL SliderAxisVrt(v3wBas,v3wTop,v3axis,v3fBas,v3fTop,v3first,v3STik,v3LTik,v3Label) ELSE CALL SliderAxisVrtPi(v3wBas,v3wTop,v3axis,v3fBas,v3fTop,v3first,v3STik,v3LTik,v3Label) END IF BOX KEEP v3axis,v3wRgt,v3sBas,v3sTop in v3slot$ CALL PlotVSliderName(v3axis,v3wBas,v3name$,v3clr) CALL v3Mark(n) END SUB SUB v3Mark(n) DECLARE DEF v3Wndy LET wy= v3Wndy(n) ! v3wBas - v3wRatio*(n-v3fBas) BOX SHOW v3slot$ at v3axis,v3sBas CALL SliderKnobV(v3wRgt-5,wy) LET n$= using$(v3form$,n*v3Mult) CALL PlotVSliderValue(v3axis,v3wTop-5,n$,v3Form$,v3clr) END SUB SUB v3ClearSlider CALL StringWidth(v3Name$,lw) CALL StringWidth(v3Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v3wLft+v3wRgt)/2) LET lft = min(v3wlft,midx-h) LET rgt = max(v3wrgt,midx+h) BOX CLEAR lft,rgt,v3wBas+15,v3wTop-20 END SUB END MODULE MODULE v4slider PUBLIC v4axis,v4wLft,v4wRgt,v4wBas,v4wTop,v4wHgt,v4sBas,v4sTop PUBLIC v4fBas,v4fTop,v4fHgt,v4First,v4STik,v4LTik,v4Label PUBLIC v4fRatio,v4wRatio,v4name$,v4form$,v4clr,v4slot$ PUBLIC v4PiAxis,v4Mult DEF v4Fncy(wy)= v4Mult * (v4fBas + v4fRatio*(v4wBas-wy)) ! window to function DEF v4Wndy(fy)= v4wBas - v4wRatio*(fy/v4Mult-v4fBas) ! function to window DEF v4Within(wx,wy) IF wx>=v4wLft and wx<=v4wRgt and wy>=v4sTop and wy<=v4sBas then LET v4Within= 1 ELSE LET v4Within= 0 END IF END DEF SUB v4wClampfVal(wy,fy) DECLARE DEF clamp,v4Fncy LET wy= clamp(wy,v4wTop,v4wBas) LET fy= v4Fncy(wy) END SUB SUB v4GetClickVal(ms,rn,n) DECLARE DEF v4Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v4Fncy(min(max(my,v4wTop),v4wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v4Mark(n) END SUB SUB v4GetDragVal(ms,r,n) DECLARE DEF v4Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v4Fncy(min(max(my,v4wTop),v4wBas)) LET n = round(n,r) IF oldn<>n then CALL v4Mark(n) END SUB SUB v4SliderVariables CALL vWnd(v4axis,v4wLft,v4wRgt,v4wBas,v4wTop,v4wHgt,v4sBas,v4sTop) CALL vFnc(v4fBas,v4fTop,v4fHgt) CALL vRatios(v4fHgt,v4wHgt,v4fRatio,v4wRatio) END SUB SUB v4DrawSlider(v4name$,n) CALL v4ClearSlider CALL SliderSlotV(v4wBas,v4wTop,v4axis) IF v4PiAxis=0 then CALL SliderAxisVrt(v4wBas,v4wTop,v4axis,v4fBas,v4fTop,v4first,v4STik,v4LTik,v4Label) ELSE CALL SliderAxisVrtPi(v4wBas,v4wTop,v4axis,v4fBas,v4fTop,v4first,v4STik,v4LTik,v4Label) END IF BOX KEEP v4axis,v4wRgt,v4sBas,v4sTop in v4slot$ CALL PlotVSliderName(v4axis,v4wBas,v4name$,v4clr) CALL v4Mark(n) END SUB SUB v4Mark(n) DECLARE DEF v4Wndy LET wy= v4Wndy(n) ! v4wBas - v4wRatio*(n-v4fBas) BOX SHOW v4slot$ at v4axis,v4sBas CALL SliderKnobV(v4wRgt-5,wy) LET n$= using$(v4form$,n*v4Mult) CALL PlotVSliderValue(v4axis,v4wTop-5,n$,v4Form$,v4clr) END SUB SUB v4ClearSlider CALL StringWidth(v4Name$,lw) CALL StringWidth(v4Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v4wLft+v4wRgt)/2) LET lft = min(v4wlft,midx-h) LET rgt = max(v4wrgt,midx+h) BOX CLEAR lft,rgt,v4wBas+15,v4wTop-20 END SUB END MODULE MODULE v5slider PUBLIC v5axis,v5wLft,v5wRgt,v5wBas,v5wTop,v5wHgt,v5sBas,v5sTop PUBLIC v5fBas,v5fTop,v5fHgt,v5First,v5STik,v5LTik,v5Label PUBLIC v5fRatio,v5wRatio,v5name$,v5form$,v5clr,v5slot$ PUBLIC v5PiAxis,v5Mult DEF v5Fncy(wy)= v5Mult * (v5fBas + v5fRatio*(v5wBas-wy)) ! window to function DEF v5Wndy(fy)= v5wBas - v5wRatio*(fy/v5Mult-v5fBas) ! function to window DEF v5Within(wx,wy) IF wx>=v5wLft and wx<=v5wRgt and wy>=v5sTop and wy<=v5sBas then LET v5Within= 1 ELSE LET v5Within= 0 END IF END DEF SUB v5wClampfVal(wy,fy) DECLARE DEF clamp,v5Fncy LET wy= clamp(wy,v5wTop,v5wBas) LET fy= v5Fncy(wy) END SUB SUB v5GetClickVal(ms,rn,n) DECLARE DEF v5Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v5Fncy(min(max(my,v5wTop),v5wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v5Mark(n) END SUB SUB v5GetDragVal(ms,r,n) DECLARE DEF v5Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v5Fncy(min(max(my,v5wTop),v5wBas)) LET n = round(n,r) IF oldn<>n then CALL v5Mark(n) END SUB SUB v5SliderVariables CALL vWnd(v5axis,v5wLft,v5wRgt,v5wBas,v5wTop,v5wHgt,v5sBas,v5sTop) CALL vFnc(v5fBas,v5fTop,v5fHgt) CALL vRatios(v5fHgt,v5wHgt,v5fRatio,v5wRatio) END SUB SUB v5DrawSlider(v5name$,n) CALL v5ClearSlider CALL SliderSlotV(v5wBas,v5wTop,v5axis) IF v5PiAxis=0 then CALL SliderAxisVrt(v5wBas,v5wTop,v5axis,v5fBas,v5fTop,v5first,v5STik,v5LTik,v5Label) ELSE CALL SliderAxisVrtPi(v5wBas,v5wTop,v5axis,v5fBas,v5fTop,v5first,v5STik,v5LTik,v5Label) END IF BOX KEEP v5axis,v5wRgt,v5sBas,v5sTop in v5slot$ CALL PlotVSliderName(v5axis,v5wBas,v5name$,v5clr) CALL v5Mark(n) END SUB SUB v5Mark(n) DECLARE DEF v5Wndy LET wy= v5Wndy(n) ! v5wBas - v5wRatio*(n-v5fBas) BOX SHOW v5slot$ at v5axis,v5sBas CALL SliderKnobV(v5wRgt-5,wy) LET n$= using$(v5form$,n*v5Mult) CALL PlotVSliderValue(v5axis,v5wTop-5,n$,v5Form$,v5clr) END SUB SUB v5ClearSlider CALL StringWidth(v5Name$,lw) CALL StringWidth(v5Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v5wLft+v5wRgt)/2) LET lft = min(v5wlft,midx-h) LET rgt = max(v5wrgt,midx+h) BOX CLEAR lft,rgt,v5wBas+15,v5wTop-20 END SUB END MODULE MODULE v6slider PUBLIC v6axis,v6wLft,v6wRgt,v6wBas,v6wTop,v6wHgt,v6sBas,v6sTop PUBLIC v6fBas,v6fTop,v6fHgt,v6First,v6STik,v6LTik,v6Label PUBLIC v6fRatio,v6wRatio,v6name$,v6form$,v6clr,v6slot$ PUBLIC v6PiAxis,v6Mult DEF v6Fncy(wy)= v6Mult * (v6fBas + v6fRatio*(v6wBas-wy)) ! window to function DEF v6Wndy(fy)= v6wBas - v6wRatio*(fy/v6Mult-v6fBas) ! function to window DEF v6Within(wx,wy) IF wx>=v6wLft and wx<=v6wRgt and wy>=v6sTop and wy<=v6sBas then LET v6Within= 1 ELSE LET v6Within= 0 END IF END DEF SUB v6wClampfVal(wy,fy) DECLARE DEF clamp,v6Fncy LET wy= clamp(wy,v6wTop,v6wBas) LET fy= v6Fncy(wy) END SUB SUB v6GetClickVal(ms,rn,n) DECLARE DEF v6Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v6Fncy(min(max(my,v6wTop),v6wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v6Mark(n) END SUB SUB v6GetDragVal(ms,r,n) DECLARE DEF v6Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v6Fncy(min(max(my,v6wTop),v6wBas)) LET n = round(n,r) IF oldn<>n then CALL v6Mark(n) END SUB SUB v6SliderVariables CALL vWnd(v6axis,v6wLft,v6wRgt,v6wBas,v6wTop,v6wHgt,v6sBas,v6sTop) CALL vFnc(v6fBas,v6fTop,v6fHgt) CALL vRatios(v6fHgt,v6wHgt,v6fRatio,v6wRatio) END SUB SUB v6DrawSlider(v6name$,n) CALL v6ClearSlider CALL SliderSlotV(v6wBas,v6wTop,v6axis) IF v6PiAxis=0 then CALL SliderAxisVrt(v6wBas,v6wTop,v6axis,v6fBas,v6fTop,v6first,v6STik,v6LTik,v6Label) ELSE CALL SliderAxisVrtPi(v6wBas,v6wTop,v6axis,v6fBas,v6fTop,v6first,v6STik,v6LTik,v6Label) END IF BOX KEEP v6axis,v6wRgt,v6sBas,v6sTop in v6slot$ CALL PlotVSliderName(v6axis,v6wBas,v6name$,v6clr) CALL v6Mark(n) END SUB SUB v6Mark(n) DECLARE DEF v6Wndy LET wy= v6Wndy(n) ! v6wBas - v6wRatio*(n-v6fBas) BOX SHOW v6slot$ at v6axis,v6sBas CALL SliderKnobV(v6wRgt-5,wy) LET n$= using$(v6form$,n*v6Mult) CALL PlotVSliderValue(v6axis,v6wTop-5,n$,v6Form$,v6clr) END SUB SUB v6ClearSlider CALL StringWidth(v6Name$,lw) CALL StringWidth(v6Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v6wLft+v6wRgt)/2) LET lft = min(v6wlft,midx-h) LET rgt = max(v6wrgt,midx+h) BOX CLEAR lft,rgt,v6wBas+15,v6wTop-20 END SUB END MODULE MODULE v7slider PUBLIC v7axis,v7wLft,v7wRgt,v7wBas,v7wTop,v7wHgt,v7sBas,v7sTop PUBLIC v7fBas,v7fTop,v7fHgt,v7First,v7STik,v7LTik,v7Label PUBLIC v7fRatio,v7wRatio,v7name$,v7form$,v7clr,v7slot$ PUBLIC v7PiAxis,v7Mult DEF v7Fncy(wy)= v7Mult * (v7fBas + v7fRatio*(v7wBas-wy)) ! window to function DEF v7Wndy(fy)= v7wBas - v7wRatio*(fy/v7Mult-v7fBas) ! function to window DEF v7Within(wx,wy) IF wx>=v7wLft and wx<=v7wRgt and wy>=v7sTop and wy<=v7sBas then LET v7Within= 1 ELSE LET v7Within= 0 END IF END DEF SUB v7wClampfVal(wy,fy) DECLARE DEF clamp,v7Fncy LET wy= clamp(wy,v7wTop,v7wBas) LET fy= v7Fncy(wy) END SUB SUB v7GetClickVal(ms,rn,n) DECLARE DEF v7Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v7Fncy(min(max(my,v7wTop),v7wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v7Mark(n) END SUB SUB v7GetDragVal(ms,r,n) DECLARE DEF v7Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v7Fncy(min(max(my,v7wTop),v7wBas)) LET n = round(n,r) IF oldn<>n then CALL v7Mark(n) END SUB SUB v7SliderVariables CALL vWnd(v7axis,v7wLft,v7wRgt,v7wBas,v7wTop,v7wHgt,v7sBas,v7sTop) CALL vFnc(v7fBas,v7fTop,v7fHgt) CALL vRatios(v7fHgt,v7wHgt,v7fRatio,v7wRatio) END SUB SUB v7DrawSlider(v7name$,n) CALL v7ClearSlider CALL SliderSlotV(v7wBas,v7wTop,v7axis) IF v7PiAxis=0 then CALL SliderAxisVrt(v7wBas,v7wTop,v7axis,v7fBas,v7fTop,v7first,v7STik,v7LTik,v7Label) ELSE CALL SliderAxisVrtPi(v7wBas,v7wTop,v7axis,v7fBas,v7fTop,v7first,v7STik,v7LTik,v7Label) END IF BOX KEEP v7axis,v7wRgt,v7sBas,v7sTop in v7slot$ CALL PlotVSliderName(v7axis,v7wBas,v7name$,v7clr) CALL v7Mark(n) END SUB SUB v7Mark(n) DECLARE DEF v7Wndy LET wy= v7Wndy(n) ! v7wBas - v7wRatio*(n-v7fBas) BOX SHOW v7slot$ at v7axis,v7sBas CALL SliderKnobV(v7wRgt-5,wy) LET n$= using$(v7form$,n*v7Mult) CALL PlotVSliderValue(v7axis,v7wTop-5,n$,v7Form$,v7clr) END SUB SUB v7ClearSlider CALL StringWidth(v7Name$,lw) CALL StringWidth(v7Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v7wLft+v7wRgt)/2) LET lft = min(v7wlft,midx-h) LET rgt = max(v7wrgt,midx+h) BOX CLEAR lft,rgt,v7wBas+15,v7wTop-20 END SUB END MODULE MODULE v8slider PUBLIC v8axis,v8wLft,v8wRgt,v8wBas,v8wTop,v8wHgt,v8sBas,v8sTop PUBLIC v8fBas,v8fTop,v8fHgt,v8First,v8STik,v8LTik,v8Label PUBLIC v8fRatio,v8wRatio,v8name$,v8form$,v8clr,v8slot$ PUBLIC v8PiAxis,v8Mult DEF v8Fncy(wy)= v8Mult * (v8fBas + v8fRatio*(v8wBas-wy)) ! window to function DEF v8Wndy(fy)= v8wBas - v8wRatio*(fy/v8Mult-v8fBas) ! function to window DEF v8Within(wx,wy) IF wx>=v8wLft and wx<=v8wRgt and wy>=v8sTop and wy<=v8sBas then LET v8Within= 1 ELSE LET v8Within= 0 END IF END DEF SUB v8wClampfVal(wy,fy) DECLARE DEF clamp,v8Fncy LET wy= clamp(wy,v8wTop,v8wBas) LET fy= v8Fncy(wy) END SUB SUB v8GetClickVal(ms,rn,n) DECLARE DEF v8Fncy CALL MouseUp(mx,my,ms) LET oldn= n LET n= v8Fncy(min(max(my,v8wTop),v8wBas)) LET n= rn*round(n/rn) IF oldn<>n then CALL v8Mark(n) END SUB SUB v8GetDragVal(ms,r,n) DECLARE DEF v8Fncy GET MOUSE: mx,my,ms LET oldn= n LET n = v8Fncy(min(max(my,v8wTop),v8wBas)) LET n = round(n,r) IF oldn<>n then CALL v8Mark(n) END SUB SUB v8SliderVariables CALL vWnd(v8axis,v8wLft,v8wRgt,v8wBas,v8wTop,v8wHgt,v8sBas,v8sTop) CALL vFnc(v8fBas,v8fTop,v8fHgt) CALL vRatios(v8fHgt,v8wHgt,v8fRatio,v8wRatio) END SUB SUB v8DrawSlider(v8name$,n) CALL v8ClearSlider CALL SliderSlotV(v8wBas,v8wTop,v8axis) IF v8PiAxis=0 then CALL SliderAxisVrt(v8wBas,v8wTop,v8axis,v8fBas,v8fTop,v8first,v8STik,v8LTik,v8Label) ELSE CALL SliderAxisVrtPi(v8wBas,v8wTop,v8axis,v8fBas,v8fTop,v8first,v8STik,v8LTik,v8Label) END IF BOX KEEP v8axis,v8wRgt,v8sBas,v8sTop in v8slot$ CALL PlotVSliderName(v8axis,v8wBas,v8name$,v8clr) CALL v8Mark(n) END SUB SUB v8Mark(n) DECLARE DEF v8Wndy LET wy= v8Wndy(n) ! v8wBas - v8wRatio*(n-v8fBas) BOX SHOW v8slot$ at v8axis,v8sBas CALL SliderKnobV(v8wRgt-5,wy) LET n$= using$(v8form$,n*v8Mult) CALL PlotVSliderValue(v8axis,v8wTop-5,n$,v8Form$,v8clr) END SUB SUB v8ClearSlider CALL StringWidth(v8Name$,lw) CALL StringWidth(v8Form$,rw) LET h = max(lw,rw)/2 + 2 LET midx= int((v8wLft+v8wRgt)/2) LET lft = min(v8wlft,midx-h) LET rgt = max(v8wrgt,midx+h) BOX CLEAR lft,rgt,v8wBas+15,v8wTop-20 END SUB END MODULE ! --- horizontal sliders --- MODULE h0slider PUBLIC h0piAxis,h0Mult,h0axis,h0wLft,h0wRgt PUBLIC h0fLft,h0fRgt,h0First,h0STik,h0LTik,h0Label PUBLIC h0name$,h0form$,h0clr PUBLIC h0wBas,h0wTop,h0wWid,h0fWid,h0sLft,h0sRgt,h0fMin,h0fMax PUBLIC h0fratio,h0wratio,h0slot$ SHARE h0AnimLft,h0AnimRgt,h0AnimBas,h0AnimTop SHARE h0stopLft,h0stopRgt,h0stopBas,h0stopTop SHARE h0LstpLft,h0LstpRgt,h0LstpBas,h0LstpTop SHARE h0RstpLft,h0RstpRgt,h0RstpBas,h0RstpTop SHARE h0LmoveLft,h0LmoveRgt,h0LmoveBas,h0LmoveTop SHARE h0RmoveLft,h0RmoveRgt,h0RmoveBas,h0RmoveTop DEF h0Fncx(wx)= h0Mult * (h0fLft + h0fratio*(wx-h0wLft)) ! window to function DEF h0wndx(fx)= h0wLft + h0wratio * (fx/h0Mult - h0fLft) ! function to window ! --- slider interaction --- DEF h0Within(wx,wy) DECLARE DEF WithinWnd LET h0Within= WithinWnd(wx,wy,h0sLft,h0sRgt,h0wBas,h0wTop) END DEF SUB h0wClampfVal(wx,fx) DECLARE DEF h0Fncx LET wx= min(max(wx,h0wLft),h0wRgt) LET fx= h0Fncx(wx) END SUB SUB h0GetClickVal(ms,rn,n) DECLARE DEF h0Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h0Fncx(min(max(mx,h0wLft),h0wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h0Mark(n) END SUB SUB h0GetDragVal(ms,r,n) DECLARE DEF h0Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h0Fncx(min(max(mx,h0wLft),h0wRgt)) LET n = round(n,r) IF n<>oldn then CALL h0Mark(n) END SUB SUB h0Mark(n) DECLARE DEF h0Wndx LET wx= h0Wndx(n) BOX SHOW h0slot$ at h0sLft,h0wBas CALL SliderKnob(wx,h0wBas-5) LET n$= using$(h0form$,n) CALL PlotSliderValue(h0wRgt,h0wBas,n$,h0clr) END SUB DEF h0AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h0AnimStopWithin= WithinWnd(wx,wy,h0stopLft,h0stopRgt,h0stopBas,h0stopTop) END DEF SUB h0AnimStopButtonUp(ms) CALL MouseButtonUp(h0stopLft,h0stopRgt,h0stopBas,h0stopTop,ms) CALL h0StopButtonClear END SUB DEF h0AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h0AnimWithin= WithinWnd(wx,wy,h0AnimLft,h0AnimRgt,h0AnimBas,h0AnimTop) END DEF SUB h0AnimButtonUp(ms) CALL MouseButtonUp(h0AnimLft,h0AnimRgt,h0AnimBas,h0AnimTop,ms) CALL h0StopButton END SUB DEF h0LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h0LstpWithin= WithinWnd(wx,wy,h0LstpLft,h0LstpRgt,h0LstpBas,h0LstpTop) END DEF SUB h0LstpButtonUp(ms) CALL MouseButtonUp(h0LstpLft,h0LstpRgt,h0LstpBas,h0LstpTop,ms) END SUB SUB h0LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h0fMin) CALL h0Mark(n) END SUB DEF h0RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h0RstpWithin= WithinWnd(wx,wy,h0RstpLft,h0RstpRgt,h0RstpBas,h0RstpTop) END DEF SUB h0RstpButtonUp(ms) CALL MouseButtonUp(h0RstpLft,h0RstpRgt,h0RstpBas,h0RstpTop,ms) END SUB SUB h0RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h0fMax) CALL h0Mark(n) END SUB DEF h0LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h0LmoveWithin= WithinWnd(wx,wy,h0LmoveLft,h0LmoveRgt,h0LmoveBas,h0LmoveTop) END DEF SUB h0LmoveButtonDown CALL ButtonDown(h0LmoveLft,h0LmoveRgt,h0LmoveBas,h0LmoveTop) END SUB SUB h0LmoveButtonUp CALL ButtonUp(h0LmoveLft,h0LmoveRgt,h0LmoveBas,h0LmoveTop) END SUB DEF h0RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h0RmoveWithin= WithinWnd(wx,wy,h0RmoveLft,h0RmoveRgt,h0RmoveBas,h0RmoveTop) END DEF SUB h0RmoveButtonDown CALL ButtonDown(h0RmoveLft,h0RmoveRgt,h0RmoveBas,h0RmoveTop) END SUB SUB h0RmoveButtonUp CALL ButtonUp(h0RmoveLft,h0RmoveRgt,h0RmoveBas,h0RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h0SliderVariables CALL hWnd(h0axis,h0wLft,h0wRgt,h0wBas,h0wTop,h0wWid,h0sLft,h0sRgt) CALL hFnc(h0fLft,h0fRgt,h0fWid,h0Mult,h0fMin,h0fMax) CALL hRatios(h0fWid,h0wWid,h0fRatio,h0wRatio) END SUB SUB h0DrawSlider(h0name$,n) CALL h0ClearSlider CALL SliderSlotH(h0wLft,h0wRgt,h0axis) IF h0piAxis=0 then CALL SliderAxisHrz(h0wLft,h0wRgt,h0axis,h0fLft,h0fRgt,h0First,h0STik,h0LTik,h0Label) ELSE CALL SliderAxisHrzPi(h0wLft,h0wRgt,h0axis,h0fLft,h0fRgt,h0First,h0STik,h0LTik,h0Label) END IF BOX KEEP h0sLft,h0sRgt,h0wBas,h0axis in h0slot$ CALL PlotSliderName(h0wLft,h0wBas,h0name$,h0clr) CALL h0Mark(n) END SUB SUB h0ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h0Name$,lw) CALL StringWidth(h0Form$,rw) BOX CLEAR h0slft-lw-10,h0srgt+rw+10,h0wBas,h0wTop END SUB ! --- animation and step button methods --- SUB h0AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h0wLft,h0wBas,h0AnimLft,h0AnimRgt,h0AnimBas,h0AnimTop) CALL AnimStopButton(h0wLft,h0wBas,h0StopLft,h0StopRgt,h0StopBas,h0StopTop) END IF IF moveState=1 then CALL LftMoveButton(h0wRgt,h0wbas,h0LmoveLft,h0LmoveRgt,h0LmoveBas,h0LmoveTop) CALL RgtMoveButton(h0wRgt,h0wbas,h0RmoveLft,h0RmoveRgt,h0RmoveBas,h0RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h0wRgt,h0wbas,h0LstpLft,h0LstpRgt,h0LstpBas,h0LstpTop) CALL RgtStepButton(h0wRgt,h0wbas,h0RstpLft,h0RstpRgt,h0RstpBas,h0RstpTop) END IF END SUB SUB h0StepButtons CALL LftStepButton(h0wRgt,h0wbas,h0LstpLft,h0LstpRgt,h0LstpBas,h0LstpTop) CALL RgtStepButton(h0wRgt,h0wbas,h0RstpLft,h0RstpRgt,h0RstpBas,h0RstpTop) END SUB SUB h0MoveButtons CALL h0StepButtons CALL LftMoveButton(h0wRgt,h0wbas,h0LmoveLft,h0LmoveRgt,h0LmoveBas,h0LmoveTop) CALL RgtMoveButton(h0wRgt,h0wbas,h0RmoveLft,h0RmoveRgt,h0RmoveBas,h0RmoveTop) END SUB SUB h0AnimButtons CALL AnimGoButton(h0wLft,h0wBas,h0AnimLft,h0AnimRgt,h0AnimBas,h0AnimTop) CALL AnimStopButton(h0wLft,h0wBas,h0StopLft,h0StopRgt,h0StopBas,h0StopTop) ! CALL h0MoveButtons CALL h0StepButtons END SUB SUB h0StopButton CALL StopButton(h0stopLft,h0stopRgt,h0stopBas,h0stopTop) END SUB SUB h0StopButtonClear BOX CLEAR h0stopLft,h0stopRgt,h0stopBas,h0stopTop END SUB END MODULE MODULE h1slider PUBLIC h1piAxis,h1Mult,h1axis,h1wLft,h1wRgt PUBLIC h1fLft,h1fRgt,h1First,h1STik,h1LTik,h1Label PUBLIC h1name$,h1form$,h1clr PUBLIC h1wBas,h1wTop,h1wWid,h1fWid,h1sLft,h1sRgt,h1fMin,h1fMax PUBLIC h1fratio,h1wratio,h1slot$ SHARE h1AnimLft,h1AnimRgt,h1AnimBas,h1AnimTop SHARE h1stopLft,h1stopRgt,h1stopBas,h1stopTop SHARE h1LstpLft,h1LstpRgt,h1LstpBas,h1LstpTop SHARE h1RstpLft,h1RstpRgt,h1RstpBas,h1RstpTop SHARE h1LmoveLft,h1LmoveRgt,h1LmoveBas,h1LmoveTop SHARE h1RmoveLft,h1RmoveRgt,h1RmoveBas,h1RmoveTop DEF h1Fncx(wx)= h1Mult * (h1fLft + h1fratio*(wx-h1wLft)) ! window to function DEF h1wndx(fx)= h1wLft + h1wratio * (fx/h1Mult - h1fLft) ! function to window ! --- slider interaction --- DEF h1Within(wx,wy) DECLARE DEF WithinWnd LET h1Within= WithinWnd(wx,wy,h1sLft,h1sRgt,h1wBas,h1wTop) END DEF SUB h1wClampfVal(wx,fx) DECLARE DEF h1Fncx LET wx= min(max(wx,h1wLft),h1wRgt) LET fx= h1Fncx(wx) END SUB SUB h1GetClickVal(ms,rn,n) DECLARE DEF h1Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h1Fncx(min(max(mx,h1wLft),h1wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h1Mark(n) END SUB SUB h1GetDragVal(ms,r,n) DECLARE DEF h1Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h1Fncx(min(max(mx,h1wLft),h1wRgt)) LET n = round(n,r) IF n<>oldn then CALL h1Mark(n) END SUB SUB h1Mark(n) DECLARE DEF h1Wndx LET wx= h1Wndx(n) BOX SHOW h1slot$ at h1sLft,h1wBas CALL SliderKnob(wx,h1wBas-5) LET n$= using$(h1form$,n) CALL PlotSliderValue(h1wRgt,h1wBas,n$,h1clr) END SUB DEF h1AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h1AnimStopWithin= WithinWnd(wx,wy,h1stopLft,h1stopRgt,h1stopBas,h1stopTop) END DEF SUB h1AnimStopButtonUp(ms) CALL MouseButtonUp(h1stopLft,h1stopRgt,h1stopBas,h1stopTop,ms) CALL h1StopButtonClear END SUB DEF h1AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h1AnimWithin= WithinWnd(wx,wy,h1AnimLft,h1AnimRgt,h1AnimBas,h1AnimTop) END DEF SUB h1AnimButtonUp(ms) CALL MouseButtonUp(h1AnimLft,h1AnimRgt,h1AnimBas,h1AnimTop,ms) CALL h1StopButton END SUB DEF h1LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h1LstpWithin= WithinWnd(wx,wy,h1LstpLft,h1LstpRgt,h1LstpBas,h1LstpTop) END DEF SUB h1LstpButtonUp(ms) CALL MouseButtonUp(h1LstpLft,h1LstpRgt,h1LstpBas,h1LstpTop,ms) END SUB SUB h1LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h1fMin) CALL h1Mark(n) END SUB DEF h1RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h1RstpWithin= WithinWnd(wx,wy,h1RstpLft,h1RstpRgt,h1RstpBas,h1RstpTop) END DEF SUB h1RstpButtonUp(ms) CALL MouseButtonUp(h1RstpLft,h1RstpRgt,h1RstpBas,h1RstpTop,ms) END SUB SUB h1RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h1fMax) CALL h1Mark(n) END SUB DEF h1LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h1LmoveWithin= WithinWnd(wx,wy,h1LmoveLft,h1LmoveRgt,h1LmoveBas,h1LmoveTop) END DEF SUB h1LmoveButtonDown CALL ButtonDown(h1LmoveLft,h1LmoveRgt,h1LmoveBas,h1LmoveTop) END SUB SUB h1LmoveButtonUp CALL ButtonUp(h1LmoveLft,h1LmoveRgt,h1LmoveBas,h1LmoveTop) END SUB DEF h1RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h1RmoveWithin= WithinWnd(wx,wy,h1RmoveLft,h1RmoveRgt,h1RmoveBas,h1RmoveTop) END DEF SUB h1RmoveButtonDown CALL ButtonDown(h1RmoveLft,h1RmoveRgt,h1RmoveBas,h1RmoveTop) END SUB SUB h1RmoveButtonUp CALL ButtonUp(h1RmoveLft,h1RmoveRgt,h1RmoveBas,h1RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h1SliderVariables CALL hWnd(h1axis,h1wLft,h1wRgt,h1wBas,h1wTop,h1wWid,h1sLft,h1sRgt) CALL hFnc(h1fLft,h1fRgt,h1fWid,h1Mult,h1fMin,h1fMax) CALL hRatios(h1fWid,h1wWid,h1fRatio,h1wRatio) END SUB SUB h1DrawSlider(h1name$,n) CALL h1ClearSlider CALL SliderSlotH(h1wLft,h1wRgt,h1axis) IF h1piAxis=0 then CALL SliderAxisHrz(h1wLft,h1wRgt,h1axis,h1fLft,h1fRgt,h1First,h1STik,h1LTik,h1Label) ELSE CALL SliderAxisHrzPi(h1wLft,h1wRgt,h1axis,h1fLft,h1fRgt,h1First,h1STik,h1LTik,h1Label) END IF BOX KEEP h1sLft,h1sRgt,h1wBas,h1axis in h1slot$ CALL PlotSliderName(h1wLft,h1wBas,h1name$,h1clr) CALL h1Mark(n) END SUB SUB h1ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h1Name$,lw) CALL StringWidth(h1Form$,rw) BOX CLEAR h1slft-lw-10,h1srgt+rw+10,h1wBas,h1wTop END SUB ! --- animation and step button methods --- SUB h1AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h1wLft,h1wBas,h1AnimLft,h1AnimRgt,h1AnimBas,h1AnimTop) CALL AnimStopButton(h1wLft,h1wBas,h1StopLft,h1StopRgt,h1StopBas,h1StopTop) END IF IF moveState=1 then CALL LftMoveButton(h1wRgt,h1wbas,h1LmoveLft,h1LmoveRgt,h1LmoveBas,h1LmoveTop) CALL RgtMoveButton(h1wRgt,h1wbas,h1RmoveLft,h1RmoveRgt,h1RmoveBas,h1RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h1wRgt,h1wbas,h1LstpLft,h1LstpRgt,h1LstpBas,h1LstpTop) CALL RgtStepButton(h1wRgt,h1wbas,h1RstpLft,h1RstpRgt,h1RstpBas,h1RstpTop) END IF END SUB SUB h1StepButtons CALL LftStepButton(h1wRgt,h1wbas,h1LstpLft,h1LstpRgt,h1LstpBas,h1LstpTop) CALL RgtStepButton(h1wRgt,h1wbas,h1RstpLft,h1RstpRgt,h1RstpBas,h1RstpTop) END SUB SUB h1MoveButtons CALL h1StepButtons CALL LftMoveButton(h1wRgt,h1wbas,h1LmoveLft,h1LmoveRgt,h1LmoveBas,h1LmoveTop) CALL RgtMoveButton(h1wRgt,h1wbas,h1RmoveLft,h1RmoveRgt,h1RmoveBas,h1RmoveTop) END SUB SUB h1AnimButtons CALL AnimGoButton(h1wLft,h1wBas,h1AnimLft,h1AnimRgt,h1AnimBas,h1AnimTop) CALL AnimStopButton(h1wLft,h1wBas,h1StopLft,h1StopRgt,h1StopBas,h1StopTop) ! CALL h1MoveButtons CALL h1StepButtons END SUB SUB h1StopButton CALL StopButton(h1stopLft,h1stopRgt,h1stopBas,h1stopTop) END SUB SUB h1StopButtonClear BOX CLEAR h1stopLft,h1stopRgt,h1stopBas,h1stopTop END SUB END MODULE MODULE h2slider PUBLIC h2piAxis,h2Mult,h2axis,h2wLft,h2wRgt PUBLIC h2fLft,h2fRgt,h2First,h2STik,h2LTik,h2Label PUBLIC h2name$,h2form$,h2clr PUBLIC h2wBas,h2wTop,h2wWid,h2fWid,h2sLft,h2sRgt,h2fMin,h2fMax PUBLIC h2fratio,h2wratio,h2slot$ SHARE h2AnimLft,h2AnimRgt,h2AnimBas,h2AnimTop SHARE h2stopLft,h2stopRgt,h2stopBas,h2stopTop SHARE h2LstpLft,h2LstpRgt,h2LstpBas,h2LstpTop SHARE h2RstpLft,h2RstpRgt,h2RstpBas,h2RstpTop SHARE h2LmoveLft,h2LmoveRgt,h2LmoveBas,h2LmoveTop SHARE h2RmoveLft,h2RmoveRgt,h2RmoveBas,h2RmoveTop DEF h2Fncx(wx)= h2Mult * (h2fLft + h2fratio*(wx-h2wLft)) ! window to function DEF h2wndx(fx)= h2wLft + h2wratio * (fx/h2Mult - h2fLft) ! function to window ! --- slider interaction --- DEF h2Within(wx,wy) DECLARE DEF WithinWnd LET h2Within= WithinWnd(wx,wy,h2sLft,h2sRgt,h2wBas,h2wTop) END DEF SUB h2wClampfVal(wx,fx) DECLARE DEF h2Fncx LET wx= min(max(wx,h2wLft),h2wRgt) LET fx= h2Fncx(wx) END SUB SUB h2GetClickVal(ms,rn,n) DECLARE DEF h2Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h2Fncx(min(max(mx,h2wLft),h2wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h2Mark(n) END SUB SUB h2GetDragVal(ms,r,n) DECLARE DEF h2Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h2Fncx(min(max(mx,h2wLft),h2wRgt)) LET n = round(n,r) IF n<>oldn then CALL h2Mark(n) END SUB SUB h2Mark(n) DECLARE DEF h2Wndx LET wx= h2Wndx(n) BOX SHOW h2slot$ at h2sLft,h2wBas CALL SliderKnob(wx,h2wBas-5) LET n$= using$(h2form$,n) CALL PlotSliderValue(h2wRgt,h2wBas,n$,h2clr) END SUB DEF h2AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h2AnimStopWithin= WithinWnd(wx,wy,h2stopLft,h2stopRgt,h2stopBas,h2stopTop) END DEF SUB h2AnimStopButtonUp(ms) CALL MouseButtonUp(h2stopLft,h2stopRgt,h2stopBas,h2stopTop,ms) CALL h2StopButtonClear END SUB DEF h2AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h2AnimWithin= WithinWnd(wx,wy,h2AnimLft,h2AnimRgt,h2AnimBas,h2AnimTop) END DEF SUB h2AnimButtonUp(ms) CALL MouseButtonUp(h2AnimLft,h2AnimRgt,h2AnimBas,h2AnimTop,ms) CALL h2StopButton END SUB DEF h2LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h2LstpWithin= WithinWnd(wx,wy,h2LstpLft,h2LstpRgt,h2LstpBas,h2LstpTop) END DEF SUB h2LstpButtonUp(ms) CALL MouseButtonUp(h2LstpLft,h2LstpRgt,h2LstpBas,h2LstpTop,ms) END SUB SUB h2LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h2fMin) CALL h2Mark(n) END SUB DEF h2RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h2RstpWithin= WithinWnd(wx,wy,h2RstpLft,h2RstpRgt,h2RstpBas,h2RstpTop) END DEF SUB h2RstpButtonUp(ms) CALL MouseButtonUp(h2RstpLft,h2RstpRgt,h2RstpBas,h2RstpTop,ms) END SUB SUB h2RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h2fMax) CALL h2Mark(n) END SUB DEF h2LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h2LmoveWithin= WithinWnd(wx,wy,h2LmoveLft,h2LmoveRgt,h2LmoveBas,h2LmoveTop) END DEF SUB h2LmoveButtonDown CALL ButtonDown(h2LmoveLft,h2LmoveRgt,h2LmoveBas,h2LmoveTop) END SUB SUB h2LmoveButtonUp CALL ButtonUp(h2LmoveLft,h2LmoveRgt,h2LmoveBas,h2LmoveTop) END SUB DEF h2RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h2RmoveWithin= WithinWnd(wx,wy,h2RmoveLft,h2RmoveRgt,h2RmoveBas,h2RmoveTop) END DEF SUB h2RmoveButtonDown CALL ButtonDown(h2RmoveLft,h2RmoveRgt,h2RmoveBas,h2RmoveTop) END SUB SUB h2RmoveButtonUp CALL ButtonUp(h2RmoveLft,h2RmoveRgt,h2RmoveBas,h2RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h2SliderVariables CALL hWnd(h2axis,h2wLft,h2wRgt,h2wBas,h2wTop,h2wWid,h2sLft,h2sRgt) CALL hFnc(h2fLft,h2fRgt,h2fWid,h2Mult,h2fMin,h2fMax) CALL hRatios(h2fWid,h2wWid,h2fRatio,h2wRatio) END SUB SUB h2DrawSlider(h2name$,n) CALL h2ClearSlider CALL SliderSlotH(h2wLft,h2wRgt,h2axis) IF h2piAxis=0 then CALL SliderAxisHrz(h2wLft,h2wRgt,h2axis,h2fLft,h2fRgt,h2First,h2STik,h2LTik,h2Label) ELSE CALL SliderAxisHrzPi(h2wLft,h2wRgt,h2axis,h2fLft,h2fRgt,h2First,h2STik,h2LTik,h2Label) END IF BOX KEEP h2sLft,h2sRgt,h2wBas,h2axis in h2slot$ CALL PlotSliderName(h2wLft,h2wBas,h2name$,h2clr) CALL h2Mark(n) END SUB SUB h2ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h2Name$,lw) CALL StringWidth(h2Form$,rw) BOX CLEAR h2slft-lw-10,h2srgt+rw+10,h2wBas,h2wTop END SUB ! --- animation and step button methods --- SUB h2AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h2wLft,h2wBas,h2AnimLft,h2AnimRgt,h2AnimBas,h2AnimTop) CALL AnimStopButton(h2wLft,h2wBas,h2StopLft,h2StopRgt,h2StopBas,h2StopTop) END IF IF moveState=1 then CALL LftMoveButton(h2wRgt,h2wbas,h2LmoveLft,h2LmoveRgt,h2LmoveBas,h2LmoveTop) CALL RgtMoveButton(h2wRgt,h2wbas,h2RmoveLft,h2RmoveRgt,h2RmoveBas,h2RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h2wRgt,h2wbas,h2LstpLft,h2LstpRgt,h2LstpBas,h2LstpTop) CALL RgtStepButton(h2wRgt,h2wbas,h2RstpLft,h2RstpRgt,h2RstpBas,h2RstpTop) END IF END SUB SUB h2StepButtons CALL LftStepButton(h2wRgt,h2wbas,h2LstpLft,h2LstpRgt,h2LstpBas,h2LstpTop) CALL RgtStepButton(h2wRgt,h2wbas,h2RstpLft,h2RstpRgt,h2RstpBas,h2RstpTop) END SUB SUB h2MoveButtons CALL h2StepButtons CALL LftMoveButton(h2wRgt,h2wbas,h2LmoveLft,h2LmoveRgt,h2LmoveBas,h2LmoveTop) CALL RgtMoveButton(h2wRgt,h2wbas,h2RmoveLft,h2RmoveRgt,h2RmoveBas,h2RmoveTop) END SUB SUB h2AnimButtons CALL AnimGoButton(h2wLft,h2wBas,h2AnimLft,h2AnimRgt,h2AnimBas,h2AnimTop) CALL AnimStopButton(h2wLft,h2wBas,h2StopLft,h2StopRgt,h2StopBas,h2StopTop) ! CALL h2MoveButtons CALL h2StepButtons END SUB SUB h2StopButton CALL StopButton(h2stopLft,h2stopRgt,h2stopBas,h2stopTop) END SUB SUB h2StopButtonClear BOX CLEAR h2stopLft,h2stopRgt,h2stopBas,h2stopTop END SUB END MODULE MODULE h3slider PUBLIC h3piAxis,h3Mult,h3axis,h3wLft,h3wRgt PUBLIC h3fLft,h3fRgt,h3First,h3STik,h3LTik,h3Label PUBLIC h3name$,h3form$,h3clr PUBLIC h3wBas,h3wTop,h3wWid,h3fWid,h3sLft,h3sRgt,h3fMin,h3fMax PUBLIC h3fratio,h3wratio,h3slot$ SHARE h3AnimLft,h3AnimRgt,h3AnimBas,h3AnimTop SHARE h3stopLft,h3stopRgt,h3stopBas,h3stopTop SHARE h3LstpLft,h3LstpRgt,h3LstpBas,h3LstpTop SHARE h3RstpLft,h3RstpRgt,h3RstpBas,h3RstpTop SHARE h3LmoveLft,h3LmoveRgt,h3LmoveBas,h3LmoveTop SHARE h3RmoveLft,h3RmoveRgt,h3RmoveBas,h3RmoveTop DEF h3Fncx(wx)= h3Mult * (h3fLft + h3fratio*(wx-h3wLft)) ! window to function DEF h3wndx(fx)= h3wLft + h3wratio * (fx/h3Mult - h3fLft) ! function to window ! --- slider interaction --- DEF h3Within(wx,wy) DECLARE DEF WithinWnd LET h3Within= WithinWnd(wx,wy,h3sLft,h3sRgt,h3wBas,h3wTop) END DEF SUB h3wClampfVal(wx,fx) DECLARE DEF h3Fncx LET wx= min(max(wx,h3wLft),h3wRgt) LET fx= h3Fncx(wx) END SUB SUB h3GetClickVal(ms,rn,n) DECLARE DEF h3Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h3Fncx(min(max(mx,h3wLft),h3wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h3Mark(n) END SUB SUB h3GetDragVal(ms,r,n) DECLARE DEF h3Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h3Fncx(min(max(mx,h3wLft),h3wRgt)) LET n = round(n,r) IF n<>oldn then CALL h3Mark(n) END SUB SUB h3Mark(n) DECLARE DEF h3Wndx LET wx= h3Wndx(n) BOX SHOW h3slot$ at h3sLft,h3wBas CALL SliderKnob(wx,h3wBas-5) LET n$= using$(h3form$,n) CALL PlotSliderValue(h3wRgt,h3wBas,n$,h3clr) END SUB DEF h3AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h3AnimStopWithin= WithinWnd(wx,wy,h3stopLft,h3stopRgt,h3stopBas,h3stopTop) END DEF SUB h3AnimStopButtonUp(ms) CALL MouseButtonUp(h3stopLft,h3stopRgt,h3stopBas,h3stopTop,ms) CALL h3StopButtonClear END SUB DEF h3AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h3AnimWithin= WithinWnd(wx,wy,h3AnimLft,h3AnimRgt,h3AnimBas,h3AnimTop) END DEF SUB h3AnimButtonUp(ms) CALL MouseButtonUp(h3AnimLft,h3AnimRgt,h3AnimBas,h3AnimTop,ms) CALL h3StopButton END SUB DEF h3LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h3LstpWithin= WithinWnd(wx,wy,h3LstpLft,h3LstpRgt,h3LstpBas,h3LstpTop) END DEF SUB h3LstpButtonUp(ms) CALL MouseButtonUp(h3LstpLft,h3LstpRgt,h3LstpBas,h3LstpTop,ms) END SUB SUB h3LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h3fMin) CALL h3Mark(n) END SUB DEF h3RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h3RstpWithin= WithinWnd(wx,wy,h3RstpLft,h3RstpRgt,h3RstpBas,h3RstpTop) END DEF SUB h3RstpButtonUp(ms) CALL MouseButtonUp(h3RstpLft,h3RstpRgt,h3RstpBas,h3RstpTop,ms) END SUB SUB h3RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h3fMax) CALL h3Mark(n) END SUB DEF h3LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h3LmoveWithin= WithinWnd(wx,wy,h3LmoveLft,h3LmoveRgt,h3LmoveBas,h3LmoveTop) END DEF SUB h3LmoveButtonDown CALL ButtonDown(h3LmoveLft,h3LmoveRgt,h3LmoveBas,h3LmoveTop) END SUB SUB h3LmoveButtonUp CALL ButtonUp(h3LmoveLft,h3LmoveRgt,h3LmoveBas,h3LmoveTop) END SUB DEF h3RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h3RmoveWithin= WithinWnd(wx,wy,h3RmoveLft,h3RmoveRgt,h3RmoveBas,h3RmoveTop) END DEF SUB h3RmoveButtonDown CALL ButtonDown(h3RmoveLft,h3RmoveRgt,h3RmoveBas,h3RmoveTop) END SUB SUB h3RmoveButtonUp CALL ButtonUp(h3RmoveLft,h3RmoveRgt,h3RmoveBas,h3RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h3SliderVariables CALL hWnd(h3axis,h3wLft,h3wRgt,h3wBas,h3wTop,h3wWid,h3sLft,h3sRgt) CALL hFnc(h3fLft,h3fRgt,h3fWid,h3Mult,h3fMin,h3fMax) CALL hRatios(h3fWid,h3wWid,h3fRatio,h3wRatio) END SUB SUB h3DrawSlider(h3name$,n) CALL h3ClearSlider CALL SliderSlotH(h3wLft,h3wRgt,h3axis) IF h3piAxis=0 then CALL SliderAxisHrz(h3wLft,h3wRgt,h3axis,h3fLft,h3fRgt,h3First,h3STik,h3LTik,h3Label) ELSE CALL SliderAxisHrzPi(h3wLft,h3wRgt,h3axis,h3fLft,h3fRgt,h3First,h3STik,h3LTik,h3Label) END IF BOX KEEP h3sLft,h3sRgt,h3wBas,h3axis in h3slot$ CALL PlotSliderName(h3wLft,h3wBas,h3name$,h3clr) CALL h3Mark(n) END SUB SUB h3ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h3Name$,lw) CALL StringWidth(h3Form$,rw) BOX CLEAR h3slft-lw-10,h3srgt+rw+10,h3wBas,h3wTop END SUB ! --- animation and step button methods --- SUB h3AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h3wLft,h3wBas,h3AnimLft,h3AnimRgt,h3AnimBas,h3AnimTop) CALL AnimStopButton(h3wLft,h3wBas,h3StopLft,h3StopRgt,h3StopBas,h3StopTop) END IF IF moveState=1 then CALL LftMoveButton(h3wRgt,h3wbas,h3LmoveLft,h3LmoveRgt,h3LmoveBas,h3LmoveTop) CALL RgtMoveButton(h3wRgt,h3wbas,h3RmoveLft,h3RmoveRgt,h3RmoveBas,h3RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h3wRgt,h3wbas,h3LstpLft,h3LstpRgt,h3LstpBas,h3LstpTop) CALL RgtStepButton(h3wRgt,h3wbas,h3RstpLft,h3RstpRgt,h3RstpBas,h3RstpTop) END IF END SUB SUB h3StepButtons CALL LftStepButton(h3wRgt,h3wbas,h3LstpLft,h3LstpRgt,h3LstpBas,h3LstpTop) CALL RgtStepButton(h3wRgt,h3wbas,h3RstpLft,h3RstpRgt,h3RstpBas,h3RstpTop) END SUB SUB h3MoveButtons CALL h3StepButtons CALL LftMoveButton(h3wRgt,h3wbas,h3LmoveLft,h3LmoveRgt,h3LmoveBas,h3LmoveTop) CALL RgtMoveButton(h3wRgt,h3wbas,h3RmoveLft,h3RmoveRgt,h3RmoveBas,h3RmoveTop) END SUB SUB h3AnimButtons CALL AnimGoButton(h3wLft,h3wBas,h3AnimLft,h3AnimRgt,h3AnimBas,h3AnimTop) CALL AnimStopButton(h3wLft,h3wBas,h3StopLft,h3StopRgt,h3StopBas,h3StopTop) ! CALL h3MoveButtons CALL h3StepButtons END SUB SUB h3StopButton CALL StopButton(h3stopLft,h3stopRgt,h3stopBas,h3stopTop) END SUB SUB h3StopButtonClear BOX CLEAR h3stopLft,h3stopRgt,h3stopBas,h3stopTop END SUB END MODULE MODULE h4slider PUBLIC h4piAxis,h4Mult,h4axis,h4wLft,h4wRgt PUBLIC h4fLft,h4fRgt,h4First,h4STik,h4LTik,h4Label PUBLIC h4name$,h4form$,h4clr PUBLIC h4wBas,h4wTop,h4wWid,h4fWid,h4sLft,h4sRgt,h4fMin,h4fMax PUBLIC h4fratio,h4wratio,h4slot$ SHARE h4AnimLft,h4AnimRgt,h4AnimBas,h4AnimTop SHARE h4stopLft,h4stopRgt,h4stopBas,h4stopTop SHARE h4LstpLft,h4LstpRgt,h4LstpBas,h4LstpTop SHARE h4RstpLft,h4RstpRgt,h4RstpBas,h4RstpTop SHARE h4LmoveLft,h4LmoveRgt,h4LmoveBas,h4LmoveTop SHARE h4RmoveLft,h4RmoveRgt,h4RmoveBas,h4RmoveTop DEF h4Fncx(wx)= h4Mult * (h4fLft + h4fratio*(wx-h4wLft)) ! window to function DEF h4wndx(fx)= h4wLft + h4wratio * (fx/h4Mult - h4fLft) ! function to window ! --- slider interaction --- DEF h4Within(wx,wy) DECLARE DEF WithinWnd LET h4Within= WithinWnd(wx,wy,h4sLft,h4sRgt,h4wBas,h4wTop) END DEF SUB h4wClampfVal(wx,fx) DECLARE DEF h4Fncx LET wx= min(max(wx,h4wLft),h4wRgt) LET fx= h4Fncx(wx) END SUB SUB h4GetClickVal(ms,rn,n) DECLARE DEF h4Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h4Fncx(min(max(mx,h4wLft),h4wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h4Mark(n) END SUB SUB h4GetDragVal(ms,r,n) DECLARE DEF h4Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h4Fncx(min(max(mx,h4wLft),h4wRgt)) LET n = round(n,r) IF n<>oldn then CALL h4Mark(n) END SUB SUB h4Mark(n) DECLARE DEF h4Wndx LET wx= h4Wndx(n) BOX SHOW h4slot$ at h4sLft,h4wBas CALL SliderKnob(wx,h4wBas-5) LET n$= using$(h4form$,n) CALL PlotSliderValue(h4wRgt,h4wBas,n$,h4clr) END SUB DEF h4AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h4AnimStopWithin= WithinWnd(wx,wy,h4stopLft,h4stopRgt,h4stopBas,h4stopTop) END DEF SUB h4AnimStopButtonUp(ms) CALL MouseButtonUp(h4stopLft,h4stopRgt,h4stopBas,h4stopTop,ms) CALL h4StopButtonClear END SUB DEF h4AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h4AnimWithin= WithinWnd(wx,wy,h4AnimLft,h4AnimRgt,h4AnimBas,h4AnimTop) END DEF SUB h4AnimButtonUp(ms) CALL MouseButtonUp(h4AnimLft,h4AnimRgt,h4AnimBas,h4AnimTop,ms) CALL h4StopButton END SUB DEF h4LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h4LstpWithin= WithinWnd(wx,wy,h4LstpLft,h4LstpRgt,h4LstpBas,h4LstpTop) END DEF SUB h4LstpButtonUp(ms) CALL MouseButtonUp(h4LstpLft,h4LstpRgt,h4LstpBas,h4LstpTop,ms) END SUB SUB h4LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h4fMin) CALL h4Mark(n) END SUB DEF h4RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h4RstpWithin= WithinWnd(wx,wy,h4RstpLft,h4RstpRgt,h4RstpBas,h4RstpTop) END DEF SUB h4RstpButtonUp(ms) CALL MouseButtonUp(h4RstpLft,h4RstpRgt,h4RstpBas,h4RstpTop,ms) END SUB SUB h4RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h4fMax) CALL h4Mark(n) END SUB DEF h4LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h4LmoveWithin= WithinWnd(wx,wy,h4LmoveLft,h4LmoveRgt,h4LmoveBas,h4LmoveTop) END DEF SUB h4LmoveButtonDown CALL ButtonDown(h4LmoveLft,h4LmoveRgt,h4LmoveBas,h4LmoveTop) END SUB SUB h4LmoveButtonUp CALL ButtonUp(h4LmoveLft,h4LmoveRgt,h4LmoveBas,h4LmoveTop) END SUB DEF h4RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h4RmoveWithin= WithinWnd(wx,wy,h4RmoveLft,h4RmoveRgt,h4RmoveBas,h4RmoveTop) END DEF SUB h4RmoveButtonDown CALL ButtonDown(h4RmoveLft,h4RmoveRgt,h4RmoveBas,h4RmoveTop) END SUB SUB h4RmoveButtonUp CALL ButtonUp(h4RmoveLft,h4RmoveRgt,h4RmoveBas,h4RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h4SliderVariables CALL hWnd(h4axis,h4wLft,h4wRgt,h4wBas,h4wTop,h4wWid,h4sLft,h4sRgt) CALL hFnc(h4fLft,h4fRgt,h4fWid,h4Mult,h4fMin,h4fMax) CALL hRatios(h4fWid,h4wWid,h4fRatio,h4wRatio) END SUB SUB h4DrawSlider(h4name$,n) CALL h4ClearSlider CALL SliderSlotH(h4wLft,h4wRgt,h4axis) IF h4piAxis=0 then CALL SliderAxisHrz(h4wLft,h4wRgt,h4axis,h4fLft,h4fRgt,h4First,h4STik,h4LTik,h4Label) ELSE CALL SliderAxisHrzPi(h4wLft,h4wRgt,h4axis,h4fLft,h4fRgt,h4First,h4STik,h4LTik,h4Label) END IF BOX KEEP h4sLft,h4sRgt,h4wBas,h4axis in h4slot$ CALL PlotSliderName(h4wLft,h4wBas,h4name$,h4clr) CALL h4Mark(n) END SUB SUB h4ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h4Name$,lw) CALL StringWidth(h4Form$,rw) BOX CLEAR h4slft-lw-10,h4srgt+rw+10,h4wBas,h4wTop END SUB ! --- animation and step button methods --- SUB h4AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h4wLft,h4wBas,h4AnimLft,h4AnimRgt,h4AnimBas,h4AnimTop) CALL AnimStopButton(h4wLft,h4wBas,h4StopLft,h4StopRgt,h4StopBas,h4StopTop) END IF IF moveState=1 then CALL LftMoveButton(h4wRgt,h4wbas,h4LmoveLft,h4LmoveRgt,h4LmoveBas,h4LmoveTop) CALL RgtMoveButton(h4wRgt,h4wbas,h4RmoveLft,h4RmoveRgt,h4RmoveBas,h4RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h4wRgt,h4wbas,h4LstpLft,h4LstpRgt,h4LstpBas,h4LstpTop) CALL RgtStepButton(h4wRgt,h4wbas,h4RstpLft,h4RstpRgt,h4RstpBas,h4RstpTop) END IF END SUB SUB h4StepButtons CALL LftStepButton(h4wRgt,h4wbas,h4LstpLft,h4LstpRgt,h4LstpBas,h4LstpTop) CALL RgtStepButton(h4wRgt,h4wbas,h4RstpLft,h4RstpRgt,h4RstpBas,h4RstpTop) END SUB SUB h4MoveButtons CALL h4StepButtons CALL LftMoveButton(h4wRgt,h4wbas,h4LmoveLft,h4LmoveRgt,h4LmoveBas,h4LmoveTop) CALL RgtMoveButton(h4wRgt,h4wbas,h4RmoveLft,h4RmoveRgt,h4RmoveBas,h4RmoveTop) END SUB SUB h4AnimButtons CALL AnimGoButton(h4wLft,h4wBas,h4AnimLft,h4AnimRgt,h4AnimBas,h4AnimTop) CALL AnimStopButton(h4wLft,h4wBas,h4StopLft,h4StopRgt,h4StopBas,h4StopTop) ! CALL h4MoveButtons CALL h4StepButtons END SUB SUB h4StopButton CALL StopButton(h4stopLft,h4stopRgt,h4stopBas,h4stopTop) END SUB SUB h4StopButtonClear BOX CLEAR h4stopLft,h4stopRgt,h4stopBas,h4stopTop END SUB END MODULE MODULE h5slider PUBLIC h5piAxis,h5Mult,h5axis,h5wLft,h5wRgt PUBLIC h5fLft,h5fRgt,h5First,h5STik,h5LTik,h5Label PUBLIC h5name$,h5form$,h5clr PUBLIC h5wBas,h5wTop,h5wWid,h5fWid,h5sLft,h5sRgt,h5fMin,h5fMax PUBLIC h5fratio,h5wratio,h5slot$ SHARE h5AnimLft,h5AnimRgt,h5AnimBas,h5AnimTop SHARE h5stopLft,h5stopRgt,h5stopBas,h5stopTop SHARE h5LstpLft,h5LstpRgt,h5LstpBas,h5LstpTop SHARE h5RstpLft,h5RstpRgt,h5RstpBas,h5RstpTop SHARE h5LmoveLft,h5LmoveRgt,h5LmoveBas,h5LmoveTop SHARE h5RmoveLft,h5RmoveRgt,h5RmoveBas,h5RmoveTop DEF h5Fncx(wx)= h5Mult * (h5fLft + h5fratio*(wx-h5wLft)) ! window to function DEF h5wndx(fx)= h5wLft + h5wratio * (fx/h5Mult - h5fLft) ! function to window ! --- slider interaction --- DEF h5Within(wx,wy) DECLARE DEF WithinWnd LET h5Within= WithinWnd(wx,wy,h5sLft,h5sRgt,h5wBas,h5wTop) END DEF SUB h5wClampfVal(wx,fx) DECLARE DEF h5Fncx LET wx= min(max(wx,h5wLft),h5wRgt) LET fx= h5Fncx(wx) END SUB SUB h5GetClickVal(ms,rn,n) DECLARE DEF h5Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h5Fncx(min(max(mx,h5wLft),h5wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h5Mark(n) END SUB SUB h5GetDragVal(ms,r,n) DECLARE DEF h5Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h5Fncx(min(max(mx,h5wLft),h5wRgt)) LET n = round(n,r) IF n<>oldn then CALL h5Mark(n) END SUB SUB h5Mark(n) DECLARE DEF h5Wndx LET wx= h5Wndx(n) BOX SHOW h5slot$ at h5sLft,h5wBas CALL SliderKnob(wx,h5wBas-5) LET n$= using$(h5form$,n) CALL PlotSliderValue(h5wRgt,h5wBas,n$,h5clr) END SUB DEF h5AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h5AnimStopWithin= WithinWnd(wx,wy,h5stopLft,h5stopRgt,h5stopBas,h5stopTop) END DEF SUB h5AnimStopButtonUp(ms) CALL MouseButtonUp(h5stopLft,h5stopRgt,h5stopBas,h5stopTop,ms) CALL h5StopButtonClear END SUB DEF h5AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h5AnimWithin= WithinWnd(wx,wy,h5AnimLft,h5AnimRgt,h5AnimBas,h5AnimTop) END DEF SUB h5AnimButtonUp(ms) CALL MouseButtonUp(h5AnimLft,h5AnimRgt,h5AnimBas,h5AnimTop,ms) CALL h5StopButton END SUB DEF h5LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h5LstpWithin= WithinWnd(wx,wy,h5LstpLft,h5LstpRgt,h5LstpBas,h5LstpTop) END DEF SUB h5LstpButtonUp(ms) CALL MouseButtonUp(h5LstpLft,h5LstpRgt,h5LstpBas,h5LstpTop,ms) END SUB SUB h5LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h5fMin) CALL h5Mark(n) END SUB DEF h5RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h5RstpWithin= WithinWnd(wx,wy,h5RstpLft,h5RstpRgt,h5RstpBas,h5RstpTop) END DEF SUB h5RstpButtonUp(ms) CALL MouseButtonUp(h5RstpLft,h5RstpRgt,h5RstpBas,h5RstpTop,ms) END SUB SUB h5RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h5fMax) CALL h5Mark(n) END SUB DEF h5LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h5LmoveWithin= WithinWnd(wx,wy,h5LmoveLft,h5LmoveRgt,h5LmoveBas,h5LmoveTop) END DEF SUB h5LmoveButtonDown CALL ButtonDown(h5LmoveLft,h5LmoveRgt,h5LmoveBas,h5LmoveTop) END SUB SUB h5LmoveButtonUp CALL ButtonUp(h5LmoveLft,h5LmoveRgt,h5LmoveBas,h5LmoveTop) END SUB DEF h5RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h5RmoveWithin= WithinWnd(wx,wy,h5RmoveLft,h5RmoveRgt,h5RmoveBas,h5RmoveTop) END DEF SUB h5RmoveButtonDown CALL ButtonDown(h5RmoveLft,h5RmoveRgt,h5RmoveBas,h5RmoveTop) END SUB SUB h5RmoveButtonUp CALL ButtonUp(h5RmoveLft,h5RmoveRgt,h5RmoveBas,h5RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h5SliderVariables CALL hWnd(h5axis,h5wLft,h5wRgt,h5wBas,h5wTop,h5wWid,h5sLft,h5sRgt) CALL hFnc(h5fLft,h5fRgt,h5fWid,h5Mult,h5fMin,h5fMax) CALL hRatios(h5fWid,h5wWid,h5fRatio,h5wRatio) END SUB SUB h5DrawSlider(h5name$,n) CALL h5ClearSlider CALL SliderSlotH(h5wLft,h5wRgt,h5axis) IF h5piAxis=0 then CALL SliderAxisHrz(h5wLft,h5wRgt,h5axis,h5fLft,h5fRgt,h5First,h5STik,h5LTik,h5Label) ELSE CALL SliderAxisHrzPi(h5wLft,h5wRgt,h5axis,h5fLft,h5fRgt,h5First,h5STik,h5LTik,h5Label) END IF BOX KEEP h5sLft,h5sRgt,h5wBas,h5axis in h5slot$ CALL PlotSliderName(h5wLft,h5wBas,h5name$,h5clr) CALL h5Mark(n) END SUB SUB h5ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h5Name$,lw) CALL StringWidth(h5Form$,rw) BOX CLEAR h5slft-lw-10,h5srgt+rw+10,h5wBas,h5wTop END SUB ! --- animation and step button methods --- SUB h5AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h5wLft,h5wBas,h5AnimLft,h5AnimRgt,h5AnimBas,h5AnimTop) CALL AnimStopButton(h5wLft,h5wBas,h5StopLft,h5StopRgt,h5StopBas,h5StopTop) END IF IF moveState=1 then CALL LftMoveButton(h5wRgt,h5wbas,h5LmoveLft,h5LmoveRgt,h5LmoveBas,h5LmoveTop) CALL RgtMoveButton(h5wRgt,h5wbas,h5RmoveLft,h5RmoveRgt,h5RmoveBas,h5RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h5wRgt,h5wbas,h5LstpLft,h5LstpRgt,h5LstpBas,h5LstpTop) CALL RgtStepButton(h5wRgt,h5wbas,h5RstpLft,h5RstpRgt,h5RstpBas,h5RstpTop) END IF END SUB SUB h5StepButtons CALL LftStepButton(h5wRgt,h5wbas,h5LstpLft,h5LstpRgt,h5LstpBas,h5LstpTop) CALL RgtStepButton(h5wRgt,h5wbas,h5RstpLft,h5RstpRgt,h5RstpBas,h5RstpTop) END SUB SUB h5MoveButtons CALL h5StepButtons CALL LftMoveButton(h5wRgt,h5wbas,h5LmoveLft,h5LmoveRgt,h5LmoveBas,h5LmoveTop) CALL RgtMoveButton(h5wRgt,h5wbas,h5RmoveLft,h5RmoveRgt,h5RmoveBas,h5RmoveTop) END SUB SUB h5AnimButtons CALL AnimGoButton(h5wLft,h5wBas,h5AnimLft,h5AnimRgt,h5AnimBas,h5AnimTop) CALL AnimStopButton(h5wLft,h5wBas,h5StopLft,h5StopRgt,h5StopBas,h5StopTop) ! CALL h5MoveButtons CALL h5StepButtons END SUB SUB h5StopButton CALL StopButton(h5stopLft,h5stopRgt,h5stopBas,h5stopTop) END SUB SUB h5StopButtonClear BOX CLEAR h5stopLft,h5stopRgt,h5stopBas,h5stopTop END SUB END MODULE MODULE h6slider PUBLIC h6piAxis,h6Mult,h6axis,h6wLft,h6wRgt PUBLIC h6fLft,h6fRgt,h6First,h6STik,h6LTik,h6Label PUBLIC h6name$,h6form$,h6clr PUBLIC h6wBas,h6wTop,h6wWid,h6fWid,h6sLft,h6sRgt,h6fMin,h6fMax PUBLIC h6fratio,h6wratio,h6slot$ SHARE h6AnimLft,h6AnimRgt,h6AnimBas,h6AnimTop SHARE h6stopLft,h6stopRgt,h6stopBas,h6stopTop SHARE h6LstpLft,h6LstpRgt,h6LstpBas,h6LstpTop SHARE h6RstpLft,h6RstpRgt,h6RstpBas,h6RstpTop SHARE h6LmoveLft,h6LmoveRgt,h6LmoveBas,h6LmoveTop SHARE h6RmoveLft,h6RmoveRgt,h6RmoveBas,h6RmoveTop DEF h6Fncx(wx)= h6Mult * (h6fLft + h6fratio*(wx-h6wLft)) ! window to function DEF h6wndx(fx)= h6wLft + h6wratio * (fx/h6Mult - h6fLft) ! function to window ! --- slider interaction --- DEF h6Within(wx,wy) DECLARE DEF WithinWnd LET h6Within= WithinWnd(wx,wy,h6sLft,h6sRgt,h6wBas,h6wTop) END DEF SUB h6wClampfVal(wx,fx) DECLARE DEF h6Fncx LET wx= min(max(wx,h6wLft),h6wRgt) LET fx= h6Fncx(wx) END SUB SUB h6GetClickVal(ms,rn,n) DECLARE DEF h6Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h6Fncx(min(max(mx,h6wLft),h6wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h6Mark(n) END SUB SUB h6GetDragVal(ms,r,n) DECLARE DEF h6Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h6Fncx(min(max(mx,h6wLft),h6wRgt)) LET n = round(n,r) IF n<>oldn then CALL h6Mark(n) END SUB SUB h6Mark(n) DECLARE DEF h6Wndx LET wx= h6Wndx(n) BOX SHOW h6slot$ at h6sLft,h6wBas CALL SliderKnob(wx,h6wBas-5) LET n$= using$(h6form$,n) CALL PlotSliderValue(h6wRgt,h6wBas,n$,h6clr) END SUB DEF h6AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h6AnimStopWithin= WithinWnd(wx,wy,h6stopLft,h6stopRgt,h6stopBas,h6stopTop) END DEF SUB h6AnimStopButtonUp(ms) CALL MouseButtonUp(h6stopLft,h6stopRgt,h6stopBas,h6stopTop,ms) CALL h6StopButtonClear END SUB DEF h6AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h6AnimWithin= WithinWnd(wx,wy,h6AnimLft,h6AnimRgt,h6AnimBas,h6AnimTop) END DEF SUB h6AnimButtonUp(ms) CALL MouseButtonUp(h6AnimLft,h6AnimRgt,h6AnimBas,h6AnimTop,ms) CALL h6StopButton END SUB DEF h6LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h6LstpWithin= WithinWnd(wx,wy,h6LstpLft,h6LstpRgt,h6LstpBas,h6LstpTop) END DEF SUB h6LstpButtonUp(ms) CALL MouseButtonUp(h6LstpLft,h6LstpRgt,h6LstpBas,h6LstpTop,ms) END SUB SUB h6LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h6fMin) CALL h6Mark(n) END SUB DEF h6RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h6RstpWithin= WithinWnd(wx,wy,h6RstpLft,h6RstpRgt,h6RstpBas,h6RstpTop) END DEF SUB h6RstpButtonUp(ms) CALL MouseButtonUp(h6RstpLft,h6RstpRgt,h6RstpBas,h6RstpTop,ms) END SUB SUB h6RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h6fMax) CALL h6Mark(n) END SUB DEF h6LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h6LmoveWithin= WithinWnd(wx,wy,h6LmoveLft,h6LmoveRgt,h6LmoveBas,h6LmoveTop) END DEF SUB h6LmoveButtonDown CALL ButtonDown(h6LmoveLft,h6LmoveRgt,h6LmoveBas,h6LmoveTop) END SUB SUB h6LmoveButtonUp CALL ButtonUp(h6LmoveLft,h6LmoveRgt,h6LmoveBas,h6LmoveTop) END SUB DEF h6RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h6RmoveWithin= WithinWnd(wx,wy,h6RmoveLft,h6RmoveRgt,h6RmoveBas,h6RmoveTop) END DEF SUB h6RmoveButtonDown CALL ButtonDown(h6RmoveLft,h6RmoveRgt,h6RmoveBas,h6RmoveTop) END SUB SUB h6RmoveButtonUp CALL ButtonUp(h6RmoveLft,h6RmoveRgt,h6RmoveBas,h6RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h6SliderVariables CALL hWnd(h6axis,h6wLft,h6wRgt,h6wBas,h6wTop,h6wWid,h6sLft,h6sRgt) CALL hFnc(h6fLft,h6fRgt,h6fWid,h6Mult,h6fMin,h6fMax) CALL hRatios(h6fWid,h6wWid,h6fRatio,h6wRatio) END SUB SUB h6DrawSlider(h6name$,n) CALL h6ClearSlider CALL SliderSlotH(h6wLft,h6wRgt,h6axis) IF h6piAxis=0 then CALL SliderAxisHrz(h6wLft,h6wRgt,h6axis,h6fLft,h6fRgt,h6First,h6STik,h6LTik,h6Label) ELSE CALL SliderAxisHrzPi(h6wLft,h6wRgt,h6axis,h6fLft,h6fRgt,h6First,h6STik,h6LTik,h6Label) END IF BOX KEEP h6sLft,h6sRgt,h6wBas,h6axis in h6slot$ CALL PlotSliderName(h6wLft,h6wBas,h6name$,h6clr) CALL h6Mark(n) END SUB SUB h6ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h6Name$,lw) CALL StringWidth(h6Form$,rw) BOX CLEAR h6slft-lw-10,h6srgt+rw+10,h6wBas,h6wTop END SUB ! --- animation and step button methods --- SUB h6AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h6wLft,h6wBas,h6AnimLft,h6AnimRgt,h6AnimBas,h6AnimTop) CALL AnimStopButton(h6wLft,h6wBas,h6StopLft,h6StopRgt,h6StopBas,h6StopTop) END IF IF moveState=1 then CALL LftMoveButton(h6wRgt,h6wbas,h6LmoveLft,h6LmoveRgt,h6LmoveBas,h6LmoveTop) CALL RgtMoveButton(h6wRgt,h6wbas,h6RmoveLft,h6RmoveRgt,h6RmoveBas,h6RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h6wRgt,h6wbas,h6LstpLft,h6LstpRgt,h6LstpBas,h6LstpTop) CALL RgtStepButton(h6wRgt,h6wbas,h6RstpLft,h6RstpRgt,h6RstpBas,h6RstpTop) END IF END SUB SUB h6StepButtons CALL LftStepButton(h6wRgt,h6wbas,h6LstpLft,h6LstpRgt,h6LstpBas,h6LstpTop) CALL RgtStepButton(h6wRgt,h6wbas,h6RstpLft,h6RstpRgt,h6RstpBas,h6RstpTop) END SUB SUB h6MoveButtons CALL h6StepButtons CALL LftMoveButton(h6wRgt,h6wbas,h6LmoveLft,h6LmoveRgt,h6LmoveBas,h6LmoveTop) CALL RgtMoveButton(h6wRgt,h6wbas,h6RmoveLft,h6RmoveRgt,h6RmoveBas,h6RmoveTop) END SUB SUB h6AnimButtons CALL AnimGoButton(h6wLft,h6wBas,h6AnimLft,h6AnimRgt,h6AnimBas,h6AnimTop) CALL AnimStopButton(h6wLft,h6wBas,h6StopLft,h6StopRgt,h6StopBas,h6StopTop) ! CALL h6MoveButtons CALL h6StepButtons END SUB SUB h6StopButton CALL StopButton(h6stopLft,h6stopRgt,h6stopBas,h6stopTop) END SUB SUB h6StopButtonClear BOX CLEAR h6stopLft,h6stopRgt,h6stopBas,h6stopTop END SUB END MODULE MODULE h7slider PUBLIC h7piAxis,h7Mult,h7axis,h7wLft,h7wRgt PUBLIC h7fLft,h7fRgt,h7First,h7STik,h7LTik,h7Label PUBLIC h7name$,h7form$,h7clr PUBLIC h7wBas,h7wTop,h7wWid,h7fWid,h7sLft,h7sRgt,h7fMin,h7fMax PUBLIC h7fratio,h7wratio,h7slot$ SHARE h7AnimLft,h7AnimRgt,h7AnimBas,h7AnimTop SHARE h7stopLft,h7stopRgt,h7stopBas,h7stopTop SHARE h7LstpLft,h7LstpRgt,h7LstpBas,h7LstpTop SHARE h7RstpLft,h7RstpRgt,h7RstpBas,h7RstpTop SHARE h7LmoveLft,h7LmoveRgt,h7LmoveBas,h7LmoveTop SHARE h7RmoveLft,h7RmoveRgt,h7RmoveBas,h7RmoveTop DEF h7Fncx(wx)= h7Mult * (h7fLft + h7fratio*(wx-h7wLft)) ! window to function DEF h7wndx(fx)= h7wLft + h7wratio * (fx/h7Mult - h7fLft) ! function to window ! --- slider interaction --- DEF h7Within(wx,wy) DECLARE DEF WithinWnd LET h7Within= WithinWnd(wx,wy,h7sLft,h7sRgt,h7wBas,h7wTop) END DEF SUB h7wClampfVal(wx,fx) DECLARE DEF h7Fncx LET wx= min(max(wx,h7wLft),h7wRgt) LET fx= h7Fncx(wx) END SUB SUB h7GetClickVal(ms,rn,n) DECLARE DEF h7Fncx CALL MouseUp(mx,my,ms) LET oldn= n LET n = h7Fncx(min(max(mx,h7wLft),h7wRgt)) LET n = rn*round(n/rn) IF n<>oldn then CALL h7Mark(n) END SUB SUB h7GetDragVal(ms,r,n) DECLARE DEF h7Fncx GET MOUSE: mx,my,ms LET oldn= n LET n = h7Fncx(min(max(mx,h7wLft),h7wRgt)) LET n = round(n,r) IF n<>oldn then CALL h7Mark(n) END SUB SUB h7Mark(n) DECLARE DEF h7Wndx LET wx= h7Wndx(n) BOX SHOW h7slot$ at h7sLft,h7wBas CALL SliderKnob(wx,h7wBas-5) LET n$= using$(h7form$,n) CALL PlotSliderValue(h7wRgt,h7wBas,n$,h7clr) END SUB DEF h7AnimStopWithin(wx,wy) DECLARE DEF WithinWnd LET h7AnimStopWithin= WithinWnd(wx,wy,h7stopLft,h7stopRgt,h7stopBas,h7stopTop) END DEF SUB h7AnimStopButtonUp(ms) CALL MouseButtonUp(h7stopLft,h7stopRgt,h7stopBas,h7stopTop,ms) CALL h7StopButtonClear END SUB DEF h7AnimWithin(wx,wy) DECLARE DEF WithinWnd LET h7AnimWithin= WithinWnd(wx,wy,h7AnimLft,h7AnimRgt,h7AnimBas,h7AnimTop) END DEF SUB h7AnimButtonUp(ms) CALL MouseButtonUp(h7AnimLft,h7AnimRgt,h7AnimBas,h7AnimTop,ms) CALL h7StopButton END SUB DEF h7LstpWithin(wx,wy) DECLARE DEF WithinWnd LET h7LstpWithin= WithinWnd(wx,wy,h7LstpLft,h7LstpRgt,h7LstpBas,h7LstpTop) END DEF SUB h7LstpButtonUp(ms) CALL MouseButtonUp(h7LstpLft,h7LstpRgt,h7LstpBas,h7LstpTop,ms) END SUB SUB h7LeftStep(n,step) DECLARE DEF roundn LET n= roundn(n-step,step) LET n= max(n,h7fMin) CALL h7Mark(n) END SUB DEF h7RstpWithin(wx,wy) DECLARE DEF WithinWnd LET h7RstpWithin= WithinWnd(wx,wy,h7RstpLft,h7RstpRgt,h7RstpBas,h7RstpTop) END DEF SUB h7RstpButtonUp(ms) CALL MouseButtonUp(h7RstpLft,h7RstpRgt,h7RstpBas,h7RstpTop,ms) END SUB SUB h7RightStep(n,step) DECLARE DEF roundn LET n= roundn(n+step,step) LET n= min(n,h7fMax) CALL h7Mark(n) END SUB DEF h7LmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h7LmoveWithin= WithinWnd(wx,wy,h7LmoveLft,h7LmoveRgt,h7LmoveBas,h7LmoveTop) END DEF SUB h7LmoveButtonDown CALL ButtonDown(h7LmoveLft,h7LmoveRgt,h7LmoveBas,h7LmoveTop) END SUB SUB h7LmoveButtonUp CALL ButtonUp(h7LmoveLft,h7LmoveRgt,h7LmoveBas,h7LmoveTop) END SUB DEF h7RmoveWithin(wx,wy) DECLARE DEF WithinWnd LET h7RmoveWithin= WithinWnd(wx,wy,h7RmoveLft,h7RmoveRgt,h7RmoveBas,h7RmoveTop) END DEF SUB h7RmoveButtonDown CALL ButtonDown(h7RmoveLft,h7RmoveRgt,h7RmoveBas,h7RmoveTop) END SUB SUB h7RmoveButtonUp CALL ButtonUp(h7RmoveLft,h7RmoveRgt,h7RmoveBas,h7RmoveTop) END SUB ! --- slider creation, drawing, clearing --- SUB h7SliderVariables CALL hWnd(h7axis,h7wLft,h7wRgt,h7wBas,h7wTop,h7wWid,h7sLft,h7sRgt) CALL hFnc(h7fLft,h7fRgt,h7fWid,h7Mult,h7fMin,h7fMax) CALL hRatios(h7fWid,h7wWid,h7fRatio,h7wRatio) END SUB SUB h7DrawSlider(h7name$,n) CALL h7ClearSlider CALL SliderSlotH(h7wLft,h7wRgt,h7axis) IF h7piAxis=0 then CALL SliderAxisHrz(h7wLft,h7wRgt,h7axis,h7fLft,h7fRgt,h7First,h7STik,h7LTik,h7Label) ELSE CALL SliderAxisHrzPi(h7wLft,h7wRgt,h7axis,h7fLft,h7fRgt,h7First,h7STik,h7LTik,h7Label) END IF BOX KEEP h7sLft,h7sRgt,h7wBas,h7axis in h7slot$ CALL PlotSliderName(h7wLft,h7wBas,h7name$,h7clr) CALL h7Mark(n) END SUB SUB h7ClearSlider CALL SetTextFont(1,12,"bold") CALL StringWidth(h7Name$,lw) CALL StringWidth(h7Form$,rw) BOX CLEAR h7slft-lw-10,h7srgt+rw+10,h7wBas,h7wTop END SUB ! --- animation and step button methods --- SUB h7AnimMoveStep(animstate,movestate,stepstate) IF animState=1 then CALL AnimGoButton(h7wLft,h7wBas,h7AnimLft,h7AnimRgt,h7AnimBas,h7AnimTop) CALL AnimStopButton(h7wLft,h7wBas,h7StopLft,h7StopRgt,h7StopBas,h7StopTop) END IF IF moveState=1 then CALL LftMoveButton(h7wRgt,h7wbas,h7LmoveLft,h7LmoveRgt,h7LmoveBas,h7LmoveTop) CALL RgtMoveButton(h7wRgt,h7wbas,h7RmoveLft,h7RmoveRgt,h7RmoveBas,h7RmoveTop) END IF IF stepState=1 then CALL LftStepButton(h7wRgt,h7wbas,h7LstpLft,h7LstpRgt,h7LstpBas,h7LstpTop) CALL RgtStepButton(h7wRgt,h7wbas,h7RstpLft,h7RstpRgt,h7RstpBas,h7RstpTop) END IF END SUB SUB h7StepButtons CALL LftStepButton(h7wRgt,h7wbas,h7LstpLft,h7LstpRgt,h7LstpBas,h7LstpTop) CALL RgtStepButton(h7wRgt,h7wbas,h7RstpLft,h7RstpRgt,h7RstpBas,h7RstpTop) END SUB SUB h7MoveButtons CALL h7StepButtons CALL LftMoveButton(h7wRgt,h7wbas,h7LmoveLft,h7LmoveRgt,h7LmoveBas,h7LmoveTop) CALL RgtMoveButton(h7wRgt,h7wbas,h7RmoveLft,h7RmoveRgt,h7RmoveBas,h7RmoveTop) END SUB SUB h7AnimButtons CALL AnimGoButton(h7wLft,h7wBas,h7AnimLft,h7AnimRgt,h7AnimBas,h7AnimTop) CALL AnimStopButton(h7wLft,h7wBas,h7StopLft,h7StopRgt,h7StopBas,h7StopTop) ! CALL h7MoveButtons CALL h7StepButtons END SUB SUB h7StopButton CALL StopButton(h7stopLft,h7stopRgt,h7stopBas,h7stopTop) END SUB SUB h7StopButtonClear BOX CLEAR h7stopLft,h7stopRgt,h7stopBas,h7stopTop END SUB END MODULE MODULE SliderParts DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr ! --------- vertical routines ------- SUB vWnd(axx,wLft,wRgt,wBas,wTop,wHgt,sBas,sTop) LET wHgt = wBas-wTop LET wLft = axx-18 !13 LET wRgt = axx+14 LET sBas = wBas+5 LET sTop = wTop-5 END SUB SUB vFnc(fBas,fTop,fHgt) LET fHgt = fTop-fBas END SUB SUB vRatios(vfHgt,vwHgt,vfratio,vwratio) LET vfratio= vfHgt/vwHgt LET vwratio= vwHgt/vfHgt END SUB SUB PlotVSliderName(Mid,Bas,name$,clr) CALL SetTextFont(1,12,"bold") CALL SuperSubScriptCJ(Mid+6,Bas+15,name$,clr) END SUB SUB PlotVSliderValue(Mid,Bas,value$,form$,clr) CALL SetTextFont(1,12,"bold") CALL StringWidth(form$,sw) LET hwid= sw/2 + 5 BOX CLEAR mid-hwid,mid+hwid,Bas,Bas-13 CALL PlotTextCJ(Mid,Bas-3,trim$(value$),clr) END SUB SUB SliderslotV(wb,wt,axis) LET sx= axis+8 BOX CLEAR axis+1,axis+14,wb+4,wt-4 SET COLOR slotdrkclr BOX AREA sx,sx-1,wb+1,wt-1 SET COLOR slotlgtclr PLOT sx+1,wb+1; sx+1,wt-1 END SUB SUB PhaseSlotV(sLft,sRgt,syb,syt,sx,sliderV$) BOX CLEAR sLft,sRgt,syb,syt SET COLOR white PLOT sx+1,syb-4; sx+1,syt+4 BOX KEEP sLft,sRgt,syb,syt in sliderV$ END SUB SUB SliderAxisVrt(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp) CALL VNumberLineTiks (wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,-1) CALL VNumberLineLabels(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,-1) END SUB SUB SliderAxisVrtPi(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp) CALL VNumberLineTiks (wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,-1) CALL VNumberLineLabelsPi(wBas,wTop,wAxis,fBas,fTop,first,stp1,stp2,nstp,-1) END SUB SUB SliderKnobV(kx,ky) SET COLOR black BOX AREA kx-3,kx+4,ky+3,ky-2 BOX AREA kx-4,kx+5,ky+2,ky-1 SET COLOR litmid BOX AREA kx-3,kx+3,ky+2,ky-2 BOX AREA kx-4,kx+4,ky+1,ky-1 SET COLOR white PLOT kx-4,ky; kx-6,ky SET COLOR litgry PLOT kx-3,ky-2; kx+2,ky-2 PLOT kx-3,ky+2; kx+2,ky+2 PLOT kx-4,ky-1; kx-4,ky+1 SET COLOR white PLOT kx-2,ky; kx+2,ky END SUB ! ----- horizontal slider routines ------ SUB hWnd(axy,wLft,wRgt,wBas,wTop,wWid,sLft,sRgt) LET wWid = wRgt-wLft LET wTop = axy-17 LET wBas = axy+14 LET sLft = wLft-5 LET sRgt = wRgt+5 END SUB SUB hFnc(fLft,fRgt,fWid,mult,fMin,fMax) LET fWid = fRgt-fLft LET fMin = fLft*mult LET fMax = fRgt*mult END SUB SUB hRatios(hfWid,hwWid,hfratio,hwratio) LET hfratio= hfWid/hwWid LET hwratio= hwWid/hfWid END SUB SUB PlotSliderName(Lft,Bas,name$,clr) CALL SetTextFont(1,12,"bold") CALL SuperSubScriptRJ(Lft-8,Bas-3,name$,clr) END SUB SUB PlotSliderValue(Rgt,Bas,value$,clr) CALL SetTextFont(1,12,"bold") CALL StringWidth(value$,sw) LET r= Rgt+sw+10 BOX CLEAR Rgt+6,r,Bas,Bas-13 CALL PlotTextLJ(Rgt+7,Bas-3,trim$(value$),clr) END SUB SUB SliderSlotH(wl,wr,axis) LET sy= axis+8 BOX CLEAR wl-4,wr+4,axis+14,axis+1 SET COLOR slotdrkclr BOX AREA wl-1,wr+1,sy,sy-1 SET COLOR slotlgtclr PLOT wl-1,sy+1; wr+1,sy+1 END SUB SUB SliderAxisHrz(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp) CALL HNumberLineTiks (wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,-1) CALL HNumberLineLabels(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,-1) END SUB SUB SliderAxisHrzPi(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp) CALL HNumberLineTiks (wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,-1) CALL HNumberLineLabelsPi(wLft,wRgt,wBas,fLft,fRgt,first,stp1,stp2,nstp,-1) END SUB SUB SliderKnob(kx,ky) ! IF colorscheme=1 then ! SET COLOR black ! BOX AREA kx-2,kx+3,ky+4,ky-3 ! BOX AREA kx-1,kx+2,ky+5,ky-3 ! ! SET COLOR drkmid ! BOX AREA kx-2,kx+2,ky+2,ky-3 ! BOX AREA kx-1,kx+1,ky+4,ky-4 ! ! SET COLOR litgry ! PLOT kx-2,ky-3; kx-2,ky+2 ! PLOT kx+2,ky-3; kx+2,ky+2 ! PLOT kx-1,ky-4; kx+1,ky-4 ! ! SET COLOR black ! PLOT kx,ky-4; kx,ky-6 ! SET COLOR white ! PLOT kx,ky+3; kx,ky-2 ! ELSE ! SET COLOR black ! BOX AREA kx-3,kx+4,ky+5,ky-3 ! BOX AREA kx-2,kx+3,ky+6,ky-4 ! ! SET COLOR drkmid ! BOX AREA kx-3,kx+3,ky+3,ky-3 ! BOX AREA kx-2,kx+2,ky+5,ky-4 ! ! SET COLOR litgry ! PLOT kx-3,ky-3; kx-3,ky+3 ! PLOT kx+3,ky-3; kx+3,ky+3 ! PLOT kx-2,ky-4; kx+2,ky-4 ! ! SET COLOR white ! PLOT kx,ky-4; kx,ky-7 ! plot kx-1,ky-5; kx+1,ky-5 ! PLOT kx,ky+4; kx,ky-2 ! SET COLOR black ! BOX AREA kx-2,kx+3,ky+5,ky-3 ! BOX AREA kx-1,kx+2,ky+6,ky-4 ! ! SET COLOR litmid ! BOX AREA kx-2,kx+2,ky+3,ky-3 ! BOX AREA kx-1,kx+1,ky+5,ky-4 ! ! SET COLOR litgry ! PLOT kx-2,ky-3; kx-2,ky+3 ! PLOT kx+2,ky-3; kx+2,ky+3 ! PLOT kx-1,ky-4; kx+1,ky-4 ! ! SET COLOR white ! PLOT kx,ky-4; kx,ky-6 ! PLOT kx,ky+4; kx,ky-2 SET COLOR black BOX AREA kx-2,kx+3,ky+4,ky-3 BOX AREA kx-1,kx+2,ky+5,ky-4 SET COLOR litmid BOX AREA kx-2,kx+2,ky+2,ky-3 BOX AREA kx-1,kx+1,ky+4,ky-4 SET COLOR litgry PLOT kx-2,ky-3; kx-2,ky+2 PLOT kx+2,ky-3; kx+2,ky+2 PLOT kx-1,ky-4; kx+1,ky-4 SET COLOR white PLOT kx,ky-4; kx,ky-6 PLOT kx,ky+3; kx,ky-2 ! END IF END SUB ! ----- other slider parts ----- ! animate, move, and step buttons SUB DrawGreaterThan(wx,wy,clr) SET COLOR clr LET size = 3 LET size2= 2*size LET wx1 = wx+1 PLOT wx ,wy; wx+size ,wy-size; wx ,wy-size2 PLOT wx1,wy; wx1+size,wy-size; wx1,wy-size2 END SUB SUB DrawLessThan(wx,wy,clr) SET COLOR clr LET size = 3 LET size2= 2*size LET wx1 = wx+1 PLOT wx ,wy; wx-size ,wy-size; wx ,wy-size2 PLOT wx1,wy; wx1-size,wy-size; wx1,wy-size2 END SUB SUB AnimGoButton(wlft,wbas,AnimLft,AnimRgt,AnimBas,AnimTop) LET AnimBtnHgt= 14 LET AnimBtnWid= 24 LET AnimLft= wLft LET AnimRgt= AnimLft + AnimBtnWid LET AnimTop= wBas + 4 LET AnimBas= AnimTop + AnimBtnHgt CALL DrawButton(AnimLft,AnimRgt,AnimBas,AnimTop,4,"") CALL DrawGreaterThan(AnimLft+ 5,AnimBas-4,litgry) CALL DrawGreaterThan(AnimLft+10,AnimBas-4,litgry) CALL DrawGreaterThan(AnimLft+15,AnimBas-4,litgry) END SUB SUB AnimStopButton(wlft,wbas,StopLft,StopRgt,StopBas,StopTop) LET StopBtnHgt= 14 LET StopBtnWid= 14 LET StopLft= wLft + 26 LET StopRgt= StopLft + StopBtnWid LET StopTop= wBas + 4 LET StopBas= StopTop + StopBtnHgt ! CALL StopButton(StopLft,StopRgt,StopBas,StopTop) END SUB SUB LftStepButton(wrgt,wbas,LftStepLft,LftStepRgt,LftStepBas,LftStepTop) LET LftStepBtnHgt= 14 LET LftStepBtnWid= 14 LET LftStepLft= wrgt - 50 LET LftStepRgt= LftStepLft + LftStepBtnWid LET LftStepTop= wBas + 4 LET LftStepBas= LftStepTop + LftStepBtnHgt CALL DrawButton(LftStepLft,LftStepRgt,LftStepBas,LftStepTop,4,"") CALL DrawLessThan(LftStepLft+7,LftStepBas-4,litgry) END SUB SUB RgtStepButton(wrgt,wbas,RgtStepLft,RgtStepRgt,RgtStepBas,RgtStepTop) LET RgtStepBtnHgt= 14 LET RgtStepBtnWid= 14 LET RgtStepLft= wrgt - 34 LET RgtStepRgt= RgtStepLft + RgtStepBtnWid LET RgtStepTop= wBas + 4 LET RgtStepBas= RgtStepTop + RgtStepBtnHgt CALL DrawButton(RgtStepLft,RgtStepRgt,RgtStepBas,RgtStepTop,4,"") CALL DrawGreaterThan(RgtStepLft+6,RgtStepBas-4,litgry) END SUB SUB LftMoveButton(wrgt,wbas,LftMoveLft,LftMoveRgt,LftMoveBas,LftMoveTop) LET LftMoveBtnHgt= 14 LET LftMoveBtnWid= 18 LET LftMoveLft= wrgt - 70 LET LftMoveRgt= LftMoveLft + LftMoveBtnWid LET LftMoveTop= wBas + 4 LET LftMoveBas= LftMoveTop + LftMoveBtnHgt CALL DrawButton(LftMoveLft,LftMoveRgt,LftMoveBas,LftMoveTop,4,"") CALL DrawLessThan(LftMoveLft+ 7,LftMoveBas-4,litgry) CALL DrawLessThan(LftMoveLft+12,LftMoveBas-4,litgry) END SUB SUB RgtMoveButton(wrgt,wbas,RgtMoveLft,RgtMoveRgt,RgtMoveBas,RgtMoveTop) LET RgtMoveBtnHgt= 14 LET RgtMoveBtnWid= 18 LET RgtMoveLft= wrgt - 18 LET RgtMoveRgt= RgtMoveLft + RgtMoveBtnWid LET RgtMoveTop= wBas + 4 LET RgtMoveBas= RgtMoveTop + RgtMoveBtnHgt CALL DrawButton(RgtMoveLft,RgtMoveRgt,RgtMoveBas,RgtMoveTop,4,"") CALL DrawGreaterThan(RgtMoveLft+ 5,RgtMoveBas-4,litgry) CALL DrawGreaterThan(RgtMoveLft+10,RgtMoveBas-4,litgry) END SUB SUB StopButton(l,r,b,t) LET r= l+14 LET t= b-14 CALL DrawButton(l,r,b,t,0,"") LET midx= l+7 LET midy= t+7 LET sz = 2 LET hlft= midx-sz LET hrgt= midx+sz LET hbas= midy+sz LET htop= midy-sz CALL BoxArea(hlft,hrgt,hbas,htop,red) END SUB END MODULE MODULE TypeSetting DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr ! ---- type subs ---- SUB PlotTextLJ(tx,ty,t$,clr) DECLARE PUBLIC M68kFlag SET COLOR clr IF M68kflag=1 then PLOT TEXT, AT tx,ty: t$ ! 4.04 ELSE PLOT TEXT, AT tx,ty+1: t$ ! TB5 END IF END SUB SUB PlotTextCJ(midb,ty,t$,clr) CALL StringWidth(t$,sl) LET Lft= midb - int(sl/2) CALL PlotTextLJ(Lft,ty,t$,clr) END SUB SUB PlotTextRJ(Rgt,ty,t$,clr) CALL StringWidth(t$,sl) LET Lft= Rgt - sl CALL PlotTextLJ(Lft,ty,t$,clr) END SUB SUB DropTextLJ(tx,ty,t$,clr) CALL PlotTextLJ(tx+1,ty+1,t$,black) CALL PlotTextLJ(tx,ty,t$,clr) END SUB SUB DropTextCJ(midb,ty,t$,clr) CALL StringWidth(t$,sl) LET Lft= midb - int(sl/2) CALL DropTextLJ(Lft,ty,t$,clr) END SUB SUB DropTextRJ(Rgt,ty,t$,clr) CALL StringWidth(t$,sl) LET Lft= Rgt - sl CALL DropTextLJ(Lft,ty,t$,clr) END SUB SUB AlignEqual(ex,ey,eq$,ec) LET e = pos(eq$,"=") LET Lft$= eq$(1:e) CALL StringWidth(Lft$,sl) CALL PlotTextLJ(ex-sl,ey,eq$,ec) END SUB SUB AlignDot(dx,dy,n$,dc) LET d = pos(n$,".") LET Lft$= n$(1:d) CALL StringWidth(Lft$,sl) CALL PlotTextLJ(dx-sl,dy,n$,dc) END SUB SUB VarDot(lft,bas,v$,clr) SET COLOR clr IF v$="t" then PLOT TEXT, AT lft,bas: v$ CALL StringWidth(".",sl) PLOT TEXT, AT lft+3-sl/2,bas-10: "." ELSE PLOT TEXT, AT lft,bas: v$ CALL StringWidth(".",sl) PLOT TEXT, AT lft+4-sl/2,bas-9: "." END IF END SUB SUB AlignSuper(asx,ty,pnts,clr,txt$) LET chx= asx SET COLOR clr LET lft$,rgt$,exp$= "" LET l = len(txt$) LET p = pos(txt$,"^") IF p=0 then SET COLOR clr !PLOT TEXT, AT chx,ty: txt$ CALL PlotTextLJ(chx,ty,txt$,clr) ELSE LET lft$= txt$(1:p-1) LET rgt$= txt$(p+1:l) LET l = len(rgt$) IF rgt$(1:1)= "(" then LET p = pos(rgt$,")") LET exp$= rgt$(1:p) LET rgt$= rgt$(p+1:l) ELSE IF len(rgt$)=1 then LET exp$= rgt$ LET rgt$="" ELSE FOR i= 2 to l LET c$= rgt$(i:i) IF c$= " " or c$= "+" or c$= "-" or c$= "*" or c$= ")" then LET exp$= rgt$(1:i-1) LET rgt$= rgt$(i:l) EXIT FOR ELSE IF i=l then LET exp$= rgt$(1:l) LET rgt$= "" EXIT FOR END IF NEXT i END IF CALL SetTextFont(1,12,"bold") CALL StringWidth(lft$,ll) CALL PlotTextLJ(chx,ty,lft$,clr) CALL SetTextFont(1, 9,"bold") CALL StringWidth(exp$,el) CALL PlotTextLJ(chx+ll,ty-pnts,exp$,clr) LET chx= chx+ll+el LET txt$= rgt$ LET lft$,rgt$,exp$= "" LET l = len(txt$) LET p = pos(txt$,"^") IF p<>0 then LET lft$= txt$(1:p-1) LET rgt$= txt$(p+1:l) LET l = len(rgt$) IF rgt$(1:1)= "(" then LET p = pos(rgt$,")") LET exp$= rgt$(1:p) LET rgt$= rgt$(p+1:l) ELSE IF len(rgt$)=1 then LET exp$= rgt$ LET rgt$="" ELSE FOR i= 2 to l LET c$= rgt$(i:i) IF c$= " " or c$= "+" or c$= "-" or c$= "*" or c$= ")" then LET exp$= rgt$(1:i-1) LET rgt$= rgt$(i:l) EXIT FOR ELSE IF i=l then LET exp$= rgt$(1:l) LET rgt$= "" EXIT FOR END IF NEXT i END IF CALL SetTextFont(1,12,"bold") CALL StringWidth(lft$,ll) CALL PlotTextLJ(chx,ty,lft$,clr) CALL SetTextFont(1, 9,"bold") CALL StringWidth(exp$,el) CALL PlotTextLJ(chx+ll,ty-pnts,exp$,clr) CALL SetTextFont(1,12,"bold") PLOT TEXT, AT chx+ll+el,ty: rgt$ CALL PlotTextLJ(chx+ll+el,ty, rgt$,clr) ELSE CALL SetTextFont(1,12,"bold") PLOT TEXT, AT chx,ty: txt$ CALL PlotTextLJ(chx,ty, txt$,clr) END IF END IF END SUB SUB MeasureSuperSub(super$,pix) LOCAL p,last,p0,p1,p2,ll,el,rl LOCAL Lft$,exp$,Rgt$ LET Lft$,exp$,Rgt$= "" LET p0 = pos(super$,"^") LET p1 = pos(super$,"_") LET last= len(super$) CALL SetTextFont(1,12,"bold") IF p0=0 and p1=0 then CALL StringWidth(super$,sw) LET pix= pix+sw ELSE IF p0=0 then LET p= p1 ELSE IF p1=0 then LET p= p0 ELSE LET p= min(p1,p0) END IF LET Lft$= super$(1:p-1) LET p2 = pos(super$,"]") IF p2=0 then EXIT SUB LET exp$= super$(p+2:p2-1) LET Rgt$= super$(p2+1:last) CALL StringWidth(Lft$,ll) CALL SetTextFont(1,9,"bold") CALL StringWidth(exp$,el) LET pix= pix+ll+el IF Rgt$<>"" then CALL MeasureSuperSub(Rgt$,pix) END IF END IF END SUB SUB SuperSubScriptLJ(sx,sy,super$,sclr) CALL SuperSubScript(sx,sy,super$,sclr) END SUB SUB SuperSubScriptRJ(sx,sy,super$,sclr) LET sl = 0 CALL MeasureSuperSub(super$,sl) LET Lft= sx - sl CALL SuperSubScript(Lft,sy,super$,sclr) END SUB SUB SuperSubScriptCJ(sx,sy,super$,sclr) LET sl = 0 CALL MeasureSuperSub(super$,sl) LET Lft= sx - int(sl/2) CALL SuperSubScript(Lft,sy,super$,sclr) END SUB SUB SuperSubScript(wx,wy,super$,sclr) LET sx= wx LET sy= wy LOCAL p,last,p0,p1,p2,ll,el,rl LOCAL Lft$,exp$,Rgt$ LET Lft$,exp$,Rgt$= "" LET p0 = pos(super$,"^") LET p1 = pos(super$,"_") LET last= len(super$) CALL SetTextFont(1,12,"bold") IF p0=0 and p1=0 then CALL PlotTextLJ(sx,sy,super$,sclr) ELSE IF p0=0 then LET p= p1 ELSE IF p1=0 then LET p= p0 ELSE LET p= min(p1,p0) END IF LET Lft$= super$(1:p-1) LET p2 = pos(super$,"]") IF p2=0 then EXIT SUB LET exp$= super$(p+2:p2-1) LET Rgt$= super$(p2+1:last) CALL PlotTextLJ(sx,sy,Lft$,sclr) CALL StringWidth(Lft$,ll) LET sx= sx + ll + 2 CALL SetTextFont(1,9,"bold") CALL StringWidth(exp$,el) IF p0=p then ! super script CALL PlotTextLJ(sx,sy-5,exp$,sclr) ELSE IF p1=p then ! sub script CALL PlotTextLJ(sx,sy+3,exp$,sclr) END IF CALL SetTextFont(1,12,"bold") IF Rgt$<>"" then CALL SuperSubScriptLJ(sx+el,sy,Rgt$,sclr) END IF END IF END SUB SUB PlotDegreesLJ(wx,wy,degrees,clr) ! DEF RadToDeg(rad)= rad*180/pi LET n$= str$(degrees) CALL StringWidth(n$,sw) LET cx= wx+sw+3 ! degree circle center x LET cy= wy-8 BOX CLEAR wx-3,wx+40,wy+5,wy-15 CALL PlotTextLJ(wx,wy,n$,clr) CALL BoxCircle(cx-2,cx+2,cy+2,cy-2,clr) END SUB SUB PlotDegreesCJ(wx,wy,degrees,clr) ! DEF RadToDeg(rad)= rad*180/pi LET n$= trim$(using$("---%",round(degrees))) CALL StringWidth(n$,sw) LET lft= wx - sw/2 LET cx = lft + sw + 3 LET cy = wy - 8 ! BOX CLEAR wx-3,wx+40,wy+5,wy-15 CALL PlotTextLJ(lft,wy,n$,clr) CALL BoxCircle(cx-2,cx+2,cy+2,cy-2,clr) END SUB SUB CmplxStr(cmplx$,real,imag) ! Numeric to text LOCAL x$,y$ LET x$= using$("-%.##",round(real,2)) LET y$= using$("%.##",abs(round(imag,2))) IF imag<0 then LET sign$= " - " else LET sign$= " + " LET cmplx$= "( " & x$ & sign$ & y$ & " i )" END SUB SUB CmplxStringTrim(cmplx$,real,imag) ! Numeric to text LOCAL x$,y$ LET x$= trim$(using$("-%.##",round(real,2))) LET y$= trim$(using$("--%.##",abs(round(imag,2)))) IF imag<0 then LET sign$= " - " else LET sign$= " + " ! LET cmplx$= "( " & x$ & sign$ & y$ & " i )" LET cmplx$= x$ & sign$ & y$ & " i" END SUB SUB CmplxText(Lft,Bas,rl,im,clr) LET rldot = Lft+35 LET imdot = rldot+50 LET ix = imdot+20 LET txtrl$= trim$(using$("--%.##",rl)) LET txtim$= trim$(using$("++%.##",im)) CALL PlotTextLJ(Lft,Bas,"(",clr) CALL AlignDot(rldot,Bas,txtrl$,clr) CALL AlignDot(imdot,Bas,txtim$,clr) CALL PlotTextLJ(ix,Bas,"i )",clr) END SUB SUB ComplexTextN(Lft,Bas,rl,im,clr) LET rldot = Lft+25 LET imdot = rldot+50 LET ix = imdot+20 LET txtrl$= trim$(using$("--%.##",rl)) LET txtim$= trim$(using$("++%.##",im)) ! CALL PlotTextLJ(Lft,Bas,"(",clr) CALL AlignDot(rldot,Bas,txtrl$,clr) CALL AlignDot(imdot,Bas,txtim$,clr) CALL PlotTextLJ(ix,Bas,"i",clr) END SUB END MODULE MODULE GreekMathSymbols SHARE phi(0:10,0:6) SHARE phiwid,phihmax,phivmax LET phihmax= 6 LET phivmax= 10 LET phiwid = 11 ! includes letterspace MAT READ phi DATA 0,0,0,1,0,0,0 DATA 0,0,0,1,0,0,0 DATA 0,1,1,1,1,1,0 DATA 1,1,0,1,0,1,1 DATA 1,1,0,1,0,1,1 DATA 1,1,0,1,0,1,1 DATA 1,1,0,1,0,1,1 DATA 1,1,0,1,0,1,1 DATA 0,1,1,1,1,1,0 DATA 0,0,0,1,0,0,0 DATA 0,0,0,1,0,0,0 SHARE omega(0:6,0:9) SHARE omegawid,omegahmax,omegavmax LET omegahmax= 9 LET omegavmax= 6 LET omegawid = 11 MAT READ omega DATA 0,1,1,0,0,0,0,1,1,0 DATA 1,1,0,0,0,0,0,0,1,1 DATA 1,1,0,0,1,1,0,0,1,1 DATA 1,1,0,0,1,1,0,0,1,1 DATA 1,1,0,0,1,1,0,0,1,1 DATA 0,1,1,1,1,1,1,1,1,0 DATA 0,0,1,1,0,0,1,1,0,0 SHARE OmegaN(0:9,0:15) SHARE OmegaNwid,OmegaNvmax,OmegaNhmax LET OmegaNhmax= 15 LET OmegaNvmax= 9 LET OmegaNwid = 17 MAT READ OmegaN DATA 0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0 DATA 1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0 DATA 1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0 DATA 1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0 DATA 1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0 DATA 0,1,1,1,1,1,1,1,1,0,0,1,0,1,1,0 DATA 0,0,1,1,0,0,1,1,0,0,0,1,1,0,1,1 DATA 0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1 DATA 0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1 DATA 0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1 SHARE lambda(0:8,0:8) SHARE lambdawid,lambdavmax,lambdahmax LET lambdahmax= 8 LET lambdavmax= 8 LET lambdawid = 10 MAT READ lambda DATA 0,1,1,0,0,0,0,0,0 DATA 1,0,1,1,0,0,0,0,0 DATA 0,0,0,1,1,0,0,0,0 DATA 0,0,0,1,1,0,0,0,0 DATA 0,0,0,1,1,1,0,0,0 DATA 0,0,1,1,1,1,0,0,0 DATA 0,1,1,0,0,1,1,0,0 DATA 1,1,0,0,0,1,1,0,1 DATA 1,0,0,0,0,0,1,1,0 SHARE PiChar(0:7,0:9) SHARE Piwid,Pivmax,Pihmax LET Pihmax= 9 LET Pivmax= 7 LET piwid = 11 MAT READ PiChar DATA 0,0,0,0,0,0,0,1,1,0 DATA 0,1,1,1,1,1,1,1,0,0 DATA 1,1,1,1,0,0,1,1,0,0 DATA 0,0,1,1,0,0,1,1,0,0 DATA 0,0,1,1,0,0,1,1,0,0 DATA 0,0,1,1,0,0,1,1,0,0 DATA 0,0,1,1,0,0,1,1,0,1 DATA 0,1,1,0,0,0,0,1,1,0 SHARE theta(0:8,0:7) SHARE thetawid,thetavmax,thetahmax LET thetahmax= 7 LET thetavmax= 8 LET thetawid = 9 MAT READ theta DATA 0,0,1,1,1,1,0,0 DATA 0,1,1,0,0,1,1,0 DATA 1,1,0,0,0,0,1,1 DATA 1,1,0,0,0,0,1,1 DATA 1,1,1,1,1,1,1,1 DATA 1,1,0,0,0,0,1,1 DATA 1,1,0,0,0,0,1,1 DATA 0,1,1,0,0,1,1,0 DATA 0,0,1,1,1,1,0,0 SUB SwapPhi(lft,bas,t$,c$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=c$ then LET x= x+1 CALL DrawPhi12(x+2,bas,clr) LET x= x+phiwid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB DrawPhi12(lft,bas,clr) SET COLOR clr LET top= bas-phivmax+1 FOR row= 0 to phivmax LET wy= top+row FOR col= 0 to phihmax LET bit= phi(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB SUB SwapOmega(lft,bas,t$,c$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=c$ then LET x= x+1 CALL DrawOmega12(x,bas,clr) LET x= x+omegawid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB SwapOmegaAndPhi(lft,bas,t$,o$,p$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=p$ then LET x= x+2 CALL DrawPhi12(x,bas,clr) LET x= x+phiwid ELSE IF ch$= o$ then LET x= x+2 CALL DrawOmega12(x,bas,clr) LET x= x+omegawid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB DrawOmega12(lft,bas,clr) SET COLOR clr LET top= bas-omegavmax FOR row= 0 to omegavmax LET wy= top+row FOR col= 0 to omegahmax LET bit= omega(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB SUB SwapOmegaN(lft,bas,t$,c$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=c$ then LET x= x+1 CALL DrawOmegaN12(x,bas,clr) LET x= x+OmegaNwid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB DrawOmegaN12(lft,bas,clr) SET COLOR clr LET top= bas-OmegaNvmax + 3 FOR row= 0 to OmegaNvmax LET wy= top+row FOR col= 0 to OmegaNhmax LET bit= OmegaN(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB SUB DrawLam(lft,bas,clr) SET COLOR clr LET top= bas-lambdavmax FOR row= 0 to lambdavmax LET wy= top+row FOR col= 0 to lambdahmax LET bit= lambda(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB SUB InitPi(wx,wy,clr,pi$) CALL DrawPi12(wx,wy,clr) BOX KEEP wx,wx+9,wy,wy-7 in pi$ BOX CLEAR wx,wx+9,wy,wy-7 END SUB SUB SwapPi(lft,bas,t$,c$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=c$ then LET x= x+1 CALL DrawPi12(x,bas,clr) LET x= x+piwid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB DrawPi12(lft,bas,clr) SET COLOR clr LET top= bas-Pivmax FOR row= 0 to Pivmax LET wy= top+row FOR col= 0 to PIhmax LET bit= PiChar(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB SUB SwapTheta(lft,bas,t$,c$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=c$ then LET x= x+1 CALL DrawTheta12(x,bas,clr) LET x= x+thetawid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB DrawTheta12(lft,bas,clr) SET COLOR clr LET top= bas-thetavmax FOR row= 0 to thetavmax LET wy= top+row FOR col= 0 to thetahmax LET bit= theta(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB SUB SwapThetaPi(lft,bas,txt$,th$,pi$,clr) LET l= len(txt$) LET x= lft FOR i= 1 to l LET ch$= txt$(i:i) IF ch$=th$ then LET x= x+1 CALL DrawTheta12(x+1,bas,clr) LET x= x+thetawid ELSE IF ch$=pi$ then LET x= x+1 CALL DrawPi12(x,bas,clr) LET x= x+piwid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB END MODULE MODULE OmegaWithSubAndSuperScripts ! ----- start supersubomega module ----- !LET txt$= "stuff + w_[0]^[2] = 46" !CALL SuperSubScriptOmegaLJ(200,150,txt$,"w",1) ! !LET txt$= "stuff + w_[0]^[2] = 46" !CALL SuperSubScriptOmegaRJ(200,170,txt$,"w",1) SUB SuperSubScriptOmegaRJ(sx,sy,super$,c$,sclr) LET text$= super$ CALL MeasureSuperSubOmega(text$,pix) LET lft= sx-pix CALL SuperSubScriptOmegaLJ(lft,sy,super$,"w",sclr) END SUB SUB SuperSubScriptOmegaCJ(sx,sy,super$,c$,sclr) LET text$= super$ CALL MeasureSuperSubOmega(text$,pix) LET lft= sx-pix/2 CALL SuperSubScriptOmegaLJ(lft,sy,super$,"w",sclr) END SUB SUB SuperSubScriptOmegaLJ(sx,sy,super$,c$,sclr) LOCAL p,last,p0,p1,p2,ll,el,rl LOCAL Lft$,exp$,Rgt$ LET Lft$,exp$,Rgt$= "" LET p0 = pos(super$,"^") LET p1 = pos(super$,"_") LET last= len(super$) CALL SetTextFont(1,12,"bold") IF p0=0 and p1=0 then ! CALL PlotTextLJ(sx,sy,super$,sclr) CALL SwapOmega(sx,sy,super$,c$,sclr) ELSE IF p0=0 then LET p= p1 ELSE IF p1=0 then LET p= p0 ELSE LET p= min(p1,p0) END IF LET Lft$= super$(1:p-1) LET p2 = pos(super$,"]") IF p2=0 then EXIT SUB LET exp$= super$(p+2:p2-1) LET Rgt$= super$(p2+1:last) CALL StringWidth(Lft$,ll) ! CALL PlotTextLJ(sx,sy,Lft$,sclr) CALL SwapOmega(sx,sy,lft$,c$,sclr) CALL SetTextFont(1,9,"bold") CALL StringWidth(exp$,el) IF p0=p then CALL PlotTextLJ(sx+ll,sy-5,exp$,sclr) ELSE IF p1=p then CALL PlotTextLJ(sx+ll,sy+3,exp$,sclr) END IF CALL SetTextFont(1,12,"bold") IF Rgt$<>"" then CALL SuperSubScriptOmegaLJ(sx+ll+el,sy,Rgt$,c$,sclr) END IF END IF END SUB SUB MeasureSuperSubOmega(super$,pix) LOCAL p,last,p0,p1,p2,ll,el,rl LOCAL Lft$,exp$,Rgt$ LET Lft$,exp$,Rgt$= "" LET p0 = pos(super$,"^") LET p1 = pos(super$,"_") LET last= len(super$) CALL SetTextFont(1,12,"bold") IF p0=0 and p1=0 then CALL StringWidth(super$,sw) LET pix= pix+sw ELSE IF p0=0 then LET p= p1 ELSE IF p1=0 then LET p= p0 ELSE LET p= min(p1,p0) END IF LET Lft$= super$(1:p-1) LET p2 = pos(super$,"]") IF p2=0 then EXIT SUB LET exp$= super$(p+2:p2-1) LET Rgt$= super$(p2+1:last) CALL StringWidth(Lft$,ll) CALL SetTextFont(1,9,"bold") CALL StringWidth(exp$,el) LET pix= pix+ll+el IF Rgt$<>"" then CALL MeasureSuperSubOmega(Rgt$,pix) END IF END IF END SUB END MODULE ! ----- end of supersubomega module ----- MODULE NumericInputEditor DECLARE PUBLIC backclr,black,drkgry,midgry,litgry,white DECLARE PUBLIC PCflag,Mac5flag,M68Kflag,Unixflag,xmax,ymax PUBLIC chspc,inpChrSpc ! ---- keyboard input editor ---- SUB BoxEditN(editlft,editrgt,editbas,edittop,line$,number,exit,mx,my,basline,clr) LOCAL bakclr,txtlft,chrlft,txttop,sl,inpnt LOCAL k,i,s,p,n,length,xpos,xline DO while key input GET KEY k LOOP LET length = len(line$) ! Find length LET width = editrgt-editlft LET maxchar= 6 !int(width/InpChrSpc)-1 LET bakclr = 0 LET exit = 0 LET txtlft = editlft+4 LET chrlft = txtlft LET txttop = edittop+3 SET COLOR bakclr BOX AREA editlft,editrgt,editbas,edittop BOX KEEP editlft,editrgt,editbas,edittop in clear$ LET pi$= chr$(185) LET negflag= 0 LET p= pos(line$,"-") IF p<>0 then LET negflag= 1 LET dotflag= 0 LET p= pos(line$,".") IF p<>0 then LET dotflag= 1 LET piflag = 0 LET p= pos(line$,pi$) IF p<>0 then LET piflag= 1 SET COLOR clr CALL PlaceCursor DO GET MOUSE: mx,my,s ! mouse input? IF key input then ! Keyboard input? GET KEY k ! Get a keystroke DO while key input ! clear the buffer GET KEY i LOOP CALL keyinput ! evaluate keystroke END IF IF s=2 then ! mouseup? IF mxeditrgt+2 or myeditbas+2 then LET exit= 2 ! mouse exit ELSE DO GET MOUSE: mx,my,s ! mouse input? LOOP until s=3 CALL PlaceCursor ! mouse in text string END IF END IF LOOP until exit>0 CALL TidyUp(line$) CALL EvalN(line$,number) SUB KeyInput SELECT CASE k CASE 48 to 57 ! digits IF inpnt>1 or (inpnt=1 and negflag=0) then LET line$(inpnt:inpnt-1)= chr$(k) CALL WriteLine( 1) END IF CASE 46 ! period IF inpnt>1 or (inpnt=1 and negflag=0) then IF dotflag= 0 then LET dotflag= 1 LET line$(inpnt:inpnt-1)= chr$(k) CALL WriteLine( 1) END IF END IF CASE 185,112,80 ! p or pi character IF inpnt>1 or (inpnt=1 and negflag=0) then IF piflag= 0 then LET piflag= 1 LET line$(inpnt:inpnt-1)= str$(pi) !pi$ CALL WriteLine( 1) END IF END IF CASE 45 ! minus sign IF inpnt>1 or (inpnt=1 and negflag=0) then IF inpnt=1 and negflag=0 then LET negflag= 1 LET line$(inpnt:inpnt-1)= chr$(k) CALL WriteLine( 1) END IF END IF CASE 8 ! Delete key (left delete) LET line$(inpnt-1:inpnt-1)= "" CALL WriteLine(-1) CALL CheckFlags CASE 127 ! Delete right key LET inpnt= inpnt+1 LET line$(inpnt-1:inpnt-1)= "" CALL WriteLine(-1) CALL CheckFlags CASE 24,27 ! Command x, clear (kill line) LET line$= "" LET inpnt= 1 CALL WriteLine( 0) CALL CheckFlags CASE 28, 304 ! Move left arrow CALL ShiftCursor(-1) CASE 29, 303 ! Move right arrow CALL ShiftCursor( 1) CASE 13,9,30,31,302,301 ! return,tab,up,down keys LET exit= k CASE else END SELECT END SUB SUB CheckFlags LET p= pos(line$,pi$) IF p=0 then LET piflag=0 LET p= pos(line$,".") IF p=0 then LET dotflag=0 LET p= pos(line$,"-") IF p=0 then LET negflag=0 END SUB SUB TidyUp(line$) LET line$ = trim$(ucase$(line$)) LET chrcnt= len(line$) IF chrcnt>0 then ! hanging period? IF line$(chrcnt:chrcnt)= "." then LET line$ = line$(1:chrcnt-1) LET chrcnt= len(line$) END IF END IF IF negflag=1 then LET p=2 else LET p=1 ! 1st or 2nd char? IF piflag=0 then ! leading zeros? DO while line$(p:p)="0" and len(line$)>p LET chrcnt= len(line$) LET line$(p:p)= "" LOOP END IF LET chrcnt= len(line$) IF line$(1:1)= "." then LET line$="0" & line$ IF line$(1:2)= "-." then LET line$="-0" & line$(2:chrcnt) END SUB SUB EvalN(line$,n) LET chrcnt= len(line$) IF line$= "" then LET line$,n1$= "0" LET n= 0 ELSE IF line$="-" then LET line$= "-1" LET n= -1 ELSE LET n1$= line$ LET p = pos(n1$,pi$) IF p<>0 then IF p=1 then IF len(n1$)>1 then LET n1$= n1$(2:chrcnt) IF val(n1$)<>0 then LET line$= n1$ & pi$ ELSE LET line$= "0" & pi$ END IF END IF ELSE IF p=chrcnt then LET n1$= n1$(1:p-1) ELSE LET v1 = val(n1$(1:p-1)) LET v2 = val(n1$(p+1:chrcnt)) LET v = v1*v2 LET n1$= str$(v) IF v<>1 then LET line$= n1$ & pi$ ELSE LET line$= pi$ END IF END IF IF n1$= "-" then LET n= -1 ELSE IF n1$= "" then LET n= 1 ELSE WHEN error in LET n= val(n1$) USE LET n= 1 END WHEN END IF LET n= n*pi ELSE LET n= val(line$) END IF END IF ! IF n>nmax or n=chrlft+length*InpChrSpc then LET inpnt= len(line$)+1 ELSE LET inpnt= round((mx-chrlft)/InpChrSpc)+1 END IF CALL WriteLine(0) END SUB SUB WriteLine(move) LET line$ = line$(1:maxchar) ! clip to box LET length= len(line$) ! Find length LET cline = max(chrlft + (inpnt-2)*InpChrSpc,editlft) ! Find pointer x BOX SHOW clear$ at editlft,editbas !print InpChrSpc,line$,clr,chrlft,basline CALL MonoStringN(chrlft,basline,InpChrSpc,line$,clr) LET inpnt= min(max(inpnt+move,1),length+1) LET xline= chrlft + (inpnt-1)*InpChrSpc - 1 ! Find pointer x BOX AREA xline,xline+1,edittop+2,editbas-2 END SUB SUB ShiftCursor(move) BOX CLEAR xline,xline+1,edittop+2,editbas-2 LET inpnt= min(max(inpnt+move,1),length+1) LET xline= chrlft + (inpnt-1)*InpChrSpc - 1 ! Find pointer x BOX AREA xline,xline+1,edittop+2,editbas-2 END SUB END SUB SUB Panel(l,r,b,t,c) SET COLOR backclr BOX AREA l,r,b,t SET COLOR black PLOT l,b; l,t; r,t SET COLOR white PLOT l,b; r,b; r,t END SUB SUB MonoStringN(tx,ty,InpChrSpc,m$,clr) CALL SetTextFont(1,12,"bold") LET cx= tx+InpChrSpc/2 FOR i= 1 to len(m$) LET char$= m$(i:i) CALL PlotTextCJ(cx,ty,char$,clr) LET cx= cx+InpChrSpc NEXT i END SUB ! --- numeric formatter SUB FormatNum(n,n$) IF n<>0 then LET l= int(log10(abs(n))) SELECT CASE l CASE -6 to 0 LET format$= "-%.######" & repeat$("#",abs(l)) CASE 1 to 6 LET format$= repeat$("-",abs(l)) & "--%.#####" CASE else LET format$= "-%.##^^^^" END SELECT LET n$= trim$(using$(format$,n)) CALL ClipSpcAndZeros(n$) ELSE LET n$= "0" END IF IF len(n$)>6 then LET n$= n$(1:6) END SUB SUB FormatNum4(n,n$) IF n<>0 then LET l= int(log10(abs(n))) SELECT CASE l CASE -6 to 0 LET format$= "-%.#" & repeat$("#",abs(l)) CASE 1 to 6 LET format$= repeat$("-",abs(l)) & "--%.#####" CASE else LET format$= "-%.##^^^^" END SELECT LET n$= trim$(using$(format$,n)) CALL ClipSpcAndZeros(n$) ELSE LET n$= "0" END IF END SUB SUB FormatNum8(n,n$) IF n<>0 then LET l= int(log10(abs(n))) SELECT CASE l CASE -6 to 0 LET format$= "-%.######" & repeat$("#",abs(l)) CASE 1 to 6 LET format$= repeat$("-",abs(l)) & "--%.#####" CASE else LET format$= "-%.##^^^" END SELECT LET n$= trim$(using$(format$,n)) CALL ClipSpcAndZeros(n$) ELSE LET n$= "0" END IF END SUB SUB ClipSpcAndZeros(n$) DO LET l= len(n$) IF n$(l:l)= "0" then LET l = len(n$) LET n$= n$(1:l-1) ELSE IF n$(l:l)= "." then LET l = len(n$) LET n$= n$(1:l-1) EXIT DO ELSE EXIT DO END IF LOOP IF len(n$)>8 then LET n$= n$(1:8) IF n$(l:l)= "." then LET l = len(n$) LET n$= n$(1:l-1) END IF END IF END SUB ! --- editor subs --- SUB EditBounds(l,r,b,t,elft,ergt,ebas,etop) LET elft= l LET ergt= r LET ebas= b LET etop= t END SUB SUB CheckErr(line$,err) WHEN error in LET v = val(line$) LET err= 0 USE LET err= 1 END WHEN END SUB END MODULE MODULE MathSymbols ! ---- visual parts SHARE gInf(0:6,0:14) SHARE infwid,infhmax,infvmax LET infhmax= 14 LET infvmax= 6 LET infwid = 16 ! includes letterspace MAT READ gInf DATA 0,0,1,1,1,1,0,0,0,1,1,1,1,0,0 DATA 0,1,1,1,1,1,1,0,1,1,1,1,1,1,0 DATA 1,1,0,0,0,1,1,1,1,1,0,0,0,1,1 DATA 1,1,0,0,0,0,1,1,1,0,0,0,0,1,1 DATA 1,1,0,0,0,1,1,1,1,1,0,0,0,1,1 DATA 0,1,1,1,1,1,1,0,1,1,1,1,1,1,0 DATA 0,0,1,1,1,1,0,0,0,1,1,1,1,0,0 SUB SwapInf(lft,bas,t$,c$,clr) LET l= len(t$) LET x= lft FOR i= 1 to l LET ch$= t$(i:i) IF ch$=c$ then LET x= x+1 CALL DrawInf12(x,bas,clr) LET x= x+Infwid ELSE CALL PlotTextLJ(x,bas,ch$,clr) CALL StringWidth(ch$,sw) LET x= x+sw END IF NEXT i END SUB SUB DrawInf12(lft,bas,clr) SET COLOR clr LET top= bas-infvmax FOR row= 0 to infvmax LET wy= top+row FOR col= 0 to infhmax LET bit= gInf(row,col) IF bit=1 then LET wx= lft+col PLOT wx,wy END IF NEXT col NEXT row END SUB PICTURE pi9 PLOT 0,-4; 1,-5; 5,-5; 6,-6 PLOT 1, 0; 2,-1; 2,-5 PLOT 4, 0; 5,-1; 5,-5 END PICTURE PICTURE Root(rWid) LET Lft= -rWid PLOT Lft+1,-12; 0,-12 ! top PLOT Lft ,-11; 0,-11 ! double wgt top PLOT Lft+1,-12; Lft-5,0; Lft-7,-4 ! leading angle PLOT Lft+2,-12; Lft-4,0; Lft-6,-4 ! double weight END PICTURE SUB RootSign(wx,wy,wid,clr) SET COLOR clr LET rgt= wx+wid LET top= wy-12 PLOT wx+8,top ; rgt,top ! top PLOT wx+7,top+1; rgt,top+1 ! double wgt top PLOT wx+8,top; wx+2,wy; wx ,wy-4 ! leading angle PLOT wx+9,top; wx+3,wy; wx+1,wy-4 ! double weight END SUB PICTURE IntegralSign(clr) SET COLOR clr PLOT 0, -9; 0, 2 PLOT 1, -9; 1, 2 PLOT 1,-10; 2,-10 PLOT -1, 3; 0, 3 END PICTURE PICTURE Integral12(clr) LET x= 5 PLOT x-1,3; x-1, -9 PLOT x ,2; x ,-10 PLOT x+1,1; x+1,-11 PLOT x-4,2; x-2,2 PLOT x-4,3; x-2,3 PLOT x-5,1; x-5,2 PLOT x+5,-10; x+5, -9 PLOT x+4,-10; x+2,-10 PLOT x+4,-11; x+2,-11 END PICTURE PICTURE Summation(clr) SET COLOR clr PLOT 0, 2; 8, 2 PLOT 0, 2; 6, -4; 0,-10 PLOT 1, 2; 7, -4; 1,-10 PLOT 0,-10; 8,-10 END PICTURE PICTURE PlusMinus(clr) SET COLOR clr PLOT -3, 0; 3, 0 PLOT -3,-6; 3,-6 PLOT 0,-9; 0,-3 END PICTURE SUB PlusMinus12(wx,wy,clr) SET COLOR clr LET sz= 3 LET my= wy LET py= my-2-sz PLOT wx-sz,my; wx+sz,my PLOT wx-sz,py; wx+sz,py PLOT wx,py-sz; wx,py+sz END SUB PICTURE LessEql9(clr) SET COLOR clr PLOT 0, 0; 5, 0 PLOT 0,-4; 1,-4 PLOT 2,-5; 3,-5 PLOT 2,-3; 3,-3 PLOT 4,-6; 5,-6 PLOT 4,-2; 5,-2 END PICTURE SUB SqrtSign(sx,sy,swid,sclr) LET shgt= 16 SET COLOR sclr PLOT sx,sy-8; sx+4,sy; sx+12,sy-shgt PLOT sx+12,sy-shgt-1; sx+9+swid,sy-shgt-1 END SUB SUB DivSign(dx,dy,dclr) SET COLOR dclr PLOT dx,dy+1; dx+5,dy-9 PLOT dx+1,dy+1; dx+6,dy-9 END SUB SUB SwapDivision(dx,dy,d$,dclr) SET COLOR dclr LET lft= dx LET l= len(d$) FOR i= 1 to l LET ch$= d$(i:i) IF ch$= "/" then CALL DivSign(lft+2,dy,dclr) LET lft= lft+12 ELSE CALL PlotTextLJ(lft,dy,ch$,dclr) CALL StringWidth(ch$,sw) LET lft= lft+sw END IF NEXT i END SUB SUB MultSign(wx,wy,clr) BOX AREA wx+3,wx+4,wy-3,wy-7 BOX AREA wx,wx+7,wy-4,wy-5 PLOT wx,wy-1; wx+2,wy-3 PLOT wx+1,wy-1; wx+2,wy-2 PLOT wx+1,wy; wx+3,wy-2 PLOT wx+5,wy-3; wx+7,wy-1 PLOT wx+4,wy-3; wx+6,wy-1 PLOT wx+4,wy-2; wx+6,wy END SUB SUB SwapMultiplication(mx,my,m$,mclr) SET COLOR mclr LET lft= mx LET l= len(m$) FOR i= 1 to l LET ch$= m$(i:i) IF ch$= "*" then CALL MultSign(lft+2,my,mclr) LET lft= lft+12 ELSE CALL PlotTextLJ(lft,my,ch$,mclr) CALL StringWidth(ch$,sw) LET lft= lft+sw END IF NEXT i END SUB END MODULE MODULE GraphParts DECLARE PUBLIC backclr,black,drkgry,drkmid,litmid,litgry,white ! ---- visual parts PICTURE arrow2 PLOT 2,0; 0, 2; 0,-2; 2,0 PLOT 0,2; 0,-2 PLOT 1,1; 1,-1 END PICTURE PICTURE arrow3 PLOT 3, 0; 0,-3; 0,3; 3,0 PLOT 1,-2; 1, 2 PLOT 2,-1; 2, 1 END PICTURE PICTURE arrow4 PLOT -2,-2; -2,2; 0,0; -2,-2 PLOT -3,-3; -3,3; 0,0; -3,-3 PLOT -4,-4; -4,4; 0,0; -4,-4 END PICTURE SUB PlotDiamond(wx,wy) PLOT wx-3,wy PLOT wx-2,wy-1; wx-2,wy+1 PLOT wx-1,wy-2; wx-1,wy+2 PLOT wx ,wy-3; wx ,wy+3 PLOT wx+1,wy-2; wx+1,wy+2 PLOT wx+2,wy-1; wx+2,wy+1 PLOT wx+3,wy END SUB SUB PlotDiamondClr(wx,wy,clr) SET COLOR clr PLOT wx-3,wy PLOT wx-2,wy-1; wx-2,wy+1 PLOT wx-1,wy-2; wx-1,wy+2 PLOT wx ,wy-3; wx ,wy+3 PLOT wx+1,wy-2; wx+1,wy+2 PLOT wx+2,wy-1; wx+2,wy+1 PLOT wx+3,wy END SUB SUB PlotDiamondRimClr(wx,wy,clr) SET COLOR clr PLOT wx-3,wy PLOT wx-2,wy-1; wx-2,wy+1 PLOT wx-1,wy-2; wx-1,wy+2 PLOT wx ,wy-3; wx ,wy+3 PLOT wx+1,wy-2; wx+1,wy+2 PLOT wx+2,wy-1; wx+2,wy+1 PLOT wx+3,wy SET COLOR black PLOT wx,wy-4; wx-4,wy; wx,wy+4; wx+4,wy; wx,wy-4 END SUB PICTURE Diamond PLOT 0,2; 0,-2 PLOT -1,1; -1,-1 PLOT -2,0 PLOT 1,1; 1,-1 PLOT 2,0 END PICTURE PICTURE diamond5(clr) SET COLOR clr PLOT -2, 0 PLOT -1,-1; -1,1 PLOT -0,-2; -0,2 PLOT 1,-1; 1,1 PLOT 2, 0 SET COLOR black PLOT -3,0; 0,3; 3,0; 0,-3; -3,0 END PICTURE PICTURE diamond7(clr) SET COLOR clr PLOT -3, 0 PLOT -2,-1; -2,1 PLOT -1,-2; -1,2 PLOT 0,-3; 0,3 PLOT 1,-2; 1,2 PLOT 2,-1; 2,1 PLOT 3, 0 SET COLOR black PLOT -4,0; 0,4; 4,0; 0,-4; -4,0 END PICTURE PICTURE diamond7rim(clr) SET COLOR clr PLOT -3, 0 PLOT -2,-1; -2,1 PLOT -1,-2; -1,2 PLOT 0,-3; 0,3 PLOT 1,-2; 1,2 PLOT 2,-1; 2,1 PLOT 3, 0 SET COLOR black PLOT -4,0; 0,4; 4,0; 0,-4; -4,0 END PICTURE PICTURE VectPnt PLOT -4,-2; 0,0; -4,2 END PICTURE PICTURE PhaseArrow PLOT -5,3; 0,-2; 5,3 PLOT -5,2; 0,-3; 5,2 END PICTURE PICTURE FlowPos4 PLOT -4,-2; 0, 2; 4,-2 END PICTURE PICTURE FlowNeg4 PLOT -4, 2; 0,-2; 4, 2 END PICTURE SUB DrawVectorArrow(ang,size,wx,wy,clr) SET COLOR clr LET x = size LET y = size/2 LET cs= cos(ang) ! rotation matrix LET sn= sin(ang) LET mtrxa= -x*cs LET mtrxb= y*sn LET mtrxc= -x*sn LET mtrxd= y*cs LET rx= mtrxa - mtrxb ! +y rotate and plot LET ry= mtrxc + mtrxd PLOT wx,wy; wx+rx,wy+ry LET rx= mtrxa + mtrxb ! -y rotate and plot LET ry= mtrxc - mtrxd PLOT wx,wy; wx+rx,wy+ry END SUB SUB DrawArcArrow(ang,size,wx,wy,clr) SET COLOR clr LET y = size LET x = size/2 LET cs= cos(-ang) ! rotation matrix LET sn= sin(-ang) LET ma= x*cs LET mb= y*sn LET mc= x*sn LET md= y*cs LET rx= ma - mb ! rotate and plot LET ry= mc + md PLOT wx,wy; wx+rx,wy+ry LET rx= -ma - mb ! rotate and plot LET ry= -mc + md PLOT wx,wy; wx+rx,wy+ry END SUB SUB Rotate(ang,x,y,rx,ry) LET cs= cos(ang) LET sn= sin(ang) LET rx= x*cs - y*sn LET ry= x*sn + y*cs END SUB ! SUB EqPoint(eqx,eqy,fill,clr) ! LET sz= 4 ! SET COLOR clr ! CALL BoxDisk(eqx-sz,eqx+sz,eqy+sz,eqy-sz) ! ! SET COLOR clr ! IF fill=1 then ! CALL BoxDisk(eqx-sz,eqx+sz,eqy+sz,eqy-sz) ! BOX CIRCLE eqx-sz,eqx+sz,eqy+sz,eqy-sz ! ELSE IF fill=-1 then ! BOX CIRCLE eqx-sz,eqx+sz,eqy+sz,eqy-sz ! BOX CIRCLE eqx-(sz-1),eqx+(sz-1),eqy+(sz-1),eqy-(sz-1) ! ELSE IF fill= 0 then ! LET sz = 4 ! ! SET COLOR green ! ! PLOT w1lft,weq1; w1rgt,weq1 ! ! PLOT w2lft+1,weq1; w2rgt-1,weq1 ! BOX CIRCLE eqx-sz,eqx+sz,eqy+sz,eqy-sz ! BOX CIRCLE eqx-(sz-1),eqx+(sz-1),eqy+(sz-1),eqy-(sz-1) ! PLOT eqx-(sz-2),eqy-1; eqx+(sz-2),eqy-1 ! PLOT eqx-(sz-3),eqy-2; eqx+(sz-3),eqy-2 ! ELSE IF fill= .5 then ! LET sz = 4 ! SET COLOR green ! ! PLOT w1lft,weq1; w1rgt,weq1 ! ! PLOT w2lft+1,weq1; w2rgt-1,weq1 ! BOX CIRCLE eqx-sz,eqx+sz,eqy+sz,eqy-sz ! BOX CIRCLE eqx-(sz-1),eqx+(sz-1),eqy+(sz-1),eqy-(sz-1) ! PLOT eqx-(sz-2),eqy+1; eqx+(sz-2),eqy+1 ! PLOT eqx-(sz-3),eqy+2; eqx+(sz-3),eqy+2 ! ELSE IF fill= -.5 then ! LET sz = 4 ! SET COLOR green ! ! PLOT w1lft,weq1; w1rgt,weq1 ! ! PLOT w2lft+1,weq1; w2rgt-1,weq1 ! BOX CIRCLE eqx-sz,eqx+sz,eqy+sz,eqy-sz ! BOX CIRCLE eqx-(sz-1),eqx+(sz-1),eqy+(sz-1),eqy-(sz-1) ! PLOT eqx-(sz-2),eqy+1; eqx+(sz-2),eqy+1 ! PLOT eqx-(sz-3),eqy+2; eqx+(sz-3),eqy+2 ! END IF ! END SUB END MODULE MODULE Clipping SUB LinearClip(m,b,lx1,lx2,ly1,ly2,ftop,fbas,flft,frgt,x) ! endpoints of a line using m,b and window bounds IF m<>0 then LET y1= ftop LET y2= fbas LET x1= (y1-b)/m LET x2= (y2-b)/m IF x1frgt then LET x1= frgt LET y1= m*x1 + b END IF IF x2frgt then LET x2= frgt LET y2= m*x2 + b END IF ELSE IF m=0 then LET y1= b LET y2= b LET x1= flft LET x2= frgt ELSE LET y1= ftop LET y2= fbas LET x1= x LET x2= x END IF IF x1>x2 then LET lx1= x2 LET lx2= x1 LET ly1= y2 LET ly2= y1 ELSE LET lx1= x1 LET lx2= x2 LET ly1= y1 LET ly2= y2 END IF LET ly1 = min(max(ly1,fbas),ftop) LET ly2 = min(max(ly2,fbas),ftop) END SUB SUB ClipLine(lft,rgt,bas,top,px,py,qx,qy,drawflag) ! Cohen Sutherland - Foley and vanDam LOCAL regcode1,regcode2 DIM reg(0:3),reg1(0:3),reg2(0:3) IF px=qx then ! vertical IF px>rgt and qx>rgt then LET drawflag= 0 EXIT SUB ELSE IF pxtop and qy>top then LET drawflag= 0 EXIT SUB ELSE IF pytop then LET py= top IF qytop then LET qy= top LET drawflag= 1 EXIT SUB END IF END IF ELSE IF py=qy then ! horizontal IF py>top and qy>top then LET drawflag= 0 EXIT SUB ELSE IF pyrgt and qx>rgt then LET drawflag= 0 EXIT SUB ELSE IF pxrgt then LET px=rgt IF qxrgt then LET qx=rgt LET drawflag= 1 EXIT SUB END IF END IF ELSE LET my= (qy-py)/(qx-px) LET mx= 1/my CALL GetRegion(px,py,reg1,regcode1) CALL GetRegion(qx,qy,reg2,regcode2) DO LET andtop = reg1(0)*reg2(0) LET andbas = reg1(1)*reg2(1) LET andrgt = reg1(2)*reg2(2) LET andlft = reg1(3)*reg2(3) LET outcode= andtop+andbas+andrgt+andlft IF regcode1=0 and regcode2=0 then ! both ends in LET drawflag= 1 EXIT SUB ELSE IF outcode>0 then ! both ends out LET drawflag= 0 EXIT SUB ELSE IF regcode1>0 then ! p is out CALL ClipPoint(reg1) LET px= x LET py= y CALL GetRegion(px,py,reg1,regcode1) ELSE ! q is out CALL ClipPoint(reg2) LET qx= x LET qy= y CALL GetRegion(qx,qy,reg2,regcode2) END IF END IF LOOP END IF SUB ClipPoint(reg()) IF reg(0)=1 then ! top LET x= px + (top-py)*mx LET y= top ELSE IF reg(1)=1 then ! bas LET x= px + (bas-py)*mx LET y= bas ELSE IF reg(2)=1 then ! rgt LET y= py + (rgt-px)*my LET x= rgt ELSE IF reg(3)=1 then ! lft LET y= py + (lft-px)*my LET x= lft END IF END SUB SUB GetRegion(x,y,reg(),regcode) LET regcode= 0 MAT reg= ZER IF y>top then LET reg(0)=1 LET regcode= regcode+8 ELSE IF yrgt then LET reg(2)=1 LET regcode= regcode+2 ELSE IF xBas then ! Clip Bas LET x1= x2 + m*(Bas-y2) LET y1= Bas ELSE IF y1Bas then ! Clip Bas LET x2= x1 + m*(Bas-y1) LET y2= Bas ELSE IF y2Bas then ! Clip Bas ! LET x2= x1 + m*(Bas-y1) ! LET y2= Bas ! ELSE IF y20 and yd<>0 then LET ym= yd/xd LET xm= xd/yd IF x2w1fRgt then ! clip right LET y2= y1 + ym*(w1fRgt-x1) LET x2= w1fRgt END IF IF y2w1fTop then ! clip top LET x2= x1 + xm*(w1fTop-y1) LET y2= w1fTop END IF ELSE IF yd=0 then IF x2w1fRgt then ! clip right LET y2= y1 + ym*(w1fRgt-x1) LET x2= w1fRgt END IF END IF END SUB END MODULE MODULE InterAction DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr SUB DrawButton(l,r,b,t,tBas,t$) SET COLOR litmid BOX LINES l,r-1,b-1,t SET COLOR black BOX LINES l+1,r,b,t+1 SET COLOR drkgry BOX AREA l+1,r-1,b-1,t+1 IF t$<>"" then LET midb= int((l+r)/2) CALL PlotTextCJ(midb,b-tBas,t$,litgry) END IF END SUB ! ---- Mouse Button Action ---- SUB ButtonDown(l,r,b,t) SET COLOR black PLOT l,b; l,t; r,t SET COLOR litmid PLOT l+1,b; r,b; r,t+1 END SUB SUB ButtonUp(l,r,b,t) SET COLOR litmid PLOT l,b; l,t; r,t SET COLOR black PLOT l+1,b; r,b; r,t+1 END SUB SUB MouseButtonUp(Lft,Rgt,Bas,Top,ms) CALL ButtonDown(Lft,Rgt,Bas,Top) CALL MouseUp(mx,my,ms) CALL ButtonUp(Lft,Rgt,Bas,Top) END SUB SUB MouseUp(mx,my,ms) DO GET MOUSE: mx,my,ms LOOP until ms=3 END SUB SUB MouseDown(mx,my,ms) DO GET MOUSE: mx,my,ms LOOP until ms=2 END SUB END MODULE MODULE Timer DECLARE PUBLIC UnixFlag SHARE unitTicks ! SUB SetTimer ! IF UnixFlag=1 then ! LET ticks1= 0 ! LET t1 = time ! DO ! LET ticks1= ticks1+1 ! LOOP until time-t1>=1 ! ! LET ticks2= 0 ! LET t1 = time ! DO ! LET ticks2= ticks2+1 ! LOOP until time-t1>=1 ! ! ! LET ticks3= 0 ! ! LET t1 = time ! ! DO ! ! LET ticks3= ticks3+1 ! ! LOOP until time-t1>=1 ! ! LET unitTicks= (ticks1+ticks2)/2 ! END IF ! END SUB ! ! SUB Delay(ticksn) ! IF UnixFlag=1 then ! LOCAL count,tick,killTime ! LET count= round(ticksn*unitTicks) ! FOR tick= 1 to count ! LET killTime= time-t1 ! LET killTime= time-t1 ! NEXT tick ! ELSE ! PAUSE ticksn ! END IF ! END SUB SUB SetTimer LET ticks1= 0 LET t1 = time DO LET ticks1= ticks1+1 LOOP until time-t1>=1 ! LET ticks2= 0 ! LET t1 = time ! DO ! LET ticks2= ticks2+1 ! LOOP until time-t1>=1 ! LET unitTicks= (ticks1+ticks2)/2 LET unitTicks= ticks1 END SUB SUB Delay(ticksn) LOCAL count,tick,killTime LET count= round(ticksn*unitTicks) FOR tick= 1 to count LET killTime= time-t1 LET killTime= time-t1 NEXT tick END SUB END MODULE MODULE cb1CheckBox PUBLIC cb1Lft,cb1Rgt,cb1Bas,cb1Top,cb1Txt$,cb1Clr,cb1State DECLARE PUBLIC chkSiz DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DEF cb1Within(mx,my) IF mx>cb1Lft and mxcb1Top and mycb2Lft and mxcb2Top and myc1Lft and wxc1Top and wyr1Lft and mxr1Top and my"" then CALL PlotTextLJ(r1Lft,r1Top-r1siz,r1Name$,r1NameClr) END SUB SUB r1SetCheckBox(r1num) LOCAL i,bas,top,box FOR i= 0 to r1cnt-1 ! clear all LET top= r1top + i*r1stp LET bas= top + r1siz SET COLOR black BOX AREA r1lft+1,r1rgt-1,bas-1,top+1 NEXT i IF r1num>0 then SET COLOR r1ColorList(r1num) ! set one LET top= r1top + (r1num-1)*r1stp LET bas= top + r1siz BOX AREA r1lft+3,r1rgt-3,bas-3,top+3 END IF END SUB END MODULE MODULE r2RadioBoxes PUBLIC r2cnt, r2stp, r2siz PUBLIC r2Lft, r2Rgt, r2Bas, r2Top, r2Name$, r2NameClr PUBLIC r2NameList$(1:1), r2ColorList(1:1) DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme LET r2Siz= 12 LET r2Stp= 18 SUB r2SetVars LET r2Rgt= r2Lft + r2Siz LET r2Bas= r2Top + (r2Cnt-1)*r2Stp + r2Siz END SUB DEF r2Within(mx,my) IF mx>r2Lft and mxr2Top and my"" then CALL PlotTextLJ(r2Lft,r2Top-r2siz,r2Name$,r2NameClr) END SUB SUB r2SetCheckBox(r2num) LOCAL i,bas,top,box FOR i= 0 to r2cnt-1 ! clear all LET top= r2top + i*r2stp LET bas= top + r2siz SET COLOR black BOX AREA r2lft+1,r2rgt-1,bas-1,top+1 NEXT i IF r2num>0 then SET COLOR r2ColorList(r2num) ! set one LET top= r2top + (r2num-1)*r2stp LET bas= top + r2siz BOX AREA r2lft+3,r2rgt-3,bas-3,top+3 END IF END SUB END MODULE MODULE r3RadioBoxes PUBLIC r3cnt, r3stp, r3siz PUBLIC r3Lft, r3Rgt, r3Bas, r3Top, r3Name$, r3NameClr PUBLIC r3NameList$(1:1), r3ColorList(1:1) DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme LET r3Siz= 12 LET r3Stp= 18 SUB r3SetVars LET r3Rgt= r3Lft + r3Siz LET r3Bas= r3Top + (r3Cnt-1)*r3Stp + r3Siz END SUB DEF r3Within(mx,my) IF mx>r3Lft and mxr3Top and my"" then CALL PlotTextLJ(r3Lft,r3Top-r3siz,r3Name$,r3NameClr) END SUB SUB r3SetCheckBox(r3num) LOCAL i,bas,top,box FOR i= 0 to r3cnt-1 ! clear all LET top= r3top + i*r3stp LET bas= top + r3siz SET COLOR black BOX AREA r3lft+1,r3rgt-1,bas-1,top+1 NEXT i IF r3num>0 then SET COLOR r3ColorList(r3num) ! set one LET top= r3top + (r3num-1)*r3stp LET bas= top + r3siz BOX AREA r3lft+3,r3rgt-3,bas-3,top+3 END IF END SUB END MODULE MODULE MenuMethods DECLARE PUBLIC PCFlag,Mac5Flag,M68KFlag,UnixFlag DECLARE PUBLIC workLft,workRgt,workBas,workTop,workMidx ! work area DECLARE PUBLIC backclr,white,red PUBLIC eqhgt SUB PopUpTab(Lft,Rgt,Bas,Top) CALL DrawButton(Lft,Rgt,Bas,Top,0,"") LET sx = Lft + 9 LET sy = Top + 10 LET syu= sy + 2 SET COLOR white FOR i= 0 to 5 PLOT sx-i,syu-i; sx+i,syu-i NEXT i END SUB ! --- equation menu --- SUB ShowEquation1(mRgt,Lft,Rgt,Bas,eq,prefix$,menu$(),clr) CALL SetTextFont(1,12,"bold") ! LET clr = white LET eBas= Bas-6 BOX CLEAR mRgt+2,Rgt,eBas+5,eBas-13 CALL PlotTextRJ(Lft,eBas,prefix$,clr) CALL SuperSubScriptLJ(Lft,eBas,menu$(eq),clr) END SUB SUB MenuBounds1(mTop,mRgt,menu$(),prefix$,pLft,pRgt,pBas,pTop,tTop,tLft) LET eqhgt = 21 LET maxew,ew,pw= 0 LET eqcnt= ubound(menu$) FOR i= 1 to eqcnt CALL SetTextFont(1,12,"bold") LET ew = 0 LET eq$= menu$(i) LET p = pos(eq$,"^") + pos(eq$,"_") IF p=0 then CALL StringWidth(eq$,ew) ELSE CALL MeasureSuperSub(eq$,ew) END IF IF ew>maxew then LET maxew= ew NEXT i ! LET p= pos(prefix$,"^") + pos(prefix$,"_") ! IF p=0 then ! CALL StringWidth(prefix$,pw) ! ELSE LET pw= 0 CALL MeasureSuperSub(prefix$,pw) LET pophgt= eqcnt*eqhgt + 26 IF pophgt>workBas-mTop then LET pBas= workBas ELSE LET pBas= mTop+pophgt END IF LET pTop= pBas-pophgt LET pLft= mRgt+2 LET pRgt= pLft+20+pw+maxew+15 LET tTop= pTop + 22 LET tLft= pLft + 20 + pw END SUB SUB DrawPopUp1(Lft,Rgt,Bas,Top,txLft,txTop,eq,prefix$,menu$(),popup$,name$,clr) LOCAL temp$,oldenum,mx,my,ms,et,eb,clearflag,ty CALL SetTextFont(1,12,"bold") LET mtxtClr = white LET mbtnhgt= eqhgt BOX KEEP Lft,Rgt,Bas,Top in temp$ CALL Rim(Lft,Rgt,Bas,Top,backclr) CALL DrawButton(Lft+5,Lft+20,Top+20,Top+5,0,"") LET eqcnt= ubound(menu$) FOR i= 1 to eqcnt LET et = txTop + (i-1)*mbtnhgt LET eb = et + mbtnhgt - 2 LET txBas= eb - 5 CALL DrawButton(Lft+5,Rgt-5,eb,et,0,"") IF prefix$<>"" then CALL PlotTextRJ(txLft,txBas,prefix$,mtxtClr) END IF CALL SuperSubScriptLJ(txLft,txBas,menu$(i),mtxtClr) IF i=eq then CALL SuperSubScriptLJ(Lft+9,eb-4,"*",red) NEXT i BOX KEEP Lft,Rgt,Bas,Top in popup$ IF name$<>"" then CALL PlotTextLJ(Lft+16,Top-12,name$,clr) IF UnixFlag=0 then PAUSE .5 ELSE END IF BOX SHOW temp$ at Lft,Bas LET temp$= "" END SUB ! --- system menu --- SUB ShowSystem(mRgt,Lft,Rgt,Bas,eq,prefix1$,prefix2$,menu$(,),clr) CALL SetTextFont(1,12,"bold") ! LET clr = white LET eBas= Bas-4 BOX CLEAR mRgt+2,Rgt,eBas+5,eBas-13 CALL PlotTextRJ(Lft,eBas,prefix1$,clr) LET eq$= menu$(eq,1) CALL SuperSubScriptLJ(Lft,eBas,eq$,clr) LET eBas= Bas+14 BOX CLEAR mRgt+2,Rgt,eBas+5,eBas-13 CALL PlotTextRJ(Lft,eBas,prefix2$,clr) LET eq$= menu$(eq,2) CALL SuperSubScriptLJ(Lft,eBas,eq$,clr) END SUB SUB MenuBoundsSys(mTop,mRgt,menu$(,),prefix1$,prefix2$,pLft,pRgt,pBas,pTop,tTop,tLft) LET eqhgt= 42 LET maxew,ew,pw= 0 LET eqcnt= ubound(menu$,1) FOR i= 1 to eqcnt CALL SetTextFont(1,12,"bold") LET ew = 0 LET eq$= menu$(i,1) LET p = pos(eq$,"^") + pos(eq$,"_") IF p=0 then CALL StringWidth(eq$,ew) ELSE CALL MeasureSuperSub(eq$,ew) END IF IF ew>maxew then LET maxew= ew LET ew = 0 LET eq$= menu$(i,2) LET p = pos(eq$,"^") + pos(eq$,"_") IF p=0 then CALL StringWidth(eq$,ew) ELSE CALL MeasureSuperSub(eq$,ew) END IF IF ew>maxew then LET maxew= ew NEXT i ! LET p= pos(prefix$,"^") + pos(prefix$,"_") ! IF p=0 then ! CALL StringWidth(prefix$,pw) ! ELSE LET pw= 0 CALL MeasureSuperSub(prefix1$,pw1) CALL MeasureSuperSub(prefix2$,pw2) LET pw= max(pw1,pw2) LET pophgt= eqcnt*eqhgt + 26 IF pophgt>workBas-mTop then LET pBas= workBas ELSE LET pBas= mTop+pophgt END IF LET pTop= pBas-pophgt LET pLft= mRgt+2 LET pRgt= pLft+20+pw+maxew+15 LET tTop= pTop + 22 LET tLft= pLft + 22 + pw END SUB SUB DrawPopUpSys(Lft,Rgt,Bas,Top,txLft,txTop,eq,prefix1$,prefix2$,menu$(,),popup$) LOCAL temp$,oldenum,mx,my,ms,et,eb,clearflag,ty CALL SetTextFont(1,12,"bold") LET clr = white LET mbtnhgt= eqhgt BOX KEEP Lft,Rgt,Bas,Top in temp$ CALL Rim(Lft,Rgt,Bas,Top,0) CALL DrawButton(Lft+5,Lft+20,Top+20,Top+5,0,"") LET eqcnt= ubound(menu$,1) FOR i= 1 to eqcnt LET et = txTop + (i-1)*mbtnhgt LET eb = et + mbtnhgt - 2 CALL DrawButton(Lft+5,Rgt-5,eb,et,0,"") LET txBas= eb - 24 IF prefix2$<>"" then CALL PlotTextRJ(txLft,txBas,prefix1$,clr) END IF CALL SuperSubScriptLJ(txLft,txBas,menu$(i,1),clr) LET txBas= eb - 7 IF prefix1$<>"" then CALL PlotTextRJ(txLft,txBas,prefix2$,clr) END IF CALL SuperSubScriptLJ(txLft,txBas,menu$(i,2),clr) IF i=eq then CALL SuperSubScriptLJ(Lft+9,eb-14,"*",red) NEXT i BOX KEEP Lft,Rgt,Bas,Top in popup$ IF UnixFlag=0 then PAUSE .5 ELSE END IF BOX SHOW temp$ at Lft,Bas LET temp$= "" END SUB END MODULE MODULE m1PopMenu PUBLIC m1Lft,m1Rgt,m1Bas,m1Top,m1tTop,m1tLft,m1tClr,m1Name$ PUBLIC m1Prefix$,m1Dim,m1Menu1$(1:1),m1Menu2$(1:1,1:1),m1Pop$ PUBLIC m1Equation,m1EqCount,m1eLft,m1eRgt,m1eBas PUBLIC m1pLft,m1pRgt,m1pBas,m1pTop ! m1phgt DECLARE PUBLIC workLft,workRgt,workBas,workTop,workMidx ! work area DECLARE PUBLIC backclr,black,drkgry,drkmid,midgry,litmid,litgry,white DECLARE PUBLIC red,yellow,green,cyan,blue,magenta,colorscheme DECLARE PUBLIC planeclr,gridclr,rimclr,axisclr,axislabelclr,titleclr,rightsclr DECLARE PUBLIC numberlineclr,slotdrkclr,slotlgtclr,slideclr,headerclr,btnclr DECLARE PUBLIC eqhgt SUB m1InitMenu1 LET m1EqCount= ubound(m1Menu1$) LET m1Rgt = m1Lft+18 LET m1Bas = m1Top+18 LET m1tBas = m1Bas- 6 CALL PopUpTab(m1Lft,m1Rgt,m1Bas,m1Top) CALL MenuBounds1(m1Top,m1Rgt,m1Menu1$,m1Prefix$,pLft,pRgt,pBas,pTop,tTop,tLft) LET m1pLft= pLft LET m1pRgt= pRgt LET m1pBas= pBas LET m1pTop= pTop LET m1tTop= tTop LET m1tLft= tLft CALL DrawPopUp1(m1pLft,m1pRgt,m1pBas,m1pTop,m1tLft,m1tTop,m1Equation,m1Prefix$,m1Menu1$,m1pop$,m1Name$,m1tClr) CALL m1ShowEquation END SUB DEF m1Within(mx,my) IF mx>m1Lft and mxm1Top and my"" then CALL PlotTextLJ(m1pLft+16,m1Top-12,m1name$,m1tClr) ELSE LET state= 1 END IF END SUB SUB m1ShowEquation CALL ShowEquation1(m1Rgt,m1tLft,m1pRgt,m1Bas,m1Equation,m1Prefix$,m1Menu1$,m1tClr) END SUB SUB m1MarkEquation(clr) CALL SetTextFont(1,12,"bold") LET ty= m1tTop + (m1Equation-1)*eqhgt + eqhgt - 6 CALL PlotTextLJ(m1pLft+9,ty,"*",clr) BOX KEEP m1pLft,m1pRgt,m1pBas,m1pTop in m1Pop$ END SUB SUB m1ReadMenu BOX KEEP m1pLft,m1pRgt,m1pBas,m1pTop in temp$ BOX SHOW m1Pop$ at m1pLft,m1pBas CALL MouseDown(mx,my,ms) IF mx>m1pLft and mxm1tTop and mym2Lft and mxm2Top and my"" then CALL PlotTextLJ(m2pLft+16,m2Top-12,m2name$,m2tClr) ELSE LET state= 1 END IF END SUB SUB m2ShowEquation CALL ShowEquation1(m2Rgt,m2tLft,m2pRgt,m2Bas,m2Equation,m2Prefix$,m2Menu1$,m2tClr) END SUB SUB m2MarkEquation(clr) CALL SetTextFont(1,12,"bold") LET ty= m2tTop + (m2Equation-1)*eqhgt + eqhgt - 6 CALL PlotTextLJ(m2pLft+9,ty,"*",clr) BOX KEEP m2pLft,m2pRgt,m2pBas,m2pTop in m2Pop$ END SUB SUB m2ReadMenu BOX KEEP m2pLft,m2pRgt,m2pBas,m2pTop in temp$ BOX SHOW m2Pop$ at m2pLft,m2pBas CALL MouseDown(mx,my,ms) IF mx>m2pLft and mxm2tTop and mym1SysLft and mxm1SysTop and my"" then CALL PlotTextLJ(m1sysLft+16,m1sysTop-12,m1sysname$,m1systClr) ELSE LET state= 1 END IF END SUB SUB m1SysShowEquation CALL ShowSystem(m1SysRgt,m1SystLft,m1SyspRgt,m1SysBas,m1SysEquation,m1SysPrefix1$,m1SysPrefix2$,m1SysMenu$,m1SystClr) END SUB SUB m1SysMarkEquation(clr) CALL SetTextFont(1,12,"bold") LET ty= m1SystTop + (m1SysEquation-1)*eqhgt + eqhgt - 6 CALL PlotTextLJ(m1SyspLft+9,ty,"*",clr) BOX KEEP m1SyspLft,m1SyspRgt,m1SyspBas,m1SyspTop in m1SysPop$ END SUB SUB m1SysReadMenu BOX KEEP m1SyspLft,m1SyspRgt,m1SyspBas,m1SyspTop in temp$ BOX SHOW m1SysPop$ at m1SyspLft,m1SyspBas CALL MouseDown(mx,my,ms) IF mx>m1SyspLft and mxm1SystTop and my0 then LET nearest= round(round(num/rn)*rn,4) ELSE LET nearest= 0.000001 END IF LET roundn= nearest END DEF DEF clamp(num,lo,hi)= min(max(num,lo),hi) DEF modulus(a,b) = sqr(a*a+b*b) DEF radius(a,b) = sqr(a*a+b*b) DEF e = exp(1) DEF rotation(a,b) IF a<>0 or b<>0 then LET ang= angle(a,b) LET ang= mod(ang,2*pi) ELSE LET ang= 0 END IF LET rotation= ang END DEF DEF RadToDeg(rad)= rad*180/pi SUB PolarToCartesian(rad,ang,x,y) ! convert to Cartesian LET x= rad*cos(ang) LET y= rad*sin(ang) END SUB SUB CartesianToPolar(x,y,rad,ang) DECLARE DEF rotation,radius LET ang= rotation(x,y) LET rad= radius(x,y) END SUB SUB CartesianToPolarPi(x,y,rad,ang) DECLARE DEF rotation,radius LET ang= angle(x,y) LET rad= radius(x,y) END SUB SUB PolarToPixels(ang,rad,wxtr,wytr,wx,wy) LET wx = wxtr + rad*cos(ang) LET wy = wytr - rad*sin(ang) END SUB SUB Pythagoras(x1,y1,x2,y2,h) LET xd= x2-x1 LET yd= y2-y1 LET h = sqr(xd*xd + yd*yd) END SUB SUB CopyCoords(cx1,cy1,cx2,cy2) LET cx2= cx1 LET cy2= cy1 END SUB SUB SetVars(in1,in2,out1,out2) LET out1= in1 LET out2= in2 END SUB SUB SetStrings(in1$,in2$,out1$,out2$) LET out1$= in1$ LET out2$= in2$ END SUB SUB xyRotate(cs,sn,x,y,x1,y1) LET x1= round(x*cs - y*sn,8) LET y1= round(x*sn + y*cs,8) END SUB SUB AngleDeg(x,y,at) IF x=0 then IF y=0 then LET at= 0 ELSE IF y>0 then LET at= 90 ELSE IF y<0 then LET at= 270 END IF ELSE LET at= abs(atn(y/x)) IF x<0 then IF y=0 then LET at= 180 ELSE IF y>0 then ! quad II LET at= at+90 ELSE IF y<0 then ! quad III LET at= at+180 END IF ELSE IF x>0 then IF y=0 then LET at= 0 ELSE IF y<0 then LET at= at+270 END IF END IF END IF LET at= -at END SUB SUB AngleRad(x,y,at) IF x=0 then IF y=0 then LET at= 0 ELSE IF y>0 then LET at= pi/2 ELSE IF y<0 then LET at= 3*pi/2 END IF ELSE LET at= abs(atn(y/x)) IF x<0 then IF y=0 then LET at= pi ELSE IF y>0 then ! quad II LET at= at+pi/2 ELSE IF y<0 then ! quad III LET at= at+pi END IF ELSE IF x>0 then IF y=0 then LET at= 0 ELSE IF y<0 then LET at= at+3*pi/2 END IF END IF END IF LET at= -at END SUB END MODULE MODULE Drawing SUB PlotLine(wx1,wy1,wx2,wy2,clr) SET COLOR clr PLOT wx1,wy1; wx2,wy2 END SUB SUB PlotPoint(wx,wy,clr) SET COLOR clr PLOT wx,wy END SUB SUB PlotLinePoint(wx1,wy1,wx2,wy2,lclr,pclr) SET COLOR lclr PLOT wx1,wy1; wx2,wy2 DRAW Diamond7(pclr) with shift(wx2,wy2) END SUB SUB BoxClear(l,r,b,t) BOX CLEAR l,r,b,t END SUB SUB BoxLines(l,r,b,t,c) SET COLOR c BOX LINES l,r,b,t END SUB SUB BoxArea(l,r,b,t,c) SET COLOR c BOX AREA l,r,b,t END SUB SUB BoxCircle(l,r,b,t,c) SET COLOR c BOX CIRCLE l,r,b,t END SUB END MODULE ! --- End of HHLib Library Routines --- MODULE DataTableRow1 ! allows color coding by row DECLARE PUBLIC backclr,black,drkgry,drkmid,litmid,litgry,white DECLARE PUBLIC planeclr,rimclr ! --- Row Table 1 Module --- PUBLIC tbr1Lft,tbr1Rgt,tbr1Bas,tbr1Top,tbr1Form$ PUBLIC tbr1RowCnt,tbr1RowStp,tbr1ColCnt,tbr1ColStp,tbr1Pntr PUBLIC tbr1(1:2,1:2),tbr1ColLabels$(1:2),tbr1RowColors(1:2) SHARE tbr1GridLayer$ DEF tbr1Rgtx(col) = tbr1Lft + col*tbr1ColStp DEF tbr1Lftx(col) = tbr1Lft + (col-1)*tbr1ColStp DEF tbr1Topy(row) = tbr1Top + (row-1)*tbr1RowStp DEF tbr1Basy(row) = tbr1Top + row*tbr1RowStp DEF tbr1Basln(row) = tbr1Top + row*tbr1RowStp - 5 DEF tbr1MidCol(col)= tbr1Lft + col*tbr1ColStp - tbr1ColStp/2 SUB tbr1Variables LET tbr1Rgt = tbr1Lft + tbr1ColStp*tbr1ColCnt LET tbr1Bas = tbr1Top + tbr1RowCnt*tbr1RowStp MAT redim tbr1(1:tbr1RowCnt,1:tbr1ColCnt) MAT redim tbr1ColLabels$(1:tbr1ColCnt) MAT redim tbr1RowColors(1:tbr1RowCnt) END SUB SUB tbr1Clear BOX CLEAR tbr1Lft,tbr1Rgt,tbr1Bas,tbr1Top END SUB SUB tbr1KeepGridLayer BOX KEEP tbr1Lft,tbr1Rgt,tbr1Bas,tbr1Top in tbr1GridLayer$ END SUB SUB tbr1ShowGridLayer BOX SHOW tbr1GridLayer$ at tbr1Lft,tbr1Bas END SUB SUB tbr1Init DECLARE DEF tbr1MidCol CALL tbr1Draw CALL SetTextFont(1,12,"bold") LET bas= tbr1Top-6 FOR i= 1 to tbr1ColCnt LET midx= tbr1MidCol(i) LET txt$= tbr1ColLabels$(i) CALL SuperSubScriptCJ(midx,bas,txt$,white) NEXT i END SUB SUB tbr1Draw DECLARE DEF tbr1Rgtx,tbr1Basy LET tblclr= litmid CALL BoxArea(tbr1Lft,tbr1Rgt,tbr1Bas,tbr1Top,planeclr) CALL BoxLines(tbr1Lft,tbr1Rgt,tbr1Bas,tbr1Top,tblclr) FOR i= 1 to tbr1ColCnt-1 LET Colx= tbr1Rgtx(i) PLOT Colx,tbr1Top; Colx,tbr1Bas NEXT i FOR i= 1 to tbr1RowCnt-1 LET Rowy= tbr1Basy(i) PLOT tbr1Lft,Rowy; tbr1Rgt,Rowy NEXT i CALL tbr1KeepGridLayer END SUB SUB tbr1Values(tbr1(,),Pntr) DECLARE DEF tbr1Basln,tbr1Rgtx IF Pntr<=tbr1RowCnt then LET ty= tbr1Basln(Pntr) FOR col= 1 to tbr1ColCnt LET cval= tbr1(Pntr,col) LET c$ = using$(tbr1Form$,cval) LET tx = tbr1Rgtx(col) - 10 LET clr = tbr1RowColors(Pntr) CALL PlotTextRJ(tx,ty,c$,clr) NEXT col END IF END SUB SUB tbr1FillTable CALL tbr1ShowGridLayer FOR row= 1 to tbr1RowCnt CALL tbr1Values(tbr1,row) NEXT row END SUB END MODULE MODULE DataTableRow2 ! allows color coding by row DECLARE PUBLIC backclr,black,drkgry,drkmid,litmid,litgry,white DECLARE PUBLIC planeclr,rimclr ! --- Row Table 1 Module --- PUBLIC tbr2Lft,tbr2Rgt,tbr2Bas,tbr2Top,tbr2Form$ PUBLIC tbr2RowCnt,tbr2RowStp,tbr2ColCnt,tbr2ColStp,tbr2Pntr PUBLIC tbr2(1:2,1:2),tbr2ColLabels$(1:2),tbr2RowColors(1:2) SHARE tbr2GridLayer$ DEF tbr2Rgtx(col) = tbr2Lft + col*tbr2ColStp DEF tbr2Lftx(col) = tbr2Lft + (col-1)*tbr2ColStp DEF tbr2Topy(row) = tbr2Top + (row-1)*tbr2RowStp DEF tbr2Basy(row) = tbr2Top + row*tbr2RowStp DEF tbr2Basln(row) = tbr2Top + row*tbr2RowStp - 5 DEF tbr2MidCol(col)= tbr2Lft + col*tbr2ColStp - tbr2ColStp/2 SUB tbr2Variables LET tbr2Rgt = tbr2Lft + tbr2ColStp*tbr2ColCnt LET tbr2Bas = tbr2Top + tbr2RowCnt*tbr2RowStp MAT redim tbr2(1:tbr2RowCnt,1:tbr2ColCnt) MAT redim tbr2ColLabels$(1:tbr2ColCnt) MAT redim tbr2RowColors(1:tbr2RowCnt) END SUB SUB tbr2Clear BOX CLEAR tbr2Lft,tbr2Rgt,tbr2Bas,tbr2Top END SUB SUB tbr2KeepGridLayer BOX KEEP tbr2Lft,tbr2Rgt,tbr2Bas,tbr2Top in tbr2GridLayer$ END SUB SUB tbr2ShowGridLayer BOX SHOW tbr2GridLayer$ at tbr2Lft,tbr2Bas END SUB SUB tbr2Init DECLARE DEF tbr2MidCol CALL tbr2Draw CALL SetTextFont(1,12,"bold") LET bas= tbr2Top-6 FOR i= 1 to tbr2ColCnt LET midx= tbr2MidCol(i) LET txt$= tbr2ColLabels$(i) CALL SuperSubScriptCJ(midx,bas,txt$,white) NEXT i END SUB SUB tbr2Draw DECLARE DEF tbr2Rgtx,tbr2Basy LET tblclr= litmid CALL BoxArea(tbr2Lft,tbr2Rgt,tbr2Bas,tbr2Top,planeclr) CALL BoxLines(tbr2Lft,tbr2Rgt,tbr2Bas,tbr2Top,tblclr) FOR i= 1 to tbr2ColCnt-1 LET Colx= tbr2Rgtx(i) PLOT Colx,tbr2Top; Colx,tbr2Bas NEXT i FOR i= 1 to tbr2RowCnt-1 LET Rowy= tbr2Basy(i) PLOT tbr2Lft,Rowy; tbr2Rgt,Rowy NEXT i CALL tbr2KeepGridLayer END SUB SUB tbr2Values(tbr2(,),Pntr) DECLARE DEF tbr2Basln,tbr2Rgtx IF Pntr<=tbr2RowCnt then LET ty= tbr2Basln(Pntr) FOR col= 1 to tbr2ColCnt LET cval= tbr2(Pntr,col) LET c$ = using$(tbr2Form$,cval) LET tx = tbr2Rgtx(col) - 10 LET clr = tbr2RowColors(Pntr) CALL PlotTextRJ(tx,ty,c$,clr) NEXT col END IF END SUB SUB tbr2FillTable CALL tbr2ShowGridLayer FOR row= 1 to tbr2RowCnt CALL tbr2Values(tbr2,row) NEXT row END SUB END MODULE MODULE DataTable1 ! column colored ! --- Table 1 Module --- PUBLIC tb1Lft,tb1Rgt,tb1Bas,tb1Top,tb1Form$ PUBLIC tb1RowCnt,tb1RowStp,tb1ColCnt,tb1ColStp,tb1Pntr PUBLIC tb1(1:2,1:2),tb1ColLabels$(1:2),tb1ColColors(1:2) DEF tb1Rgtx(col) = tb1Lft + col*tb1ColStp DEF tb1Lftx(col) = tb1Lft + (col-1)*tb1ColStp DEF tb1Topy(row) = tb1Top + (row-1)*tb1RowStp DEF tb1Basy(row) = tb1Top + row*tb1RowStp DEF tb1Basln(row) = tb1Top + row*tb1RowStp - 2 DEF tb1MidCol(col)= tb1Lft + col*tb1ColStp - tb1ColStp/2 SUB tb1Variables LET tb1Rgt = tb1Lft + tb1ColStp*tb1ColCnt LET tb1Bas = tb1Top + tb1RowCnt*tb1RowStp + 4 MAT redim tb1(1:tb1RowCnt,1:tb1ColCnt) MAT redim tb1ColLabels$(1:tb1ColCnt) MAT redim tb1ColColors(1:tb1ColCnt) END SUB SUB tb1Clear BOX CLEAR tb1Lft,tb1Rgt,tb1Bas,tb1Top END SUB SUB tb1Init DECLARE PUBLIC planeclr,rimclr,white DECLARE DEF tb1MidCol CALL tb1Draw CALL SetTextFont(1,12,"bold") LET bas= tb1Top-11 FOR i= 1 to tb1ColCnt LET midx= tb1MidCol(i) LET txt$= tb1ColLabels$(i) CALL SuperSubScriptCJ(midx,bas,txt$,white) NEXT i END SUB SUB tb1Draw DECLARE PUBLIC planeclr,rimclr,white DECLARE DEF tb1Rgtx SET COLOR planeclr BOX AREA tb1Lft,tb1Rgt,tb1Bas,tb1Top SET COLOR rimclr BOX LINES tb1Lft,tb1Rgt,tb1Bas,tb1Top FOR i= 1 to tb1ColCnt-1 LET Colx= tb1Rgtx(i) PLOT Colx,tb1Top; Colx,tb1Bas NEXT i END SUB SUB tb1Values(tb1(,),tb1Pntr) DECLARE DEF tb1Basln,tb1Rgtx IF tb1Pntr<=tb1RowCnt then FOR col= 1 to tb1ColCnt LET cval= tb1(tb1Pntr,col) LET c$ = using$(tb1Form$,cval) LET ty = tb1Basln(tb1Pntr) LET tx = tb1Rgtx(col) - 10 LET clr = tb1ColColors(col) CALL PlotTextRJ(tx,ty,c$,clr) NEXT col END IF END SUB END MODULE MODULE DataTable2 ! column colored ! --- Table 2 Module --- PUBLIC tb2Lft,tb2Rgt,tb2Bas,tb2Top PUBLIC tb2RowCnt,tb2RowStp,tb2ColCnt,tb2ColStp,tb2Pntr PUBLIC tb2(1:2,1:2),tb2ColLabels$(1:2),tb2ColColors(1:2) DEF tb2Rgtx(col) = tb2Lft + col*tb2ColStp DEF tb2Lftx(col) = tb2Lft + (col-1)*tb2ColStp DEF tb2Topy(row) = tb2Top + (row-1)*tb2RowStp DEF tb2Basy(row) = tb2Top + row*tb2RowStp DEF tb2Basln(row) = tb2Top + row*tb2RowStp - 2 DEF tb2MidCol(col)= tb2Lft + col*tb2ColStp - tb2ColStp/2 SUB tb2Variables LET tb2Rgt = tb2Lft + tb2ColStp*tb2ColCnt LET tb2Bas = tb2Top + tb2RowCnt*tb2RowStp + 4 MAT redim tb2(1:tb2RowCnt,1:tb2ColCnt) MAT redim tb2ColLabels$(1:tb2ColCnt) MAT redim tb2ColColors(1:tb2ColCnt) END SUB SUB tb2Clear BOX CLEAR tb2Lft,tb2Rgt,tb2Bas,tb2Top END SUB SUB Inittb2 DECLARE PUBLIC planeclr,rimclr,white DECLARE DEF tb2MidCol CALL tb2Draw CALL SetTextFont(1,12,"bold") LET bas= tb2Top-11 FOR i= 1 to tb2ColCnt LET midx= tb2MidCol(i) LET txt$= tb2ColLabels$(i) CALL SuperSubScriptCJ(midx,bas,txt$,white) NEXT i END SUB SUB tb2Draw DECLARE PUBLIC planeclr,rimclr,white DECLARE DEF tb2Rgtx SET COLOR planeclr BOX AREA tb2Lft,tb2Rgt,tb2Bas,tb2Top SET COLOR rimclr BOX LINES tb2Lft,tb2Rgt,tb2Bas,tb2Top FOR i= 1 to tb2ColCnt-1 LET Colx= tb2Rgtx(i) PLOT Colx,tb2Top; Colx,tb2Bas NEXT i END SUB SUB tb2Values(tb2(,),tb2Pntr) DECLARE DEF tb2Basln,tb2Rgtx IF tb2Pntr<=tb2RowCnt then FOR col= 1 to tb2ColCnt LET cval= tb2(tb2Pntr,col) LET c$ = using$("--%.##",cval) LET ty = tb2Basln(tb2Pntr) LET tx = tb2Rgtx(col) - 10 LET clr = tb2ColColors(col) CALL PlotTextRJ(tx,ty,c$,clr) NEXT col END IF END SUB END MODULE ! ---- end of HHLib ----