home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / FOXPRO / 3DGEN / 3DPANEL.PRG < prev    next >
Text File  |  1993-06-23  |  2KB  |  86 lines

  1. *!*****************************************************************************
  2. *!
  3. *!      Procedure: 3DPANEL
  4. *!
  5. *!      Called by: programs generated by 3DGENSCR.PRG
  6. *!
  7. *!*****************************************************************************
  8.  
  9. parameters nTop,nLeft,nBott,nRight,nThickness,lRaised
  10. private cColor1,cColor2,nCnt
  11. PRIVATE tTop, tBott, tLeft, tRight
  12.  
  13. if lRaised
  14.   cColor1 = "rgb(255,255,255,,,)"
  15.   ccolor2 = "rgb(128,128,128,128,128,128)"
  16. else
  17.   cColor1 = "rgb(128,128,128,128,128,128)"
  18.   ccolor2 = "rgb(255,255,255,,,)"
  19. endif
  20.  
  21. for nCnt = 0 to nThickness - 1
  22.     *
  23.     * Moved these function calls up here.  Removes repetative calls (speed improvement).
  24.     *
  25.     tTop = Pix2Frac(Frac2Pix(nTop,.t.) + nCnt,.t.)
  26.     tLeft = Pix2Frac(Frac2Pix(nLeft,.f.) + nCnt,.f.)
  27.     tBott = Pix2Frac(Frac2Pix(nBott,.t.) - nCnt,.t.)
  28.     tRight = Pix2Frac(Frac2Pix(nRight,.f.) - nCnt,.f.)
  29.     
  30.     @ tTop, tLeft TO tTop, tRight ;
  31.     pen 1,8 ;
  32.     style "1" ;
  33.     color (cColor1)
  34.  
  35.     @ tTop, tLeft TO tBott, tLeft ;
  36.     pen 1,8 ;
  37.     style "1" ;
  38.     color (cColor1)
  39.  
  40.     *
  41.     * Make Right Bars 1 Pixel Longer (Line was too short - Left a gap at lower right corner)
  42.     *
  43.     @ tTop, tRight TO Pix2Frac(Frac2Pix(nBott,.t.) - nCnt + 1,.t.), tRight ;
  44.     pen 1,8 ;
  45.     style "1" ;
  46.     color (cColor2)
  47.  
  48.     *
  49.     * Make Bottom Bars 1 Pixel Longer (Line was too short - Left a gap at lower right corner)
  50.     *
  51.     @ tBott, tLeft TO tBott, Pix2Frac(Frac2Pix(nRight,.f.) - nCnt + 1,.f.) ;
  52.     pen 1,8 ;
  53.     style "1" ;
  54.     color (cColor2)
  55.  
  56. endfor
  57. return
  58.  
  59.  
  60. *!*****************************************************************************
  61. *!
  62. *!      Procedure: PIX2FRAC
  63. *!
  64. *!      Called by: 3DPANEL            (procedure in 3DPANEL.PRG)
  65. *!
  66. *!*****************************************************************************
  67.  
  68. function Pix2Frac
  69.   parameters nPix,lRow
  70. return nPix / fontmetric(iif(lRow,1,6))
  71.  
  72.  
  73. *!*****************************************************************************
  74. *!
  75. *!      Procedure: FRAC2PIX
  76. *!
  77. *!      Called by: 3DPANEL            (procedure in 3DPANEL.PRG)
  78. *!
  79. *!*****************************************************************************
  80.  
  81. function Frac2Pix
  82.   parameters nFrac,lRow
  83. return nFrac * fontmetric(iif(lRow,1,6))
  84.  
  85.  
  86.