home *** CD-ROM | disk | FTP | other *** search
- *********** Version 2 2/19/87 9:59:20
- * Copyright (c) 1987 by Phoenix Systems, Inc.
- * Filename: blip001.prg
- * Author..: Robert V. Hannah III
- * Date....: Unk.
- * Modified: 08/20/86 mst
- * 09/18/86 rvh Worked on indirect amount bug
- * 11/27/86 rvh Major revisions to system
- * 08/28/87 gl changed ref to BLIP to BUDGET in call to hdr_info
- * 11/10/87 gl added skip 0 after calls to add_stuff
- *
- * This is the screen controller for BLIP. Included are procedures for updating
- * totals, cursor movement, submenus, screen updates.
- *
- ***********
- parameters switch
- do case
- case switch = 'TOP'
- do blipedit with 1, 67
- case switch = 'BOT'
- do blipedit with 68, 91
- case switch = 'DEC'
- do blipedit with 92, 171
- endcase
- return
-
- ***********
- * Screen controller procedures
- ***********
-
- procedure blipedit
- parameters home, end
- private edited, reading, mvar, change, update, x, submnu
-
- for x = home to end && paint screen with fields
- mvar = cvar(x)
- @ crow(x), ccol(x) say &mvar picture cpic(x)
- next
-
- edited = .f.
- reading = .t.
- x = home
- do set_keys with .t.
- do while reading
- mvar = cvar(x) && much needed everywhere -- use caution when changing
- change = &mvar
- holdx = x && much needed in procedure ADD_STUFF
- oldval = change && holds the old value of mvar
- update = .f.
- @ crow(x), ccol(x) get &mvar picture cpic(x)
- read
- do case
- case ! update && for example, when the esc key is pressed
- clear gets
- replace &mvar with oldval
- case change != 0 .or. submnu != ' ' && need to add and reshow totals
- edited = .t.
- skip 0
- endcase
- enddo
- do set_keys with .f.
- return
-
- *
-
- procedure set_keys
- parameters do_set
- if do_set
- set key 18 to special
- set key 3 to special
- set key 5 to special
- set key 24 to special
- set key 19 to special
- set key 4 to special
- set key 1 to special
- set key 6 to special
- set key 13 to special
- set key 47 to special
- set key -1 to special
- set key -8 to special
- else
- set key 18 to
- set key 3 to
- set key 5 to
- set key 24 to
- set key 19 to
- set key 4 to
- set key 1 to
- set key 6 to
- set key 13 to
- set key 47 to
- set key -1 to
- set key -8 to
- endif
- return
-
- *
-
- procedure special
- parameters p, l, v
- private keyval
- clear gets
- keyval = lastkey()
- update = .t.
- change = &mvar - change
- @ crow(x), ccol(x) say &mvar picture cpic(x)
- do case
- case keyval = 13 && return
- * just sets update to .t.
- case keyval = 47 && slash
- do submenu && will handle settings for SWITCH and READING if need be
- case keyval = -1 && f2
- do operate
- case keyval = -8 && f9
- change = 0 && needed to disallow bypassing edit checking
- replace &mvar with oldval && routines. note that sub_zer still gets past.
- @ crow(x), ccol(x) say oldval picture cpic(x)
- do blp_calc
- do sho_stuff
- case keyval = 3 .or. keyval = 18 && pgdn and pgup
- reading = .f.
- case keyval = 1 && home
- x = home
- case keyval = 6 && end
- x = end
- otherwise
- x = cposx(x, keyval)
- endcase
- return
-