home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / CL86_123.ZIP / BLIP001.PRG next >
Encoding:
Text File  |  1988-05-10  |  3.1 KB  |  130 lines

  1. *********** Version 2  2/19/87  9:59:20
  2. * Copyright (c) 1987 by Phoenix Systems, Inc.
  3. * Filename: blip001.prg
  4. * Author..: Robert V. Hannah III
  5. * Date....: Unk.
  6. * Modified: 08/20/86 mst
  7. *           09/18/86 rvh Worked on indirect amount bug
  8. *           11/27/86 rvh Major revisions to system
  9. *           08/28/87 gl  changed ref to BLIP to BUDGET in call to hdr_info
  10. *           11/10/87 gl  added skip 0 after calls to add_stuff
  11. *
  12. * This is the screen controller for BLIP.  Included are procedures for updating
  13. * totals, cursor movement, submenus, screen updates.
  14. *
  15. ***********
  16. parameters switch
  17. do case
  18. case switch = 'TOP'
  19.   do blipedit with  1,  67
  20. case switch = 'BOT'
  21.   do blipedit with 68,  91
  22. case switch = 'DEC'
  23.   do blipedit with 92, 171
  24. endcase
  25. return
  26.  
  27. ***********
  28. * Screen controller procedures
  29. ***********
  30.  
  31. procedure blipedit
  32. parameters home, end
  33. private edited, reading, mvar, change, update, x, submnu
  34.  
  35. for x = home to end  && paint screen with fields
  36.   mvar = cvar(x)
  37.   @ crow(x), ccol(x) say &mvar picture cpic(x)
  38. next
  39.  
  40.  edited = .f.
  41. reading = .t.
  42.       x = home
  43. do set_keys with .t.
  44. do while reading
  45.   mvar       = cvar(x)     && much needed everywhere -- use caution when changing
  46.   change     = &mvar
  47.   holdx      = x           && much needed in procedure ADD_STUFF
  48.   oldval     = change      && holds the old value of mvar
  49.   update     = .f.
  50.   @ crow(x), ccol(x) get &mvar picture cpic(x)
  51.   read
  52.   do case
  53.   case ! update        && for example, when the esc key is pressed
  54.     clear gets
  55.     replace &mvar with oldval
  56.   case change != 0 .or. submnu != ' '  && need to add and reshow totals
  57.     edited = .t.
  58.     skip 0
  59.   endcase
  60. enddo
  61. do set_keys with .f.
  62. return
  63.  
  64. *
  65.  
  66. procedure set_keys
  67. parameters do_set
  68. if do_set
  69.   set key 18 to special
  70.   set key  3 to special
  71.   set key  5 to special
  72.   set key 24 to special
  73.   set key 19 to special
  74.   set key  4 to special
  75.   set key  1 to special
  76.   set key  6 to special
  77.   set key 13 to special
  78.   set key 47 to special
  79.   set key -1 to special
  80.   set key -8 to special
  81. else
  82.   set key 18 to
  83.   set key  3 to
  84.   set key  5 to
  85.   set key 24 to
  86.   set key 19 to
  87.   set key  4 to
  88.   set key  1 to
  89.   set key  6 to
  90.   set key 13 to
  91.   set key 47 to
  92.   set key -1 to
  93.   set key -8 to
  94. endif
  95. return
  96.  
  97. *
  98.  
  99. procedure special
  100. parameters p, l, v
  101. private keyval
  102. clear gets
  103. keyval = lastkey()
  104. update = .t.
  105. change = &mvar - change
  106. @ crow(x), ccol(x) say &mvar picture cpic(x)
  107. do case
  108. case keyval = 13   && return
  109. * just sets update to .t.
  110. case keyval = 47   && slash
  111.   do submenu     && will handle settings for SWITCH and READING if need be
  112. case keyval = -1   && f2
  113.   do operate
  114. case keyval = -8   && f9
  115.   change = 0                && needed to disallow bypassing edit checking
  116.   replace &mvar with oldval && routines.  note that sub_zer still gets past.
  117.   @ crow(x), ccol(x) say oldval picture cpic(x)
  118.   do blp_calc
  119.   do sho_stuff
  120. case keyval =  3 .or. keyval = 18  && pgdn and pgup
  121.   reading = .f.
  122. case keyval =  1   && home
  123.   x = home
  124. case keyval =  6   && end
  125.   x = end
  126. otherwise
  127.   x = cposx(x, keyval)
  128. endcase
  129. return
  130.