h55398
s 00001/00001/00059
d D 1.6 83/03/06 20:38:00 mjb 6 5
c 
e
s 00001/00001/00059
d D 1.5 83/03/04 14:16:45 mjb 5 4
c 
e
s 00001/00001/00059
d D 1.4 83/03/02 18:45:36 mjb 4 3
c put in switch ttyin calls
e
s 00007/00004/00053
d D 1.3 83/02/17 15:04:45 tes 3 2
c added graphic mode character cursor
e
s 00001/00001/00056
d D 1.2 83/02/01 16:55:28 mjb 2 1
c fixed bug with hitting <ESC> in choice menus
e
s 00057/00000/00000
d D 1.1 83/01/20 11:15:28 tes 1 0
c date and time created 83/01/20 11:15:28 by tes
e
u
tes
mjb
U
t
T
I 1
subroutine selchc (id, item)
########################################################################
#                                                                      #
#          THIS MATERIAL IS CONFIDENTIAL AND IS FURNISHED UNDER        #
#          A WRITTEN LICENSE AGREEMENT.  IT MAY NOT BE USED,           #
#          COPIED OR DISCLOSED TO OTHERS EXCEPT IN ACCORDANCE          #
#          WITH THE TERMS OF THAT AGREEMENT.                           #
#                                                                      #
#          COPYRIGHT (C) 1982 GRAPHIC SOFTWARE SYSTEMS INC.            #
#          ALL RIGHTS RESERVED.                                        #
#                                                                      #
#     Function: Obtain a menu choice from the defined choices          #
#                                                                      #
#     Input Parameters:                                                #
#            None                                                      #
#                                                                      #
#     Output Parameters:                                               #
#            id    - (integer) menu identification number              #
#            item  - (integer) menu item number                        #
#                                                                      #
#     Routines Called:                                                 #
#            None                                                      #
#                                                                      #
########################################################################
integer id, item

D 3
integer row, column
SHORTINT key, prompt(2)
E 3
I 3
integer contrl(4), ilen, prompt, row, column
SHORTINT key
E 3

include(`mnucom')

D 3
data prompt /BEL, NUL/
E 3
I 3
data contrl /OUTPUTxCURSORxADDRESSABLExTEXT, 0, 0, 0/
data prompt /BEL/
data ilen /1/
E 3

key = ESC
if (chcbfr(1) > 0) {   # make sure that we've got a choice defined
   row = chcbfr(1)
   column = chcbfr(2)
I 3
   call movcur (row, column)
E 3
   repeat {
D 3
      call qtext (row, column, prompt)
E 3
I 3
      call gzesc (contrl, ilen, prompt)
E 3
D 4
      call getkey (key)
E 4
I 4
D 5
      ifdef(`UNIX',`call gdevin (key)',`call ttyin (key)')
E 5
I 5
D 6
      call gtty (key)
E 6
I 6
      call ttyin (key)
E 6
E 5
E 4
D 2
      if (key == ESC) break
E 2
I 2
      if (key == ESC & crntid > 200) break
E 2
      } until (key >= DIG0 & key <= DIG9)  # loop until we get a digit
   }
if (key == ESC) {

   # switch to data area
   dtamod = ON
   }
else {
   
   # return the current menu id and item number
   id = crntid
   item = key - DIG0
   }

return
end
E 1
