informix-4gl 7.2编写的通用菜单函数( 二 )


let hlpmenu[3,4] = "设定各明细险种的佣金参数"
let hlpmenu[3,5] = "退出柜面处理系统"

let poprowno[4] = 5
let popmenu[4,1] = "1.系统版本信息"
let popmenu[4,2] = "2.系统开发环境"
let popmenu[4,3] = "3.系统操作指南"
let popmenu[4,4] = "4.信息反馈简介"
let popmenu[4,5] = "E.退 出"let hlpmenu[4,1] = "显示柜面处理系统的相关版本信息"
let hlpmenu[4,2] = "显示柜面处理系统的开发及应用环境"
let hlpmenu[4,3] = "显示柜面处理系统的各种操作指南"
let hlpmenu[4,4] = "显示本系统的信息反馈方式或获取相关资料"
let hlpmenu[4,5] = "退出柜面处理系统"let winopened = "N"
end function#####################################################
# 函数名称: dispmenu() #
# 作 用: 显示菜单函数 #
# 参 数: oper: = 0 显示菜单和选择 #
#####################################################
function dispmenu(oper)
define oper smallint
define i,j,k smallint
define answ char(1)
define cstart smallint
while true
current window is mtwin
let p_today = today using " mmm dd,yyyy "
#display p_today at 1,66 attribute(reverse,underline)
display "作者: 大梦 " at 1,66 attribute(reverse,underline)
for i = 1 to 4
let j = (i-1) * 161
display thrmenu[i] at 1,j
end for
let j = (menuno-1) * 161
display thrmenu[menuno] at 1,j attribute(reverse)
if currow <> 0 then
let cstart = (menuno-1)*163
let i = poprowno[menuno]1
if winopened = "N" then
open window popwin at rstart, cstart with i rows , 14 columns attribute (border,prompt line i)
let winopened = "Y"
else
current window is popwin
end if
for i = 1 to poprowno[menuno]
display popmenu[menuno,i] at i,1
end for
display popmenu[menuno,currow] at currow,1 attribute(reverse)

end if
if oper = 1 then
return
end if
while true
prompt " 请 选 择:" for char answ
on key (up)
if currow = 1 then
display popmenu[menuno,currow] at currow,1
let currow = poprowno[menuno]
else
if currow <> 1 and currow <> 0 then
display popmenu[menuno,currow] at currow,1
let currow = currow - 1
end if
end if
display popmenu[menuno,currow] at currow,1 attribute(reverse)

on key (down)
if currow = poprowno[menuno] then
display popmenu[menuno,currow] at currow,1
let currow = 1
else
if currow <> poprowno[menuno] and currow <> 0 then
display popmenu[menuno,currow] at currow,1
let currow = currow1
end if
end if
display popmenu[menuno,currow] at currow,1 attribute(reverse)
on key (left)
if winopened = "Y" then
close window popwin
let winopened = "N"
end if
if menuno > 1 then
let menuno = menuno - 1
else
let menuno = maxmenuno
end if
if poprowno[menuno] <> 0 then
let currow = 1
else
let currow = 0
end if
exit whileon key (tab,right)
if winopened = "Y" then
close window popwin
let winopened = "N"
end if
if menuno < maxmenuno then
let menuno = menuno1
else
let menuno = 1
end if
if poprowno[menuno] <> 0 then
let currow = 1
else
let currow = 0
end if
exit while【informix-4gl 7.2编写的通用菜单函数】on key (control-z,return)
return
end prompt
if answ matches "[Ee]" then
let currow = poprowno[menuno]
return
end if
case
when answ matches "[Aa]"
if winopened = "Y" then
close window popwin
let winopened = "N"
end if
let menuno = 1
exit while
when answ matches "[Bb]"
if winopened = "Y" then
close window popwin
let winopened = "N"
end if
let menuno = 2
exit while
when answ matches "[Cc]"
if winopened = "Y" then
close window popwin
let winopened = "N"
end if
let menuno = 3
exit while
when answ matches "[Dd]"
if winopened = "Y" then
close window popwin
let winopened = "N"

推荐阅读