home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- FUNCTION AEDMSG (msg_id, new_color)
- *****************************************************************
-
- * Display a message in the AEDBAR menu window
-
- * Copyright(c) 1991 - James Occhiogrosso
-
- # define UPARROW CHR(24)
- # define DNARROW CHR(25)
- # define RARROW CHR(26)
- # define LARROW CHR(27)
-
- LOCAL old_color, message
-
- * Check that AEDBAR is in use before displaying message
-
- IF TYPE("aedbar") != 'L'
- RETURN(.F.)
- ELSEIF .NOT. aedbar
- RETURN(.F.)
- ENDIF
-
- * If color string passed, use it. Otherwise, default
- * to window color.
-
- old_color = IF(new_color = NIL, SETCOLOR(colwindow), ;
- SETCOLOR(new_color) )
-
- IF TYPE('aed_row') != 'N'
- * AEDBAR row variable undefined. Default to bottom row
- aed_row = MAXROW()
- ENDIF
-
- * If prefixed by 'mw_', it is a message identifier. Set it to
- * lower case for processing. Otherwise, display passed string
- * without changes.
-
- IF LOWER(SUBSTR(msg_id,1,3)) = 'mw_'
- msg_id = LOWER(msg_id)
- ENDIF
-
- * Determine choice and save in message variable
-
- IF msg_id = 'mw_bof'
- message = ' ════════ Start of file ═══════ '
- ELSEIF msg_id = 'mw_dupkey'
- message = ' Duplicate key - reenter? Y/N '
- ELSEIF msg_id = 'mw_entval'
- message = ' Enter value (or blank to exit) '
- ELSEIF msg_id = 'mw_eof'
- message = ' ═════════ End of file ════════ '
- ELSEIF msg_id = 'mw_init'
- message = ' ' + LARROW + ' ' + RARROW + ' to select, ' ;
- + ' ' + UPARROW + ' ' + DNARROW + ' to browse '
- ELSEIF msg_id = 'mw_memo'
- message = ' Ctrl-Enter to Save, F2 for keys'
- ELSEIF msg_id = 'mw_nosave'
- message = ' Insufficient data - aborted '
- ELSEIF msg_id = 'mw_pgdn'
- message = ' PgDn=Save, Esc=Quit, F1=Help '
- ELSEIF msg_id = 'mw_recadd'
- message = ' Adding record '
- ELSEIF msg_id = 'mw_recrepl'
- message = ' Replacing record '
- ELSEIF msg_id = 'mw_reqd'
- message = ' Data is required. Please redo.'
- ELSEIF msg_id = 'mw_view'
- message = ' ' + UPARROW + ' ' + DNARROW + ;
- ' to browse, or Esc to exit '
- ELSEIF .NOT. EMPTY(msg_id)
- * If message is undefined, display first 32 characters
- message = SUBSTR(msg_id, 1, 32)
- ELSE
- * Otherwise, clear window
- message = SPACE(32)
- ENDIF
-
- * Display message and return.
-
- @ aed_row, 48 CLEAR TO aed_row, 79
- @ aed_row, 48 + (31-LEN(message))/2 SAY message
-
- SETCOLOR(old_color)
- RETURN .T.
- *
-