SUB QUERY(MSGLINES%,MSGDAT$(1),QUADRANT$,MSG1$,LEFT.BUTTON.MSG$,LEFT.BUTTON.REPLY$,RIGHT.BUTTON.MSG$,RIGHT.BUTTON.REPLY$,QUERY.TYPE%,RETURN.CODE%) STATIC
100:
DEFINT A-Z
VIDEO.RETURN.CODE%=0
MAKEWIND.RETURN.CODE%=0
SETQUAD.RETURN.CODE%=0
MSGDAT.MIN=LBOUND(MSGDAT$) 'adjust to callers "OPTION BASE"
'Determine Maximum Length of Messages
MSGLEN%=0
110:
MENU.TOP.ROW=0
MENU.TOP.LEFT.COL=0
MENU.BOTTOM.ROW=0
MENU.BOTTOM.RIGHT.COL=0
FIRST.TIME=-1
'
'
SELECT CASE QUERY.TYPE%
CASE 0 'caution/question type window
FRAME=1
FORE=0 'black
BACK=6 'yellow
SHADOW=1
ACTIVE.FG%=0
ACTIVE.BG%=7 'white
INACTIVE.FG%=0
INACTIVE.BG%=6
LABEL$=""
CASE 1 'warning type window
FRAME=1
FORE=15 'high intensity white
BACK=4 'red
SHADOW=1
ACTIVE.FG%=0 'black
ACTIVE.BG%=7 'white
INACTIVE.FG%=7
INACTIVE.BG%=4
LABEL$=""
CASE ELSE
FRAME=1
FORE=0
BACK=6
SHADOW=1
ACTIVE.FG%=0
ACTIVE.BG%=7
INACTIVE.FG%=0
INACTIVE.BG%=6
LABEL$=""
END SELECT
'
120:
CLICK=0
LFT%=0
RGT%=0
BUTTONS%=0 'assume no mouse support avail
CALL MMCHECK(BUTTONS%) 'see if mouse support avail
MOUSEROW=0
MOUSECOL=0
CALL MMSETLOC(MOUSECOL,MOUSEROW) 'locate the mouse in upper left
CALL MMCURSORON
CALL MMGETLOC(MOUSECOL,MOUSEROW)
'find the length of the longest message line
'
200:
FOR I=MSGDAT.MIN TO MSGDAT.MIN+MSGLINES%
IF LEN(MSGDAT$(I)) > MSGLEN% THEN
MSGLEN%=LEN(MSGDAT$(I))
END IF
NEXT
MSG$=LTRIM$(RTRIM$(MSG1$))
IF MSGLEN%<LEN(MSG$) THEN 'make the header as big as
MSGLEN%=LEN(MSG$) 'longest message , if need be
END IF
' insure message buttons the same size as the largest of the two