home *** CD-ROM | disk | FTP | other *** search
- * Program Name..: STDIO.PRG
- * Author........: Barbara Geller
- * Date..........: 05/21/90
- * Description...: Supporting functions
- * Notice........: 1990 Clipper Developers Conference
-
- FUNCTION center(row,msg1)
- @ row,INT((80-LEN(msg1))/2 +.5) say msg1
- return .t.
- * endfunc : center
-
- FUNCTION center_sh(rrow, banner, t, l, b, r, frame)
- * 1 = clear 2 = double 3 = single 4 = doub top single side
- * 5 = single top doub side 6 = heavy box
-
- frame := IF(frame = 0 .or. frame > 7,1,frame)
-
- PAINT(co_detail)
- @ t,l,b,r box SUBSTR(;
- " ╔═╗║╝═╚║ ┌─┐│┘─└│ ╒═╕│╛═╘│ ╓─╖║╜─╙║ █▀███▄██ ",;
- ((frame-1) * 9)+1,9)
-
- IF ! EMPTY(banner)
- @ rrow,int((80-LEN(banner))/2 +.5) say banner
- ENDIF
- PAINT(pop)
-
- PAINT(co_blank)
- @ t+1,r+1,b+1,r+2 box SUBSTR(" ▄█ █",1,9)
- @ b+1,l+1,b+1,r+1 box SUBSTR(" █ ",1,9)
- PAINT(pop)
-
- return .t.
- * endfunc
-
- FUNCTION err_msg(msg1)
- PAINT(co_err)
- PCLR("ebuff",23,0,24,79,0)
-
- @ 23,INT((80-LEN(msg1))/2 +.5) say msg1
- @ 24,27 say "Press any key to continue."
- INKEY(0)
-
- PAINT(pop)
- RESTSCREEN(23,0,24,79,ebuff)
- return .t.
- * endfunc : err_msg
-
- FUNCTION inits
- LOCAL count
-
- PUBLIC co_norm, co_banner, co_detail, co_err, co_get, co_blank
- PUBLIC co_wind, co_invwind
- PUBLIC pbuff,ebuff,pop_arry[10],popptr,pop
-
- SET scoreboard OFF
- SET wrap ON
- SET exact OFF
- SET softseek ON
- SET escape ON
-
- AFILL(pop_arry,"W/N")
- popptr := 0
- pop := "pop"
-
- pbuff := ""
- ebuff := ""
-
- SETCURSOR(.f.)
-
- IF ISCOLOR() .and. shade # 'mono'
- co_norm := "B/BG,BR/W,,,N/W "
- co_banner := "W+/GR,BR/W,,,N/W "
- co_detail := "BG+/B,BR/W,,,N/W "
- co_err := "W+/R,BR/W,,,N/W "
- co_get := "BR/W "
- co_blank := "N/N,N/N,,,N/W "
- co_wind := "N/G,BR/W,,,N/W "
- co_invwind := "GR/W,N/W,,,N/W "
- shade := "color"
-
- ELSE
- co_norm := "W/N,N/W,,,N/W "
- co_banner := "W+/N,N/W,,,N/W "
- co_detail := "N/W,W+/N,,,N/W "
- co_err := "N/W,W+/N,,,N/W "
- co_get := "N/W "
- co_blank := "N/N,N/N,,,N/W "
- co_wind := co_norm
- co_invwind := "N/W,W+/N,,,N/W "
- shade := "mono"
- ENDIF
-
- * set up code for the achoice example
-
- USE jobs NEW
- IF ! FILE("JOBS.NTX")
- INDEX on posit_type TO jobs
- ENDIF
-
- * put the job positions in an array
- PUBLIC ach_posit[max := LASTREC()], arr_bott
-
- FOR k := 1 TO max
- ach_posit[k] := posit_type
- skip
- NEXT
-
- * array demeninsions
- arr_top := 6
- arr_bott := 20
-
- IF (count := (arr_bott - (arr_top + 1)) + 1) > max
- arr_bott := arr_bott - (count - max)
- ENDIF
-
- return .t.
- * endfunc : init
-
- FUNCTION paint(pop)
- IF pop == "pop"
- SETCOLOR(pop_arry[--popptr])
- ELSE
- pop_arry[++popptr] := pop
- SETCOLOR(pop)
- ENDIF
- return .t.
- * endfunc : paint
-
- FUNCTION pclr(buff,t,l,b,r,frame)
- * 1 = clear 2 = double 3 = single 4 = doub top single side
- * 5 = single top doub side 6 = heavy box
-
- frame := IF(frame = 0 .or. frame > 7,1,frame)
-
- &buff := SAVESCREEN(t,l,b,r)
- @ t,l,b,r BOX;
- SUBSTR(" ╔═╗║╝═╚║ ┌─┐│┘─└│ ╒═╕│╛═╘│ ╓─╖║╜─╙║ █▀███▄██ ",;
- ((frame-1) * 9)+1,9)
- return .t.
- * endfunc : pclr
-
- FUNCTION readc
- SETCURSOR(.t.)
- READ
- SETCURSOR(.f.)
-
- return (LASTKEY() == 27)
- * endfunc : readc
-
-