***************************************************************** *** Program:.... APP_UDFS.PRG *** Process Application Actions Based On Options Selected By User *** From Pulldown Menus -=- Includes Heavily Used Functions & *** Procedures That Need To Be In The Root Overlay *** Updated:.... April 3, 1991 *** Programmer:. R. Paulk *** Notice:..... Copyright (c) Ingenuity, Inc., 1990 ***************************************************************** PARAMETER udf_key IF TYPE("PDN_KEY") <> "N" * Define & Declare System Memory Variables DO sys_logs WITH "Log-On" pdn_key = -33 ELSE pdn_key = IIF(PCOUNT() >= 1, udf_key, pdn_key) ENDIF IF pdn_key = 22 .OR. pdn_key = -99 DO WHILE .T. SET KEY 28 TO help_do && Disable Context Sensitive Help During P/D Menu SET KEY -30 TO && Disable System Profile During P/D Menu SET WRAP ON SET MESSAGE TO 23 CENTER CALL FADE DO app_pdwn WITH pdn_key CALL BRIGHT IF !helping EXIT ELSE DO sys_help WITH "APP_PDWN", 0 pdn_key = 22 ENDIF ENDDO SET KEY 28 TO sys_help SET KEY -30 TO sys_prfl pdn_actnx = IIF(EMPTY(cur_prg), pdn_actn, pdn_actnx) IF pdn_actn <> pdn_actnx STORE .T. TO reset_sys STORE .F. TO tag_work, tag_seek RELEASE tag_all, tag_clear, tag_copy, tag_count, tag_del, tag_fltr RETURN ELSEIF !EMPTY(cur_prg) RETURN ENDIF ENDIF COMMIT IF sel_system .AND. (pdn_actn = "Quit To DOS") pdn_actn = "Return To Clip CASE" ENDIF DO WHILE (pdn_actn <> "Quit To DOS") .OR. sys_autop SETCOLOR(sys_unsl) @ 00, 00 SAY " Next Apps Ency Docs Test Source Data Locate Tags System " DO sys_guid M->tnext_actn = pdn_actn DO CASE CASE pdn_actn = "Next Action Recommended/Required" DO sys_next CASE pdn_actn = "Select Application" DO cc_apsel WITH "Select Application" CASE pdn_actn = "Return To Clip CASE" DO cc_apsel WITH "Return To Clip CASE" CASE pdn_actn = "Overlay Management & Memory Map" DO cc_mpdis CASE pdn_actn = "Update Compile/Link Information" pdn_actn = pdn_actnx DO no_op WITH .T. CASE pdn_actn = "User Access Level Control" pdn_actn = pdn_actnx DO no_op WITH .T. CASE pdn_actn = "Data Access Level Control" pdn_actn = pdn_actnx DO no_op WITH .T. CASE pdn_actn = "Choose Operations Scenario" pdn_actn = pdn_actnx DO no_op WITH .T. CASE pdn_actn = "Develop Operations Scenarios" pdn_actn = pdn_actnx DO no_op WITH .T. CASE pdn_actn = "Function Libraries" pdn_actn = pdn_actnx DO no_op WITH .T. CASE pdn_actn = "System Rolodex" DO sys_rldx CASE pdn_actn = "Data Encyclopedia" DO cc_dency CASE pdn_actn = "System Data Bases Master List" DO cc_mdbfs CASE pdn_actn = "Reports Management & Generation" DO sys_rpts CASE pdn_actn = "Edit User's Manual" DO cc_docs WITH "User's Manual" CASE pdn_actn = "Edit Technical Manual" DO cc_docs WITH "Technical Manual" CASE pdn_actn = "Edit Help Screens" DO cc_docs WITH "Help Screens" CASE pdn_actn = "View Criteria Development & Management" DO sys_fltr CASE pdn_actn = "Index Criteria Definition" DO sys_ntxs CASE pdn_actn = "Results & Status Of Ops. Tests" DO cc_optst CASE pdn_actn = "System Scenario Tests Report" DO sys_scnt CASE pdn_actn = "Test Schedule & Assignments" DO cc_sctst CASE pdn_actn = "System Performance Tests Plan" DO cc_ptstp CASE pdn_actn = "Integration Test Guide" DO cc_itstg CASE pdn_actn = "Unit Test Procedures" DO cc_utstp CASE pdn_actn = "What Next Update Analysis" DO cc_nextu CASE pdn_actn = "Memory Map Analysis" DO cc_mpanl CASE pdn_actn = "Source Code Analysis" DO cc_scanl CASE pdn_actn = "System Architecture/Flow Analysis" DO cc_xflow CASE pdn_actn = "Screen Saver" DO sys_ssav CASE pdn_actn = "Capture Baseline Values" DO cc_blcap CASE pdn_actn = "System User Preferences" DO sys_pref WITH "System User Preferences" CASE pdn_actn = "Auto Pilot/System Housekeeping" DO sys_autp CASE pdn_actn = "Evaluate System Needs" DO sys_eval CASE pdn_actn = "Data Base Validation & Management" DO sys_dbmp CASE pdn_actn = "Inventory Application System Data Bases" DO sys_dbmp ENDCASE STORE "" TO menu_title STORE .F. TO reset_sys, return_to CLEAR TYPEAHEAD IF sel_system .AND. (pdn_actn = "Quit To DOS") pdn_actn = "Return To Clip CASE" ENDIF ENDDO CLOSE DATABASES DO sys_logs WITH "Log-Off" QUIT PROCEDURE autoguide STORE .T. TO reset_sys, sys_autog RETURN FUNCTION _inkey && Processes INKEY(?) Wait States PARAMETERS cur_prg, mprocline, interrupt, abort_work interrupt = IIF(PCOUNT() >= 3, interrupt, .F.) h_pack() IF PCOUNT() = 0 .OR. (interrupt .AND. NEXTKEY() = 0) RETURN(0) ENDIF abort_work = IIF(PCOUNT() >= 4, abort_work, .F.) udf_wa = SELECT() key_in = IIF(mprocline < 0, -1, 0) IF M->sys_tutr .AND. !(M->mhelptopic == M->sys_ttopic) M->sys_ttopic = "Tutor Call" DO sys_help WITH cur_prg, mprocline ENDIF autop_st = SECONDS() DO WHILE key_in = 0 key_in = IIF(interrupt, NEXTKEY(), INKEY()) key_in = IIF(helping, 0, key_in) abort = IIF(interrupt .AND. key_in = 27, .T., .F.) IF VAL(SUBSTR(TIME(), 4, 2)) % 20 = 0 .AND.; UPPER(TRIM(sys_next->next_actn)) <> "EVALUATE SYSTEM NEEDS" SELECT sys_next SET ORDER TO 02 && UPPER(next_actn)+UPPER(prg_name) SEEK "EVALUATE SYSTEM NEEDS" REPLACE sys_next->next_need WITH .T. ENDIF DO CASE CASE key_in = -7 DO mem_captur CASE key_in = 27 .AND. abort_work CTR_STR(23, "Aborting Process -- Please Wait", sys_wrkng) CASE key_in = 28 .AND. !helping DO sys_help WITH cur_prg, mprocline CASE key_in = - 30 .AND. !helping DO sys_prfl WITH cur_prg, mprocline, mhelptopic CASE key_in = 291 h_hotkey() CASE key_in = 290 STORE .T. TO reset_sys, sys_autog EXIT CASE (SECONDS() - autop_st > (sys_aptout * 60)) STORE .T. TO reset_sys, sys_autop EXIT ENDCASE autop_st = IIF((!interrupt) .AND. (key_in = 28 .OR. key_in = - 30 .OR.; key_in = 291 .OR. key_in = 291), SECONDS(), autop_st) key_in = IIF((!interrupt) .AND. (key_in = 28 .OR. key_in = - 30 .OR.; key_in = 291 .OR. key_in = 290), 0, key_in) ENDDO IF interrupt CLEAR TYPEAHEAD ENDIF SELECT (udf_wa) RELEASE ALL EXCEPT key_in RETURN(key_in) FUNCTION beep && Bells & Whistles PARAMETERS beep_name IF sys_bells DO CASE CASE beep_name = "attn" TONE(1240, .5) TONE(1640, .5) TONE(1840, 1) CASE beep_name = "done" TONE(1440, .5) TONE(1440, .5) CASE beep_name = "error" TONE(596, 2) TONE(596, 2) TONE(564, 2) TONE(620, 2) TONE(596, 4) TONE(564, 4) CASE beep_name = "charge" TONE(723, 1) TONE(898, 1) TONE(1080, 1) TONE(1246, 2) TONE(1080, 1) TONE(1246, 4) ENDCASE ENDIF RELEASE ALL RETURN .T. FUNCTION ctr_str && Center Messages On Screen PARAMETERS c_row, c_str, new_color SETCOLOR(new_color) c_str = IIF(LEN(c_str) > 78, SUBSTR(c_str, 1, 78), c_str) IF c_row > 20 .OR. c_row = 00 @ c_row, 00 CLEAR TO c_row, 79 ELSE @ c_row, 02 CLEAR TO c_row, 77 ENDIF ctr_len = LEN(c_str) @ c_row, (80-ctr_len)/2 SAY c_str RELEASE ALL h_pack() RETURN(0) FUNCTION str_ctr && Centers String In Fixed Length Variable PARAMETERS c_str, c_len * This function pads a character string with an equal (if possible) * number of spaces on both the left and right of the string. It is * used to center a text string in a specified length * variable. c_str = SPACE(ROUND((c_len - LEN(c_str)) / 2, 0)) + c_str c_str = c_str + SPACE(c_len - LEN(c_str)) RETURN c_str FUNCTION pls_wait && Please Wait Processing/Loading PARAMETERS process, open SETCOLOR(sys_unsl) IF open BOX_EXPL(09, 23, 12, 57, "赏缓纪群 ", 24, 39) PUBLIC box_please box_please = box_scrn BOX_MSGS(09, 23, 12, 57, "Please Wait", 01, sys_msgs) BOX_MSGS(09, 23, 12, 57, IIF(process, "Processing " + ALLTRIM(STR(RECCOUNT())) +; " Records", "Loading Data Bases" ), 02, sys_msgs) CTR_STR(24, " * * * * W O R K I N G * * * * ", sys_wrkng) ELSE box_scrn = box_please BOX_IMPL(09, 23, 12, 57, "赏缓纪群 ", 24, 39) CTR_STR(24, "", sys_msgs) BEEP("done") RELEASE box_please RELEASE ALL h_pack() ENDIF RETURN(.T.) PROCEDURE no_op && Function Not Applicable PARAMETERS not_impl not_impl = IIF(PCOUNT() < 1, .F., .T.) h_pack() old_color = SETCOLOR() SETCOLOR(sys_warn) BOX_EXPL(09, 19, 12, 59, "赏缓纪群 ", 24, 39) BOX_MSGS(09, 19, 12, 59, "� No-Op Menu Functions �", 00, sys_warn) BOX_MSGS(09, 19, 12, 59, IIF(not_impl, "This Function Not Implemented",; "This Function Not Applicable"), 01, sys_msgs) BOX_MSGS(09, 19, 12, 59, IIF(not_impl, "In This Version/Release",; "At This Point In System Processing"), 02, sys_msgs) BEEP("attn") INKEY(3) BOX_IMPL(09, 19, 12, 59, "赏缓纪群 ", 24, 39) SETCOLOR(old_color) RELEASE ALL RETURN FUNCTION box_expl && Draw An Exploding Box PARAMETERS t, l, b, r, outline, start_row, start_col, rel_box rel_box = IIF(PCOUNT() >= 8, rel_box, .F.) SAVE SCREEN TO box_scrn IF sys_zoom > 0 h_pack() it = IIF(tsys_zoom),((t-start_row)/M->sys_zoom)) il = IIF(lsys_zoom),((l-start_col)/M->sys_zoom)) ib = IIF(bsys_zoom),((b-start_row)/M->sys_zoom)) ir = IIF(rsys_zoom),((r-start_col)/M->sys_zoom)) FOR n=1 TO M->sys_zoom xt = ROUND(start_row+(it*n),0) xl = ROUND(start_col+(il*n),0) xb = ROUND(start_row+(ib*n),0) xr = ROUND(start_col+(ir*n),0) @ xt,xl,xb,xr BOX outline NEXT RESTORE SCREEN FROM box_scrn ENDIF @ t, l, b, r BOX outline box_scrn = IIF(rel_box, "", box_scrn) RELEASE ALL h_pack() RETURN .T. FUNCTION box_impl && Implode An Existing Box PARAMETERS t, l, b, r, outline, start_row, start_col h_pack() IF !EMPTY(box_scrn) IF sys_zoom > 0 it = IIF(tsys_zoom),((t-start_row)/M->sys_zoom)) il = IIF(lsys_zoom),((l-start_col)/M->sys_zoom)) ib = IIF(bsys_zoom),((b-start_row)/M->sys_zoom)) ir = IIF(rsys_zoom),((r-start_col)/M->sys_zoom)) FOR n=1 TO M->sys_zoom xt = ROUND(t-(it*n),0) xl = ROUND(l-(il*n),0) xb = ROUND(b-(ib*n),0) xr = ROUND(r-(ir*n),0) RESTORE SCREEN FROM box_scrn @ xt,xl,xb,xr BOX outline NEXT ENDIF RESTORE SCREEN FROM box_scrn ENDIF box_scrn = "" RELEASE ALL h_pack() RETURN .T. FUNCTION box_msgs && Centers Messages Inside Box PARAMETERS t, l, b, r, ctr_msg, box_row, new_color SETCOLOR(new_color) box_width = (r - l) ctr_msg = IIF(LEN(ctr_msg) > (box_width - 4), SUBSTR(ctr_msg, 1, box_width - 4 ), ctr_msg) ctr_len = LEN(ctr_msg) IF (box_row + t) > t .AND. (box_row + t) < b @ t + box_row, l + 1 SAY SPACE((box_width - 2)) ENDIF @ t + box_row, (l + 1) + ((box_width - ctr_len)/2) SAY ctr_msg RELEASE ALL h_pack() RETURN .T. PROCEDURE mem_captur old_color = SETCOLOR() FOR nxn = 1 TO 99 IF !FILE("SYSVAR" + STRZERO(nxn, 2) + ".MEM") EXIT ENDIF NEXT CTR_STR(23, "Writing System Memory Variables To: " + "SYSVAR" + STRZERO(nxn, 2) + ".MEM", sys_msgs) INKEY(1) BEEP("done") SAVE TO ("SYSVAR" + STRZERO(nxn, 2) + ".MEM") ALL EXCEPT box* CTR_STR(23, "", sys_msgs) SETCOLOR(old_color) RETURN