home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1990-06-08 | 107.7 KB | 3,508 lines
{****************************************************************************** MULTI-EDIT MACRO FILE SETUP Name: SETUP Description: The installation and setup utilities SETUP - The main Installation and Setup menu CHECK_SETUP - Checks for changed configuration and prompts for saving KEYSPEED - The key repeat speed menu SETEMS - Menu for configuring shell to DOS Ems and/or disk swapping SETEMSUSE - Prompt for EMS for file data configuration SCRSTYLE - The screen setup menu SETSAVE - Generates and compiles INIT.SRC to save settings SETKEYS - The key remapping menu DEFINE_KEY - Prompts for key to define in SETKEYS SETCOLOR - The color installation menu DISPLAY_SETUP - The display configuration menu SRCHSET - The search configuration menu SETEDIT - The edit settings menu SETMEPATHS - Sets up the backup methods, backup and temp file paths SETMOUSE - The mouse settings menu PRTTYPE - The printer setup menu EXTENS - The filename extension specific setup menu PGM_DB - A menu of compiler interfaces for the selected extension PGM_WARNING - Warns user of adding program types without support LANG_WARNING - Warns user of adding language types without support EXT_FORMAT - Creates and/or edits extension specific format lines. TGLVID - Toggles video mode KEYCODE - Get key1 and key2 scan codes for any keystroke MAKEKEY - Get key name from 2 scan codes BUILDKEY - Converts a keystroke macro to a macro language statement (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} $MACRO SETUP TRANS; {****************************************************************************** MULTI-EDIT MACRO (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} {Global_Variables used: Global_Int('Init_Window') - The window for INIT.SRC Global_Int('SETUP_X1') - The upper left X coordinate of the setup menu Global_Int('SETUP_Y1') - The upper left Y coordinate of the setup menu Global_Str('PRINTER_TYPE') - The currently defined printer type Global_Int('RESTORE') - The restore flag Global_Int('EMS_DEFAULT') - The level of EMS support } def_str( gstr[20], bstr[4] ); Def_Str(Menu_Str,Temp_String); Def_Int(Jx,X1,Y1,J2,J3,Old_Ex,Temp_Insert,Temp_Window, old_refresh); {initialize some variables, save some system variable values into temporary variables, etc.} Undo_Stat := False; Temp_Insert := Insert_Mode; Push_Labels; Flabel('Help',1,-1); Old_Refresh := Refresh; Refresh := False; Messages := False; Temp_Window := Cur_Window; Ignore_Case := True; JX := 1; X1 := 2; Y1 := 3; Set_Global_Int('SETUP_X1',X1); Set_Global_Int('SETUP_Y1',Y1); Old_Ex := Explosions; gstr := Str(global_int('MENU_LEVEL')) + 'MSTR_'; bstr := ''; {The main setup menu} Setup_Loop2: if user_id <> '' then temp_string := '(' + caps(user_id) + ')-'; else temp_string := ''; end; Set_Global_Str('@INEV#1', '/T=Exit Setup/KC=<ESC>/K1=27/K2=1/R=0/W=15/X=' + str( x1 + 16 ) + '/Y=' + str( y1 + 19)); Put_Box(X1,Y1,X1 + 51,Y1 + 20,0,m_b_color,temp_string + 'INSTALLATION AND SETUP',true); Explosions := Old_Ex; Setup_Loop: RM('CheckEvents /M=2/G=@INEV#/#=1'); {Write the DOS version} {Changed position 3-12-90 to accomodate a possible processor type being 80186/80188} Write('DOS=',X1 + 1,Y1 + 1, 0, m_t_color); Write(STR(DOS_VERSION AND $00FF) + '.' + STR(DOS_VERSION SHR 8), x1 + 5,y1 + 1, 0,m_s_color); {Write the processor type} IF Cpu = 0 THEN Menu_Str := '8086/8088'; ELSIF Cpu = 1 THEN Menu_Str := '80186/80188'; ELSIF Cpu = 2 THEN Menu_Str := '80286'; ELSIF Cpu = 3 THEN Menu_Str := '80386'; END; {Changed position 3-12-90 to accomodate a possible processor type being 80186/80188} Write('CPU=',x1 + 11,y1 + 1,0,m_t_color); Write(Menu_Str,x1 + 15,y1 + 1,0,m_s_Color); {Write the Video adapter type} IF Video_Card = 0 THEN Menu_Str := 'CGA'; ELSIF Video_Card = 1 THEN Menu_Str := 'IBM Monochrome'; ELSIF Video_Card = 2 THEN Menu_Str := 'MONROE Color'; ELSIF Video_Card = 3 THEN Menu_Str := 'MONROE Mono.'; ELSIF Video_Card = 4 THEN Menu_Str := 'SIGMA Color 400'; ELSIF Video_Card = 5 THEN Menu_Str := 'EGA Color'; ELSIF Video_Card = 6 THEN Menu_Str := 'Hercules Monochrome'; ELSIF Video_Card = 7 THEN Menu_Str := 'VGA Monochrome'; ELSIF Video_Card = 8 THEN Menu_Str := 'VGA Color'; ELSIF Video_Card = 9 THEN Menu_Str := 'EGA Monochrome'; ELSIF Video_Card = 10 THEN Menu_Str := 'Wyse 700'; ELSIF Video_Card = 11 THEN Menu_Str := 'ATI EGA Wonder'; ELSE Menu_str := 'CUSTOM'; END; Write('Video Card = ',x1 + 1,y1 + 2,0,m_t_color); Write(Menu_Str,x1 + 14,y1 + 2,0,m_s_color); Write('Expanded Memory ',x1 + 27,y1+1,0,m_t_color); If ems_installed <> 0 then R_AX := $4200; INTR( $67 ); Write( ' ', x1 + 43, y1 + 1, 0, m_s_color ); Write( Str( (R_BX * $4000) / 1024 ) + 'k', x1 + 43, y1 + 1,0, m_s_color ); else Write( 'N/A ', x1 + 43, y1 + 1, 0, m_s_color ); end; {Write the path to find me files} Write('ME Path = ',x1 + 1,y1+3,0,m_t_color); Write( Copy(Me_Path,1,39), x1 + 11, y1 + 3, 0, m_s_color ); Write('────────────────────────────────────────────────', x1 + 1, y1 + 4, 0, m_b_color ); {Now build the main setup menu string} {Menu choices edit settings, colors, screen setup, and key remapping} create_global_str(gstr + '1', '/N=Edit settings... /M=SETEDIT'); create_global_str(gstr + '2', '/N=Display setup...'); create_global_str(gstr + '3', '/N=Key mapping.../M=SETKEYS'); If Mouse Then Menu_Str := 'On'; ELSE Menu_Str := 'Off'; END; create_global_str(gstr + '4', '/N=Mouse... ^' + menu_str + '/S=3/M=SETMOUSE'); {Extensions} create_global_str(gstr + '5', '/N=Filename extensions.../M=EXTENS'); Temp_String := Parse_Str('PT=',Global_Str('PRINTER_TYPE')); If (Temp_String = '') Then Temp_String := 'NONE'; End; {Printer} create_global_str(gstr + '6', '/S=3/N=Printer type... ^' + Temp_String + '/M=PRTTYPE /X=4/Y=8'); If (Global_Int('RESTORE')) Then Temp_String := 'On'; ELSE Temp_String := 'Off'; END; create_global_str(gstr + '7', '/N=Restore ^' + temp_string); {EMS Support level} IF swap_mode = 3 THEN temp_string := 'Swap to EMS and Disk'; ELSIF swap_mode = 2 THEN temp_string := 'Swap to EMS Only'; ELSIF swap_mode = 1 THEN temp_string := 'Swap to Disk Only'; ELSIF swap_mode = 0 THEN temp_string := 'No Swapping'; END; create_global_str(gstr + '8', '/S=3/N=Shell to DOS method... ^' + temp_string + '/M=SETEMS /Y=19'); j3 := Global_Int('@EMS_AMOUNT@'); If (j3 > 0) Then Temp_String := 'Yes - ' + str(j3 * 64) + 'K'; ELSE Temp_String := 'No'; END; create_global_str(gstr + '9', '/S=3/N=Use EMS for editing... ^' + temp_string); If File_Locking Then Temp_String := 'On'; ELSE Temp_String := 'Off'; END; create_global_str(gstr + '10', '/N=Network file locking ^' + temp_string); create_global_str(gstr + '11', '/N=Backups//Directories.../M=SETMEPATHS'); create_global_str(gstr + '12','/N=|254'); create_global_str(gstr + '13', '/N=module//option Installation'); create_global_str(gstr + '14', '/N=saVe configuration and exit'); {Put up menu for selection} RM('USERIN^SUBMENU /H=IN/GCLR=1/A=1/B=1/#=14/G=' + gstr + '/X=' + str( x1 + 1) + '/Y=' + str( y1 + 5) + '/S=' + global_str( gstr + '0') + '/BC=' + str(box_count) ); IF (return_int < 1 ) THEN IF check_key THEN IF (key1 = 0) AND (key2 = 250) THEN RM('CheckEvents /M=1/G=@INEV#/#=1'); IF (return_int <> 0) THEN return_int := parse_int('/R', return_str ); IF return_int = 0 THEN goto save_exit; END; END; goto setup_loop2; END; END; goto save_exit; END; jx := return_int; IF JX = 2 THEN RM( 'DISPLAY_SETUP /X=' + str( x1 + 5) + '/Y=' + str( y1 + 6) + '/BC=' + str(box_count - 1)); Old_Ex := Explosions; IF return_int = 1000 THEN refresh := true; new_screen; refresh := false; goto setup_loop2; END; Goto Setup_Loop; ELSIF (JX = 7) THEN Set_GLobal_Int('RESTORE',NOT(Global_Int('RESTORE'))); call set_changed; ELSIF (jx = 9) THEN RM( 'SETEMSUSE /X=' + str( x1 + 2 ) + '/Y=' + str( y1 + 14 ) ); ELSIf (jx = 10) then file_locking := not(file_locking); call set_changed; ELSIF (jx = 13) THEN kill_box; RM('MODINST'); goto setup_loop2; ELSIf (jx = 14) then RM('SETSAVE'); jx := 1; goto save_exit2; end; IF jx > 0 THEN Goto Setup_Loop; END; save_exit: jx := global_int( 'SETUP_CHANGED' ); rm( 'check_setup /X=10/Y=10'); IF return_int < 1 THEN goto setup_loop; END; save_exit2: {Clean up and exit} Kill_Box; Kill_box; IF (JX > 0) THEN RM('SetScrn'); END; New_Screen; Messages := True; Undo_Stat := True; explosions := old_ex; Goto Exit; {********************************* SUBROUTINES *******************************} set_changed: Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); RET; EXIT: RM('CheckEvents /M=3/G=@INEV#/#=1'); switch_window(temp_window); Set_Global_Int('Init_Window',0); Pop_Labels; Insert_Mode := Temp_Insert; Refresh := Old_Refresh; Undo_Stat := True; Explosions := Old_Ex; return_int := 1; END_MACRO; $MACRO CHECK_SETUP TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: CHECK_SETUP Description: Checks for configuration changed and prompts the user to save. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_int( x, y ); X := parse_int( '/X=', mparm_str ); Y := parse_int( '/Y=', mparm_str ); IF x = 0 THEN x := 2; END; IF y = 0 THEN y := 2; END; return_int := 1; IF Global_Int('SETUP_CHANGED') THEN Put_Box(x,y,x + 47, y + 4,0,m_b_color,'WARNING: CONFIGURATION CHANGED',true); Write('Exit without saving configuration settings?',x + 1, y + 1,0,m_s_color); RM('USERIN^XMENU /X=' + str( x + 8 ) + '/Y=' + str(y + 2 ) + '/S=1/M=No (IN)Yes ()Save settings and exit()'); Kill_Box; IF return_int = 3 THEN {Run the actual code generator and compiler} RM( 'SETSAVE' ); If (Return_Str = 'COMP ERROR') Then return_int := 0; ELSE return_int := 1; End; ELSIF return_int = 2 THEN return_int := 1; ELSE return_int := 0; END; END; END_MACRO; $MACRO KEYSPEED TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: KEYSPEED Description: Makes use of the INTR interrupt command to set the keyboard typematic rate. Will only work on machines with newer BIOS which support the INT $16, function 3. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} {Global variables used: Global_Int('IINT_1') The following 8 globals are used to run the macro Global_Str('IPARM_1') DATA_IN which is part of the macro file MEUTIL2. Global_Int('IINT_2') A very thourough explanation of the usage of these Global_Str('IPARM_2') is explained in the source for this macro. Global_Int('ISTR_2') Global_Int('ISTR_1') Global_Int('KEYSPEED') The currently defined key repeat speed Global_Int('KEYDELAY') The currently defined key repeat delay(from the time a key is pressed till key repeat begins) } Def_Int( speed, keydelay ); def_str( temp_return ); temp_return := return_str; {We'll use the DATA_IN macro to input the keyrepeat values} Set_Global_Int( 'IINT_1', Global_Int('KEYSPEED') ); Set_Global_Str( 'IPARM_1', '/T=Repeat speed (0 = fastest, 31 = slowest):/C=2/L=1/W=3/TP=1' ); Set_Global_Int( 'IINT_2', Global_Int('KEYDELAY') ); Set_Global_Str( 'IPARM_2', '/T=Repeat delay (0 = least, 3 = most):/C=2/L=2/W=3/TP=1' ); RM( 'USERIN^Data_In /H=INEDKE/#=2/S=1/A=2/X=' + str(parse_int('/X=', mparm_str)) + '/Y=' + str(parse_int('/Y=', mparm_str)) + '/T=SETUP KEYBOARD REPEAT' ); speed := Global_Int( 'IINT_1' ); keydelay := Global_Int( 'IINT_2' ); {clean up globals} Set_Global_Int( 'IINT_1', 0 ); Set_Global_Int( 'IINT_2', 0 ); Set_Global_Int( 'ISTR_2', 0 ); Set_Global_Int( 'ISTR_1', 0 ); If (Speed < 0) or (speed > 31) or (keydelay < 0) or (keydelay > 3) THEN RM('MEERROR^Beeps /C=1'); goto exit; END; {Set up the registers and do the interrupt} IF (Global_Int('NO_KEYSPEED') = 0) THEN R_BX := (keydelay shl 8) or speed; R_AX := $0305; INTR( $16 ); END; {Save the new current values into global variables} Set_Global_Int('KEYSPEED', speed); Set_Global_Int('KEYDELAY', keydelay); exit: return_str := TEMP_RETURN; return_int := 0; END_MACRO; $MACRO SETUP_AUTO TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETUP_AUTO Description: Menu for setting up autosave for 2 autosave methods Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_str( temp_return[20],M_Str[20] ); temp_return := return_str; Set_Global_Int('IINT_1', parse_int('/T1=', global_str('@AUTOSAVEPARMS')) ); Set_Global_Str('IPARM_1','/T=Seconds of keyboard inactivity (0 = OFF).. /C=1/TP=1/W=3/L=1/MIN=0/MAX=254'); Set_Global_Int('IINT_2', parse_int('/S1=', global_str('@AUTOSAVEPARMS')) ); Set_Global_Str('ISTR_2','/T=YES/F=NO'); Set_Global_Str('IPARM_2','/T=Save complete editor status as well as files/C=1/L=2/W=3/TP=5'); Set_Global_Int('IINT_3', parse_int('/T2=', global_str('@AUTOSAVEPARMS')) ); Set_Global_Str('IPARM_3','/T=Absolute interval in seconds (0 = OFF).. /C=1/TP=1/W=3/L=3/MIN=0/MAX=999'); Set_Global_Int('IINT_4', parse_int('/S2=', global_str('@AUTOSAVEPARMS')) ); Set_Global_Str('ISTR_4','/T=YES/F=NO'); Set_Global_Str('IPARM_4','/T=Save complete editor status as well as files/C=1/L=4/W=3/TP=5'); RM( 'USERIN^Data_In /H=INEDAU/#=4/S=1/A=2/X=' + str(parse_int('/X=', mparm_str)) + '/Y=' + str(parse_int('/Y=', mparm_str)) + '/T=SETUP AUTOSAVE' ); RM('SetAutoSave /M2=1/T1=' + str( Global_Int( 'IINT_1' )) + '/S1=' + str( Global_Int( 'IINT_2' )) + '/T2=' + str( Global_Int( 'IINT_3' )) + '/S2=' + str( Global_Int( 'IINT_4' )) + '/H1=' + parse_Str('/H1=', global_str('@AUTOSAVEPARMS')) + '/H2=' + parse_Str('/H2=', global_str('@AUTOSAVEPARMS'))); exit: return_str := TEMP_RETURN; return_int := 0; END_MACRO; $MACRO SETEMS TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETEMS Description: Menu to configure shell to DOS swapping to ems and/or disk. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_int( x, y, t_es1, t_es ); x := Parse_Int('/X=', mparm_str ); y := Parse_Int('/Y=', mparm_str ); IF x = 0 THEN x := 2; END; IF y = 0 THEN y := 2; END; {get individual flags(nybbles) by masking} Set_Global_Str('ISTR_1','No swap()swap to Disk only()swap to EMS only()Swap to EMS, then to disk()'); Set_Global_Int('IINT_1', swap_mode + 1 ); Set_Global_Str('IPARM_1','/T=Swap method:/C=1/TP=3/W=25/L=1'); Set_Global_Int('IINT_2', (swap_mem * 16) / 1024 ); Set_Global_Str('IPARM_2','/T=Maximum memory to free up (in K bytes; 0 = ALL):/C=1/W=6/TP=1/L=2'); Set_Global_Int('IINT_3', max_swap_ems * 16); Set_Global_Str('IPARM_3','/T=Maximum expanded memory to use (in K bytes; 0 = ALL):/C=1/W=6/TP=1/L=3'); RM('UserIn^Data_In /H=INSHELL/S=1/A=2/#=3/T=SHELL TO DOS // EMS SETUP/X=' + str(x) + '/Y=' + str(y)); swap_mode := Global_Int('IINT_1') - 1; Swap_Mem := (Global_Int('IINT_2') * 1024) / 16; Max_Swap_EMS := Global_Int('IINT_3') / 16; t_es := Global_Int('EMS_DEFAULT'); t_es := t_es or 2; {Set global to new value} Set_GLobal_Int('EMS_DEFAULT', t_es); Ems_Stat := t_es; Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); END_MACRO; $MACRO SETEMSUSE TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETEMSUSE Description: Promt to configure EMS use for file data. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_int( x, y, t_es1, t_es ); x := Parse_Int('/X=', mparm_str ); y := Parse_Int('/Y=', mparm_str ); IF x = 0 THEN x := 2; END; IF y = 0 THEN y := 2; END; RETURN_INT := Global_Int('@EMS_AMOUNT@') * 64; RM( 'USERIN^QUERYBOX /T=ENTER AMOUNT OF MEMORY IN K BYTES(0-16000, 0 = NONE)/P=Amount will be rounded to nearest 64K block: /W=6/MAX=16000/MIN=0/N=1/L=' + str(y) + '/C=' + str(x)); IF Return_Str = 'TRUE' THEN IF return_int = 0 THEN Set_Global_Int('@EMS_AMOUNT@', 0 ); ELSE Set_Global_Int('@EMS_AMOUNT@', (return_int + 63) / 64 ); END; Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); END; END_MACRO; $MACRO SCRSTYLE TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SCRSTYLE Description: This is the Setup menu for the 2 screen configurations. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} {Global variables used: Global_Int('SETUP_X1') The X and Y coordinates of the upper left hand corner Global_Int('SETUP_Y1') of the main installation and setup menu box Global_Int('DEF_SCRN_STYLE') The default screen configuration } Def_Int(jx,DSS,x1,y1, j1, j2 , xa, sx,mx,fx, lb, rb, mb); Def_Str( tstr, tstr2[80] ); Def_Char( style ); X1 := parse_int('/X=', mparm_str ); Y1 := parse_int('/Y=', mparm_str ); IF x1 = 0 THEN x1 := 2; END; IF y1 = 0 THEN y1 := 2; END; Put_Box(x1,y1, x1 + 31, y1 + 3, 0, m_b_color, 'SCREEN SETUP', true); j1 := 1; DSS := Global_Int('DEF_SCRN_STYLE'); Screen_Loop: draw_char( 32, x1 + 1, y1 + 1, m_b_color, 28 ); If dss = 1 THEN Tstr := 'layout A((default)(INSC)layout B()'; ELSE If dss = 2 THEN Tstr := 'layout A(INSC)layout B((default)()'; ELSE Tstr := 'layout A(INSC)layout B()'; END; END; RM('USERIN^XMENU /S=' + str( j1) + '/X=' + str( x1 + 2) + '/Y=' + str( y1 + 1) + '/M=' + Tstr); j1 := return_int; if j1 > 0 then xa := x1 + (j1 * 9) - 8; style := Char(j1 + 64); tstr2 := global_str('@SCREEN_SET' + style ); mx := parse_int('/M=', tstr2); sx := parse_int('/S=', tstr2); fx := parse_int('/F=', tstr2); lb := parse_int('/LB=', tstr2); rb := parse_int('/RB=', tstr2); mb := parse_int('/MB=', tstr2); jx := xpos('/MACRO=', tstr2, 1 ); if jx <> 0 then tstr := shorten_str(copy( tstr2, jx + 7, 40 )); else tstr := ''; end; Set_Global_Int('IINT_1',dss = j1); Set_Global_Str('ISTR_1','/T=YES/F=NO'); Set_Global_Str('IPARM_1','/T=Default................................./C=1/W=3/TP=5'); Set_Global_Int('IINT_2',sx); Set_Global_Str('ISTR_2','/T=YES/F=NO'); Set_Global_Str('IPARM_2','/T=Status line............................./C=1/W=3/TP=5'); Set_Global_Int('IINT_3',mx); Set_Global_Str('ISTR_3','/T=YES/F=NO'); Set_Global_Str('IPARM_3','/T=Message Line............................/C=1/W=3/TP=5'); Set_Global_Int('IINT_4',mb); Set_Global_Str('ISTR_4','/T=YES/F=NO'); Set_Global_Str('IPARM_4','/T=Menu bar................................/C=1/W=3/TP=5'); Set_Global_Int('IINT_5',fx); Set_Global_Str('ISTR_5','/T=YES/F=NO'); Set_Global_Str('IPARM_5','/T=Function key labels...................../C=1/W=3/TP=5'); Set_Global_Int('IINT_6',lb); Set_Global_Str('ISTR_6','/T=YES/F=NO'); Set_Global_Str('IPARM_6','/T=Left-hand border on full screen window../C=1/W=3/TP=5'); Set_Global_Int('IINT_7',rb); Set_Global_Str('ISTR_7','/T=YES/F=NO'); Set_Global_Str('IPARM_7','/T=Right-hand border on full screen window./C=1/W=3/TP=5'); Set_Global_Str('ISTR_8',tstr); Set_Global_Str('IPARM_8','/T=Macro to run........../C=1/W=21/ML=80'); RM('UserIn^Data_In /H=INSC/S=1/A=2/#=8/T=LAYOUT ' + style + '/Y=' + str(y1 + 2) + '/X=' + str(xa + 1)); set_global_str('@SCREEN_SET' + style, '/F=' + str(global_int('IINT_5')) + '/M=' + str(global_int('IINT_3')) + '/S=' + str(global_int('IINT_2')) + '/MB=' + str( global_int('IINT_4')) + '/LB=' + str(global_int('IINT_6')) + '/RB=' + str(global_int('IINT_7')) + '/MACRO=' + global_str('ISTR_8') ); if global_int('IINT_1') then dss := j1; else dss := j1 - 1; if dss < 1 then dss := 2; end; end; Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); Goto Screen_Loop; end; Exit: Kill_Box; Set_Global_Int('DEF_SCRN_STYLE', DSS); return_int := 0; END_MACRO; $MACRO SETSAVE TRANS; {****************************************************************************** MULTI-EDIT MACRO NAME: SETSAVE DESCRIPTION: This macro creates and compiles INIT.SRC to save all setup parameters (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} { Global Variables used: Global_Int('Init_Window') The window where INIT.SRC is created. Plus a myriad of globals that get used to create INIT.SRC... much to numerous to be practical to mention here. } Def_Str( Whole_Line, F_Label[20], TStr, Temp_Stuff, Extension[80], Temp_Global, Program ); Def_Int(tid,Temp_Integer,Jx,Jy,T_Tab_Expand,T_Reg_Exp_Stat,Global_Count, P_Jx,P_Jy,T_Insert_Mode); Def_Int(Active_Window,Keymap_Window,Macro_Window,Error_Window, Cmd, bc); Def_Str(MStr[80],MName[30],KName[17],Mode_Str[10]); {Initialize variables and save some system variables into temporary variables} IF (Global_Str('@KEYMAP_NAME@') = '') THEN Set_Global_Str('@KEYMAP_NAME@','KN=MULTI-EDITFN=KEYMAP'); END; T_Reg_Exp_Stat := Reg_Exp_Stat; T_Insert_Mode := Insert_Mode; Return_Str := ''; Undo_Stat := False; T_Tab_Expand := Tab_Expand; Tab_Expand := False; Insert_Mode := True; Active_Window := Window_Id; Switch_Window(Window_Count); Create_Window; Macro_Window := Window_Id; Refresh := False; IF (Global_Int('SETUP_CHANGED') and $02) THEN Reg_Exp_Stat := False; RM('MEERROR^MessageBox /B=0/NW=1/T=SAVING CONFIGURATION/M=Building Keymap macro...'); { Make_Message('Building Keymap macro...'); } return_str := Parse_Str('FN=',Global_Str('@KEYMAP_NAME@')) + '.DB'; RM('MakeUserPath /DF=1'); IF (Switch_File(Return_Str) = 0) THEN Switch_Window(Window_Count); Create_Window; Load_File(Return_str); IF (Error_Level) THEN RM('MEERROR^MESSAGEBOX /B=2/T=ERROR ' + Str(Error_Level) + '/M=Can''t find ' + Return_Str + '. Install terminated.'); Error_Level := 0; Goto END_OF_MAC; END; ELSE Tof; IF (File_Changed) THEN Error_Level := 0; Save_File; IF (Error_Level) THEN RM('MEERROR^MESSAGEBOX /B=2/T=ERROR ' + Str(Error_Level) + '/M=Can''t save ' + Return_Str + '. Install terminated.'); Error_Level := 0; Goto END_OF_MAC; END; END; END; Keymap_Window := Window_Id; Switch_Win_Id(Macro_Window); Return_Str := User_Id + 'KEYMAP.SRC'; RM('MakeUserPath'); File_Name := Return_Str; PUT_LINE('$MACRO ' + USER_ID + 'KEYMAP DUMP;'); Insert_Mode := True; Down; Put_Line('{This macro was created by the Multi-Edit install macro version ' + Version + '}'); Down; Down; Put_Line('{Default key assignments}'); Down; IF (Switch_Win_Id(Keymap_Window)) THEN END; IF (Search_Fwd('****START****',0)) THEN Down; Goto_Col(1); END; WHILE (Not(At_Eof)) DO TStr := Get_Line; Down; MName := Parse_Str('MC=',TStr); IF (Mname <> '') THEN IF (Switch_Win_Id(Macro_Window)) THEN KName := Parse_Str('K1=',Tstr); IF (KName <> '') THEN Call Build_Key_Line; mstr := Parse_Str('MID=', tstr ); IF mstr <> '' THEN put_line('Set_Global_Str(''' + mstr + ''', ''' + kname + ''');'); DOWN; END; END; KName := Parse_Str('K2=',Tstr); IF (KName <> '') THEN Call Build_Key_Line; END; IF (Switch_Win_Id(Keymap_Window)) THEN END; END; END; END; IF (Switch_Win_Id(Macro_Window)) THEN END; Down; PUT_LINE('END_MACRO;'); Save_File; { Kill_Box; } Call COMPILE; IF (Return_Int) THEN Return_Str := 'COMP ERROR'; Goto END_OF_MAC; ELSE IF (Switch_Win_Id(Keymap_Window)) THEN Delete_Window; END; IF (Switch_Win_Id(Active_Window)) THEN END; END; END; {Create INIT.SRC} RM('MEERROR^MessageBox /B=0/NW=1/T=SAVING CONFIGURATION/M=Building "' + user_id + 'INIT.SRC"...'); Jx := Switch_Win_Id(Macro_Window); Erase_Window; Undo_Stat := false; Return_Str := User_Id + 'INIT.SRC'; RM('MakeUserPath'); File_Name := Return_Str; Set_Global_Int('Init_Window',Window_Id); {Create the start of a macro source code} PUT_LINE('$MACRO ' + USER_ID + 'INIT DUMP;'); Insert_Mode := True; Down; Put_Line('{This macro was created by the Multi-Edit install macro version ' + Version + '}'); Down; Down; Eol; Cr; Cr; Up; Up; {the Expanded memory settings need to come first} IF global_int('@EMS_AMOUNT@') <> 0 THEN Put_Line('Init_Ems_Support(' + Str(Global_Int('@EMS_AMOUNT@')) + ');'); Down; Put_Line('Set_Global_Int(''@EMS_AMOUNT@'',' + Str(Global_Int('@EMS_AMOUNT@')) + ');'); Down; END; Put_Line('EMS_Stat := ' + Str(Global_Int('EMS_DEFAULT')) + ';'); Down; Put_Line('Set_Global_Int(''EMS_DEFAULT'',' + Str(Global_Int('EMS_DEFAULT')) + ');'); Down; Put_Line('Swap_Mode := ' + Str( swap_mode ) + ';'); Down; Put_Line('Max_Swap_EMS := ' + Str( Max_Swap_Ems ) + ';'); Down; Put_Line('Swap_Mem := ' + Str( Swap_Mem ) + ';'); Down; {Make_Message('Building "' + user_id + 'INIT.SRC"...');} Working; {Create all the other settings, most are self explanitory} Down; Down; Put_Line('ERROR_LEVEL := 0;'); Down; Put_Line('Set_Global_Str(''@KEYMAP_NAME@'',''' + Global_Str('@KEYMAP_NAME@') + ''');'); Down; Put_Line('RM(''' + User_Id + 'KEYMAP'');'); Down; Put_Line('IF ERROR_LEVEL <> 0 THEN'); Down; Put_Line(' RM(''KEYMAP'');'); Down; Put_Line('END;'); down; Down; Put_Line('{Default settings}'); Down; Put_Line('Set_Global_Int(''Default_Insert_Mode'',' + Str(Global_Int('Default_Insert_Mode')) + ');'); Down; Put_Line('Set_Global_Str(''SWITCHES'',''' + Global_Str('DEF_SWITCHES') + ''');'); Down; Put_Line('Set_Global_Str(''DEF_SWITCHES'',''' + Global_Str('DEF_SWITCHES') + ''');'); Down; Put_Line('Set_Global_Str(''REPL_SWITCHES'',''' + Global_Str('DEF_REPL_SWITCHES') + ''');'); Down; Put_Line('Set_Global_Str(''DEF_REPL_SWITCHES'',''' + Global_Str('DEF_REPL_SWITCHES') + ''');'); Down; Put_Line('Set_Global_Str(''FSWITCHES'',''' + Global_Str('DEF_FS_SWITCHES') + ''');'); Down; Put_Line('Set_Global_Str(''DEF_FS_SWITCHES'',''' + Global_Str('DEF_FS_SWITCHES') + ''');'); Down; Put_Line('Set_Global_Str(''FSEARCH_PATH'',''' + Global_Str('DEF_FS_PATH') + ''');'); Down; Put_Line('Set_Global_Str(''DEF_FS_PATH'',''' + Global_Str('DEF_FS_PATH') + ''');'); Down; Put_Line('Insert_Mode := Global_Int(''Default_Insert_Mode'');'); Down; Put_Line('Explosions := ' + Str(Explosions) + ';'); Down; Put_Line('Backups := ' + Str(Backups) + ';'); Down; Put_Line('Backup_Path := ''' + Backup_Path + ''';'); Down; Put_Line('Temp_Path := ''' + Temp_Path + ''';'); Down; {see the macro STRSRC in this same macro file for an explanation} RM('USERIN^STRSRC ' + Page_Str ); Put_Line('Page_Str := ''' + Return_Str + ''';'); Down; Put_Line('Truncate_Spaces := ' + Str(Truncate_Spaces) + ';'); Down; Put_Line('Set_Global_Str(''@AUTOSAVEPARMS'',''' + Global_Str('@AUTOSAVEPARMS') + ''');'); Down; {Put_Line('AutoSave := ' + Str(AutoSave) + ';'); Down;} Put_Line('Ctrl_Help := ' + Str(Ctrl_Help) + ';'); Down; Put_Line('Ctrl_Z := ' + Str(Ctrl_Z) + ';'); Down; Put_Line('Eof_Cr := ' + Str(Eof_Cr) + ';'); Down; Put_Line('File_Locking := ' + Str(File_Locking) + ';'); Down; Put_Line('Display_Tabs := ' + Str(Display_Tabs) + ';'); Down; Put_Line('Tab_Expand := ' + Str(T_Tab_Expand) + ';'); Down; Put_Line('Mouse_H_Sense := ' + Str(Mouse_H_Sense) + ';'); Down; Put_Line('Mouse_V_Sense := ' + Str(Mouse_V_Sense) + ';'); Down; Put_Line('Mouse := ' + Str(Mouse) + ';'); Down; Put_Line('Mou_Disappear := ' + Str(Mou_Disappear) + ';'); Down; Put_Line('Set_Global_Str(''@MOUSEPARMS'',''' + global_str('@MOUSEPARMS') + ''');'); down; RM('USERIN^STRSRC ' + Word_Delimits ); Put_Line('Word_Delimits := ''' + Return_Str + ''';'); Down; Put_Line('Ins_Cursor := ' + Str(Ins_Cursor) + ';'); Down; Put_Line('Ovr_Cursor := ' + Str(Ovr_Cursor) + ';'); Down; Put_Line('Max_Undo := ' + Str(Max_Undo) + ';'); Down; Put_Line('Column_Move_Style := ' + Str(Column_Move_Style) + ';'); Down; Put_Line('Set_Global_Str(''FORMAT_CODE_DELIMIT'',''' + Global_Str('FORMAT_CODE_DELIMIT') + ''');'); Down; Put_Line('Set_Global_Str(''PRINTER_DEVICE'',''' + Global_Str('PRINTER_DEVICE') + ''');'); Down; {This is a temporary work-around until the macro compiler can handle lines longer than 255} Put_Line('Set_Global_Str(''PRINTER_TYPE'','); Down; Jx := (Length(Global_Str('PRINTER_TYPE')) / 200) + ((Length(Global_Str('PRINTER_TYPE')) MOD 200) > 0) - 1; Jy := 0; WHILE (Jx) DO RM('USERIN^STRSRC ' + Copy(Global_Str('PRINTER_TYPE'),Jy + 1,200)); Put_Line('''' + Return_Str + ''' +' ); Down; Jy := Jy + 200; --Jx END; RM('USERIN^STRSRC ' + Copy(Global_Str('PRINTER_TYPE'),Jy + 1,200)); Put_Line('''' + Return_Str + ''');'); Down; { Put_Line('Set_Global_Str(''PRINTER_TYPE'', ''' + Global_Str('PRINTER_TYPE') + ''');'); Down; } Put_Line('Set_Global_Int(''RESTORE'',' + Str(Global_Int('RESTORE')) + ');'); Down; {The following 16 lines are for the screen configuration for status lines function key lines, file name lines, etc.} Put_Line('Set_Global_Str(''@SCREEN_SETA'',''' + Global_STR('@SCREEN_SETA') + ''');'); Down; Put_Line('Set_Global_Str(''@SCREEN_SETB'',''' + Global_STR('@SCREEN_SETB') + ''');'); Down; Put_Line('Set_Global_Int(''DEF_SCRN_STYLE'',' + Str(Global_Int('DEF_SCRN_STYLE')) + ');'); Down; Put_Line('Set_Global_Int(''CUR_SCRN'',' + Str(Global_Int('DEF_SCRN_STYLE')) + ');'); Down; Put_Line('Init_Video_Mode := ' + Str(Video_Mode) + ';'); Down; Put_Line('Error_Color := ' + Str(Error_Color) + ';'); Down; Put_Line('Shadow_Color := ' + Str(Shadow_Color) + ';'); Down; Put_Line('Shadow_Char := ''||' + str(ascii(Shadow_Char)) + ''';'); Down; Put_Line('W_T_Color := ' + Str(w_t_color) + ';'); Down; Put_Line('W_H_Color := ' + Str(w_h_color) + ';'); Down; Put_Line('W_B_Color := ' + Str(w_b_color) + ';'); Down; Put_Line('W_C_Color := ' + Str(w_c_color) + ';'); Down; Put_Line('W_EOF_Color := ' + Str(w_EOF_color) + ';'); Down; Put_Line('W_S_Color := ' + Str(w_s_color) + ';'); Down; Put_Line('M_T_Color := ' + Str(m_t_color) + ';'); Down; Put_Line('M_S_Color := ' + Str(m_s_color) + ';'); Down; Put_Line('M_B_Color := ' + Str(m_b_color) + ';'); Down; Put_Line('M_H_Color := ' + Str(m_h_color) + ';'); Down; Put_Line('D_T_Color := ' + Str(d_t_color) + ';'); Down; Put_Line('D_S_Color := ' + Str(d_s_color) + ';'); Down; Put_Line('D_B_Color := ' + Str(d_b_color) + ';'); Down; Put_Line('D_H_Color := ' + Str(d_h_color) + ';'); Down; Put_Line('H_T_Color := ' + Str(h_t_color) + ';'); Down; Put_Line('H_T1_Color := ' + Str(h_t1_color) + ';'); Down; Put_Line('H_T2_Color := ' + Str(h_t2_color) + ';'); Down; Put_Line('H_T3_Color := ' + Str(h_t3_color) + ';'); Down; Put_Line('H_S_Color := ' + Str(h_s_color) + ';'); Down; Put_Line('H_B_Color := ' + Str(h_b_color) + ';'); Down; Put_Line('H_H_Color := ' + Str(h_h_color) + ';'); Down; Put_Line('H_R_Color := ' + Str(h_r_color) + ';'); Down; Put_Line('H_F_Color := ' + Str(h_f_color) + ';'); Down; Put_Line('FKey_Color := ' + Str(fkey_color) + ';'); Down; Put_Line('FNum_Color := ' + Str(fnum_color) + ';'); Down; Put_Line('Stat1_Color := ' + Str(stat1_color) + ';'); Down; Put_Line('Stat2_Color := ' + Str(stat2_color) + ';'); Down; Put_Line('Message_Color := ' + Str(message_color) + ';'); Down; Put_Line('Working_Color := ' + Str(working_color) + ';'); Down; Put_Line('Background_Color := ' + Str(background_color) + ';'); Down; Put_Line('Logo_Screen := ' + Str(Logo_Screen)+ ';'); Down; {Dos shell stuff} Put_Line('Set_Global_Str(''DIR_SORT_STR'',''' + Global_Str('DIR_SORT_STR') + ''');'); Down; Put_Line('Set_Global_Int(''@DIR_MODE@'',' + Str(Global_Int('@DIR_MODE@')) + ');'); Down; {Condensed mode globals} { Put_Line('Set_Global_Int(''CONDENSE_MODE'',' + Str(Global_Int('CONDENSE_MODE')) + ');'); Down; Put_Line('Set_Global_Int(''CUTOFF_COL'',' + Str(Global_Int('CUTOFF_COL')) + ');'); Down; RM('USERIN^STRSRC ' + Global_Str('CONDENSE_SEARCH')); Put_Line('Set_Global_Str(''CONDENSE_SEARCH'',''' + Return_Str + ''');'); Down; Put_Line('Set_Global_Str(''CONDENSE_SWITCHES'',''' + Global_Str('CONDENSE_SWITCHES') + ''');'); Down; } {Calculator Parameters} Temp_Stuff := '/X=' + Parse_Str('/X=',Global_Str('Calc_Params')) + '/Y=' + Parse_Str('/Y=',Global_Str('Calc_Params')) + '/BASE=' + Parse_Str('/BASE=',Global_Str('Calc_Params')); Put_Line('Set_Global_Str(''CALC_PARAMS'',''' + Temp_Stuff + ''');'); Down; {The following are in conjuction with the keyboard key repeat(typematic) speed setup macro which uses the new interrupt procedure} Put_Line('Set_Global_Int(''KEYSPEED'',' + Str(Global_Int('KEYSPEED')) + ');'); Down; Put_Line('Set_Global_Int(''KEYDELAY'',' + Str(Global_Int('KEYDELAY')) + ');'); Down; Put_Line('Set_Global_Int(''NO_KEYSPEED'',' + str( global_int('NO_KEYSPEED') ) + ');'); {Put ending line} Down; PUT_LINE('END_MACRO;'); Tab_Expand := True; Save_File; Call COMPILE; IF (Return_Int = 0) THEN copy_file( me_path + user_id + 'KEYMAP.MAC', me_path + user_id + 'INIT.MAC', TRUE ); {Make_Message( 'Multi-Edit configuration saved.');} Set_Global_Int('SETUP_CHANGED',0); {This is to clear out all existing function key labels in edit mode.} Jx := 4; WHILE (Jx) DO --Jx; Jy := 10; WHILE (Jy) DO Flabel('',(Jx * 10) + Jy,0); --Jy; END; END; RM( user_id + 'INIT' ); Del_File(me_path + user_id + 'SETER.TMP'); Error_Level := 0; ELSE {Make_Message( 'Error occurred!! Configuration NOT saved.'); } Return_Str := 'COMP ERROR'; END; Goto END_OF_MAC; {********************************** SUBROUTINES ******************************} BUILD_KEY_LINE: Jx := Parse_Int('MODE=',Tstr); IF ((Jx < 1) or (Jx > 4)) THEN Jx := 1; END; Mode_Str := Remove_Space(Copy('EDIT DOS_SHELLTERM ALL', ((Jx - 1) * 9) + 1, 9)); Cmd := (Parse_Str('MF=',TStr) = 'NOT APPLICABLE'); IF (Cmd) THEN MStr := 'CMD_TO_KEY('; ELSE MStr := 'MACRO_TO_KEY('; END; MStr := MStr + KName + ','; IF (Cmd = False) THEN MStr := MStr + '''' + Parse_Str('MF=',Tstr) + '^'; END; MStr := MStr + MName; IF (Cmd = False) THEN MStr := MStr + ' ' + Parse_Str('PARAM=',TSTr) + ''''; END; Jx := Parse_Int('',Tstr); IF ((Jx < 1) or (Jx > 4)) THEN Jx := 1; END; MStr := MStr + ',' + Mode_Str + ');'; Put_Line(MStr); Down; IF (Parse_Str('FKL=',TStr) <> '') THEN {See if this key is a function key} MStr := Parse_Str('F',KName);; IF (MStr <> '') THEN WHILE (XPos(Copy(Mstr,Svl(MStr),1),'0123456789',1) = 0) DO MStr := Copy(MStr,1,Svl(MStr) - 1); IF (Mstr = '') THEN Goto NO_LABEL; END; END; IF (MStr <> '') THEN IF (Val(jx,Mstr) = 0) THEN IF (Jx < 11) THEN IF (XPos('SHFT',Caps(KName),1)) THEN Jx := Jx + 10; END; IF (XPos('CTRL',Caps(KName),1)) THEN Jx := Jx + 20; END; IF (XPos('ALT',Caps(KName),1)) THEN Jx := Jx + 30; END; Put_Line('FLABEL(''' + Parse_Str('FKL=',TStr) + ''',' + Str(Jx) + ',' + Mode_Str + ');'); Down; END; END; END; END; END; NO_LABEL: RET; COMPILE: Reg_Exp_Stat := True; Return_Int := 0; TStr := Truncate_Path(File_Name); Kill_Box; RM('MEERROR^MessageBox /B=0/NW=1/T=SAVING CONFIGURATION/M=Compiling "'+ TStr +'"...'); {Make_Message('Compiling "'+ TStr +'"...');} {build a command line to compile the macro} Whole_Line := 'MEMAC.EXE -P' + Me_Path + ' ' + File_Name + '>' + me_path + user_id + 'SETER.TMP'; {If the Dos version is 3.0 or above, then add the ME_Path to the compiler command line to insure the correct version of the macro compiler gets run.} IF ((Dos_Version and $00FF) > 2) THEN Whole_Line := ME_PATH + Whole_Line; END; Del_File(me_path + user_id + 'SETER.TMP'); Error_Level := 0; Return_str := whole_line; RM('MEUTIL1^EXEC /SWAP=0/MEM=9600/CMD=1'); kill_box; IF (Error_Level <> 0) THEN RM('MEERROR^Beeps /C=1'); {Error messages for unsuccessful compile} IF (Error_Level = 3008) THEN NO_MEMORY_ERROR: rm('MEERROR^MessageBox /T=INSUFFICIENT MEMORY TO COMPILE ' + TStr + '!/B=2/M=Please exit editor and compile ' + TStr + ' in the Multi-Edit directory.'); Error_Level := 0; Return_Int := 1; RET; END; RM( 'MEERROR' ); Return_Int := 1; RET; END; Switch_Window(Window_Count); Create_Window; Error_Window := Window_Id; Load_File(me_path + user_id + 'SETER.TMP'); IF (Error_Level = 3002) THEN RM('MEERROR^Beeps /C=1'); PATH_ERROR: RM('MEERROR^MessageBox /T=ERROR IN COMPILING ' + TStr + '!/B=2/M=Check for proper path to macro compiler.'); Error_Level := 0; Return_Int := 1; RET; END; Ignore_case := True; If (Search_Fwd('{MEMORY}||{RUNTIME}||{RAGTIME}',0)) THEN Goto No_Memory_Error; END; Tof; If (Search_Fwd('{Error}||{Aborted}',0)) Then RM('MEERROR^Beeps /C=1'); RM('MEERROR^MessageBox /T=ERROR IN COMPILING ' + TStr + '!/B=2/M=' + Copy(Get_Line,1,76)); Write('Press any key...',34,13,0,Error_Color); Refresh := True; {Make_Message('');} Kill_Box; Kill_box; New_Screen; Messages := True; Undo_Stat := True; Return_Int := 1; RET; End; TOF; If (Search_Fwd(shorten_str(Version),1) = 0) Then {we should only get here if somehow a different version of the macro compiler was run than the version of ME. A distinct possiblilty if multiple versions of ME are on the system.} RM('MEERROR^MESSAGEBOX /B=2/T=WARNING: MACRO COMPILER REPORTS WRONG VERSION' + '/M=Unpredictable results could occur. Check DOS environment for possible incorrect search path.'); {Make_Message('');} Kill_Box; Kill_box; New_Screen; Messages := True; Undo_Stat := True; Return_Str := 'COMP WARNING'; End; IF (Switch_Win_Id(Error_Window)) THEN Delete_Window; END; IF return_str <> 'COMP WARNING' THEN Del_File(me_path + user_id + 'SETER.TMP'); END; Jx := Switch_Win_Id(Macro_Window); RET; {*****************************************************************************} END_OF_MAC: while box_count > bc do kill_box; END; IF (Switch_Win_Id(Macro_Window)) THEN Delete_Window; END; {clean up altered system variables} Reg_Exp_Stat := T_Reg_Exp_Stat; Undo_Stat := True; Tab_Expand := T_Tab_Expand; Insert_Mode := T_Insert_Mode; END_MACRO; $MACRO SETKEYS TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETKEYS Description: This is the key remapping menu. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} IF (Global_Str('@KEYMAP_NAME@') = '') THEN Set_Global_Str('@KEYMAP_NAME@','KN=MULTI-EDITFN=KEYMAP'); END; RM('USERIN^XMENU /T=1/L=CURRENT MAP IS "' + parse_str('KN=', Global_Str('@KEYMAP_NAME@')) + '"/X=' + Str(Parse_Int('/X=',MParm_Str)) + '/Y=' + Str(Parse_Int('/Y=',MParm_Str) - 10) + '/B=1/S=1/M=Edit current keymap(INKE)Select new keymap()'); IF (Return_Int = 2) THEN Def_Str(T_KEY[36]); T_Key := Global_Str('@KEYMAP_NAME@'); RM('USERIN^DB /F=MECONFIG.DB/DPT=KMAPLST.DB/NC=1/NOALPHA=1/LO=1/PRE=KLIST/DT=─/LT=SELECT A KEYMAP/GLO=@KEYMAP_NAME@/H=INKE/MACRO=KEYLIST_CHECK'); IF ((Return_Int = 1) and (T_Key <> Global_Str('@KEYMAP_NAME@'))) THEN Return_Str := Parse_Str('FN=',Global_str('@KEYMAP_NAME@')) + '.DB'; RM('MakeUserPath'); IF ((File_Exists(Return_Str) = False) and (File_Exists(Me_Path + Parse_Str('FN=',Global_str('@KEYMAP_NAME@')) + '.DB') = False)) THEN RM('MEERROR^MessageBox /T=WARNING/B=2/M=The keymap data file: ' + Return_Str + ' does not exist. If you save the settings, all key assignments will be disabled.'); END; Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $02); ELSE Set_Global_Str('@KEYMAP_NAME@',T_Key); END; IF (Global_Str('@KEYMAP_NAME@') = '') THEN Set_Global_Str('@KEYMAP_NAME@','KN=MULTI-EDITFN=KEYMAP'); END; ELSIF (Return_Int = 1) THEN Set_Global_Str('KEYDS','MC=17DESCR=26K1=16K2=16'); RM('USERIN^DB /NDF=1/NSF=1/F=' + Parse_Str('FN=',Global_Str('@KEYMAP_NAME@')) + '.DB/NOALPHA=1/PRE=KEY/GLO=@KEYREC#/LT=EDITING THE ' + Parse_Str('KN=',Global_Str('@KEYMAP_NAME@')) + ' KEYMAP. SELECT A MACRO////COMMAND/DT=KEYSTROKE ASSIGNMENT/H=INKE/DS=KEYDS/MACRO=KEY_CHECK'); IF Global_Int('@DB_FILE_CHANGED') THEN Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $02); END; END; EXIT: return_int := 0; END_MACRO; $MACRO KEYLIST_CHECK TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: KEYLIST_CHECK Description: (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(Choice); Def_str(t_str[80]); Set_Global_str('@KEYMAP_NAME@',Caps(Global_str('@KEYMAP_NAME@'))); IF (Parse_Int('/P=',MParm_Str)) THEN CHECK_AGAIN: Return_Str := Parse_Str('FN=',Global_str('@KEYMAP_NAME@')) + '.DB'; RM('MakeUserPath'); t_str := Return_str; IF (File_Exists(return_str) = 0) THEN RM('USERIN^XMENU /B=1/X=10/Y=10/L=' + Return_Str + ' DOESN''T EXIST/M=Ignore(INKEY)Copy-another-keymap-file()change-File-name()'); Choice := Return_Int; IF (Choice = 2) THEN Mark_Pos; Del_Line; RM('USERIN^DB /F=MECONFIG.DB/X=5/Y=3/DPT=KMAPLST.DB/NC=1/NE=1/ND=1/NI=1/NOALPHA=1/LO=1/PRE=KLIST2/DT=─/LT=SELECT KEYMAP TO COPY/GLO=@KEYMAP_CHECK@/H=INKE'); IF (Return_Int = 1) THEN Copy_File(Get_Path(t_Str) + Parse_Str('FN=',Global_str('@KEYMAP_CHECK@')) + '.DB ',T_Str, false); END; Goto_Mark; Up; Eol; Insert_Mode := True; Cr; Goto CHECK_AGAIN; ELSIF (Choice = 3) THEN Return_Str := ''; RM( 'USERIN^QUERYBOX /T=/P=Enter new filename(no extension)/W=8/L=10/C=10'); Set_Global_str('@KEYMAP_NAME@', 'KN=' + Parse_Str('KN=',Global_str('@KEYMAP_NAME@')) + 'FN=' + Return_Str); Goto CHECK_AGAIN; END; END; END; END_MACRO; $MACRO KEY_CHECK TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: KEY_CHECK Description: Checks for key assigment conflicts with currently edited key record and alerts user. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Str(S_Str,G_Str); Def_Int(T_Ignore_Case,T_Reg_Exp_Stat,K_Line,Check_Mode,T_Mode,Conflict); G_Str := Global_Str(Parse_Str('/GLO=',MParm_Str)); Check_Mode := Parse_Int('MODE=',G_Str); IF (Check_Mode < 1) THEN Check_Mode := 1; END; IF (Parse_Int('/P=',MParm_Str)) THEN T_Reg_Exp_Stat := Reg_Exp_Stat; T_Ignore_Case := Ignore_Case; Reg_Exp_Stat := True; Ignore_Case := True; Mark_Pos; K_Line := C_Line; S_Str := Parse_Str('K1=',G_Str); IF (S_Str <> '') THEN Call CHECK_FOR_CONFLICT; IF (Conflict) THEN Goto DONE_CHECKING; END; END; S_Str := Parse_Str('K2=',G_Str); IF (S_Str <> '') THEN Call CHECK_FOR_CONFLICT; END; { MC=MAINHELPDESCR=Main help screenK1=<F1>K2=<AltH>FKL=HelpMODE=1MF=USERIN } DONE_CHECKING: Goto_Mark; Reg_Exp_Stat := T_Reg_Exp_Stat; Ignore_Case := T_Ignore_Case; {Begin "on the fly" key changes support} {Assign the current keys in this record} --Check_Mode; {Assign primary key if present} Return_Str := Parse_Str('K1=',G_Str); IF (Return_Str <> '') THEN RM('MAKE_SCAN_CODES'); IF (Return_Int > 0) THEN S_Str := Parse_Str('MF=',G_Str); IF (S_Str = 'NOT APPLICABLE') THEN RM('ASSIGN_CMD /C=' + Parse_Str('MC=',G_Str) + '/K=' + Str(Return_Int) + '/M=' + Str(Check_Mode)); ELSE Macro_To_Key(Return_Int,S_Str + '^' + Parse_Str('MC=',G_Str) + ' ' + Parse_Str('PARAM=',G_Str),Check_Mode); END; {If this one is a function key, assign the label also} IF (Global_Int('!FKEY@')) THEN FLabel(Parse_Str('FKL=',G_Str),Global_Int('!FKEY@'),Check_Mode); END; END; END; {Assign secondary key if present} Return_Str := Parse_Str('K2=',G_Str); IF (Return_Str <> '') THEN RM('MAKE_SCAN_CODES'); IF (Return_Int > 0) THEN S_Str := Parse_Str('MF=',G_Str); IF (S_Str = 'NOT APPLICABLE') THEN RM('ASSIGN_CMD /C=' + Parse_Str('MC=',G_Str) + '/K=' + Str(Return_Int) + '/M=' + Str(Check_Mode)); ELSE Macro_To_Key(Return_Int,S_Str + '^' + Parse_Str('MC=',G_Str) + ' ' + Parse_Str('PARAM=',G_Str),Check_Mode); END; {If this one is a function key, assign the label also} IF (Global_Int('!FKEY@')) THEN FLabel(Parse_Str('FKL=',G_Str),Global_Int('!FKEY@'),Check_Mode); END; END; END; {Assign menu global if present} S_Str := Parse_Str('MID=',G_Str); IF (S_Str <> '') THEN Set_Global_Str(S_Str,Parse_Str('K1=',G_Str)); END; ELSE {Unnassign the current keys in this record} --Check_Mode; {Unnasign primary key if present} Return_Str := Parse_Str('K1=',G_Str); IF (Return_Str <> '') THEN RM('MAKE_SCAN_CODES'); IF (Return_Int > 0) THEN Unassign_Key(Return_Int,Check_Mode); {If this one is a function key, kill the label also} IF (Global_Int('!FKEY@')) THEN FLabel('',Global_Int('!FKEY@'),Check_Mode); END; END; END; {Unnasign secondary key if present} Return_Str := Parse_Str('K2=',G_Str); IF (Return_Str <> '') THEN RM('MAKE_SCAN_CODES'); IF (Return_Int > 0) THEN Unassign_Key(Return_Int,Check_Mode); {If this one is a function key, kill the label also} IF (Global_Int('!FKEY@')) THEN FLabel('',Global_Int('!FKEY@'),Check_Mode); END; END; END; {Unnasign menu global if present} S_Str := Parse_Str('MID=',G_Str); IF (S_Str <> '') THEN Set_Global_Str(S_Str,''); END; {End "on the fly" key changes support} END; Goto EXIT; CHECK_FOR_CONFLICT: Conflict := False; S_Str := 'K?=' + S_Str; Tof; KEEP_LOOKING: IF (Search_Fwd(S_Str,0)) THEN T_Mode := Parse_Int('MODE=',Get_Line); IF (T_Mode < 1) THEN T_Mode := 1; END; IF ((C_Line = K_Line) or (T_Mode <> Check_Mode)) THEN Eol; Goto KEEP_LOOKING; END; Conflict := True; RM('MEERROR^MessageBox /T=WARNING/B=1/M=The key:' + Copy(S_Str,5,20) + ' is already assigned to:' + Parse_Str('MC=',Get_Line)); END; RET; EXIT: END_MACRO; $MACRO DEFINE_KEY TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: DEFINE_KEY Description: This macro is used by SETKEYS as a prompt for a keystroke to define a key code Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box /STR= Supplied by DATA_IN as the default choice (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(X1,Y1); X1 := Parse_Int('/X=',MParm_Str) + 18; Y1 := Parse_Int('/Y=',MParm_Str) + 6; RM('USERIN^XMENU /X=' + Str(X1) + '/Y=' + Str(Y1) + '/B=1/S=1/L=QUICKSTROKE/M=Define QuickStroke(INKE)Erase QuickStroke()'); IF (Return_Int = 0) THEN Return_Str := Parse_Str('/STR=',MParm_Str); Goto EXIT; END; IF (Return_Int = 1) THEN Put_Box(X1,Y1,X1 + 25,Y1 + 3,0,M_B_Color,'DEFINING A QUICKSTROKE',true); Write('Press the desired key.',X1 + 1,Y1 + 1,0,M_B_Color); Read_Key; RM('MAKEKEY /K1=' + Str(Key1) + '/K2=' + Str(key2)); IF (Length(Return_Str) = 1) THEN {If the keycode is alphanumeric, need to add the <>} Return_Str := '<' + Return_Str + '>'; END; Kill_Box; ELSE Return_Str := ''; END; EXIT: END_MACRO; $MACRO SETCOLOR TRANS; {****************************************************************************** MULTI-EDIT MACRO NAME: SETCOLOR DESCRIPTION: This is the Color installation menu. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} {Global variables used: Global_Int('SETUP_X1') The X and Y coordinates of the upper left hand corner Global_Int('SETUP_Y1') of the main installation and setup menu box } Def_Int(X1,Y1,y2,J1,jb,jx,J2,J3,Temp_Ex,old_color, j_color); def_int( var_ofs, var_seg, t_w_t_color, t_w_h_color, t_w_c_color, t_w_eof_color, t_w_s_color, t_w_b_color, t_m_h_color, t_m_t_color, t_m_s_color, t_m_b_color, t_fkey_color, t_fnum_color, t_stat1_color, t_stat2_color, t_error_color, t_message_color, t_working_color, t_shadow_color, t_h_t_color, t_h_h_color, t_h_b_color, t_h_s_color, t_h_f_color, t_h_r_color, t_h_t1_color, t_h_t2_color, t_h_t3_color, t_background_color ); Def_Str(tstr[80], gstr[4]); Def_Char(Shadow_Char1); refresh := false; X1 := Global_Int('SETUP_X1') - 3; Y1 := Global_Int('SETUP_Y1'); {Begin building the menu} y2 := y1 + 21; Put_Box(X1+10,Y1,X1+74,Y2,0,m_b_color,'SETUP COLORS',true); temp_ex := explosions; explosions := false; Put_Box(X1+11,Y1+1,X1+48,Y1+15,0,m_t_color,'SAMPLE',false); explosions := temp_ex; {Store all current colors into variables} t_h_t_color := h_t_color; t_h_t1_color := h_t1_color; t_h_t2_color := h_t2_color; t_h_t3_color := h_t3_color; t_h_h_color := h_h_color; t_h_b_color := h_b_color; t_h_s_color := h_s_color; t_h_r_color := h_r_color; t_h_f_color := h_f_color; t_m_t_color := m_t_color; t_m_h_color := m_h_color; t_m_s_color := m_s_color; t_m_b_color := m_b_color; t_error_color := error_color; t_message_color := message_color; t_working_color := working_color; t_shadow_color := shadow_color; t_w_t_color := w_t_color; t_w_h_color := w_h_color; t_w_c_color := w_c_color; t_w_eof_color := w_eof_color; t_w_s_color := w_s_color; t_w_b_color := w_b_color; t_fkey_color := fkey_color; t_fnum_color := fnum_color; t_stat1_color := stat1_color; t_stat2_color := stat2_color; t_background_color := background_color; J1 := 1; Shadow_Char1 := Shadow_Char; COLORS_LOOP: call clear_menu; call no_message; write('Press to exit color installation',x1+11,y1+19,0,m_t_color); call put_sample; {Heres the actual color menu} gstr := Str(global_int('MENU_LEVEL')) + 'MSTR_'; draw_outline( x1 + 51, y2 - 2 - 5, x1 + 70, y2 - 1, m_b_color ); create_global_str(gstr + '1' , '/N=Window colors/H=INCO'); create_global_str(gstr + '2' , '/N=Menu colors'); create_global_str(gstr + '3' , '/N=Help colors'); create_global_str(gstr + '4' , '/N=Other colors'); create_global_str(gstr + '5' , '/N=Background color'); Set_Global_Str('@INCOEV#1','/T=Exit/KC=<ESC>/K1=27/K2=1/R=1/W=9/X=' + Str(x1 + 57) + '/Y=' + Str(y1+20)); Set_Global_Str('@INCOEV#2','/T=/KC=<ESC>/K1=27/K2=1/R=1/W=5/X=' + Str(x1 + 17) + '/Y=' + Str(y1+19)); RM('USERIN^CheckEvents /M=2/G=@INCOEV#/#=2'); RM('USERIN^SUBMENU /#=5/B=1/A=1/GCLR=1/BC=' + str(box_count) + '/S=' + str(j1) + '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 5) + '/G=' + gstr); if return_int < 1 then IF ((Key1 = 0) and (Key2 = 250)) THEN RM('USERIN^CheckEvents /M=1/G=@INCOEV#/#=2'); WHILE (Check_Key) DO END; Key1 := 0; Key2 := 0; IF (Return_Int = 0) THEN goto colors_loop; END; END; goto exit; end; call clear_menu; call no_message; j1 := return_int; if j1 = 1 then menu1: draw_outline( x1 + 51, y2 - 2 - 6, x1 + 70, y2 - 1,m_b_color ); create_global_str(gstr + '1' , '/N=Text/H=INCO'); create_global_str(gstr + '2' , '/N=Changed-Text'); create_global_str(gstr + '3' , '/N=Highlighted-Text'); create_global_str(gstr + '4' , '/N=End-Of-File'); create_global_str(gstr + '5' , '/N=Window-border'); create_global_str(gstr + '6' , '/N=window-Bold'); call PUT_PREVIOUS; RM('USERIN^SUBMENU /#=6/B=1/A=1/GCLR=1/S=' + str(jb) + '/BC=' + str(box_count) + '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 6) + '/G=' + gstr); jb := return_int; if jb < 1 then call CHECK_MOUSE; goto colors_loop; end; if jb = 1 then var_ofs := ofs(t_w_t_color); var_seg := seg(t_w_t_color); end; if jb = 2 then var_ofs := ofs(t_w_c_color); var_seg := seg(t_w_c_color); end; if jb = 3 then var_ofs := ofs(t_w_h_color); var_seg := seg(t_w_h_color); end; if jb = 4 then var_ofs := ofs(t_w_eof_color); var_seg := seg(t_w_eof_color); end; if jb = 5 then var_ofs := ofs(t_w_b_color); var_seg := seg(t_w_b_color); end; if jb = 6 then var_ofs := ofs(t_w_s_color); var_seg := seg(t_w_s_color); end; call change_colors; call no_message; call put_sample; goto menu1; end; if j1 = 2 then menu2: draw_outline( x1 + 51, y2 - 2 - 4, x1 + 70, y2 - 1,m_b_color ); create_global_str(gstr + '1' , '/N=menu-Text/H=INCO'); create_global_str(gstr + '2' , '/N=menu-Highlight'); create_global_str(gstr + '3' , '/N=menu-Bold'); create_global_str(gstr + '4' , '/N=Menu-border'); call PUT_PREVIOUS; RM('USERIN^SUBMENU /#=4/B=1/A=1/GCLR=1/S=' + str(jb) + '/BC=' + str(box_count) + '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 4) + '/G=' + gstr); jb := return_int; if jb < 1 then call CHECK_MOUSE; goto colors_loop; end; if jb = 1 then var_ofs := ofs(t_m_t_color); var_seg := seg(t_m_t_color); end; if jb = 2 then var_ofs := ofs(t_m_h_color); var_seg := seg(t_m_h_color); end; if jb = 3 then var_ofs := ofs(t_m_s_color); var_seg := seg(t_m_s_color); end; if jb = 4 then var_ofs := ofs(t_m_b_color); var_seg := seg(t_m_b_color); end; call change_colors; call no_message; call put_sample; goto menu2; end; if j1 = 3 then menu3: draw_outline( x1 + 51, y2 - 2 - 9, x1 + 70, y2 - 1,m_b_color ); create_global_str(gstr + '1' , '/N=help-Text/H=INCO'); create_global_str(gstr + '2' , '/N=help-Highlight'); create_global_str(gstr + '3' , '/N=help-Chapter'); create_global_str(gstr + '4' , '/N=help-bOrder'); create_global_str(gstr + '5' , '/N=help-Link'); create_global_str(gstr + '6' , '/N=help-F-keys'); create_global_str(gstr + '7' , '/N=help-attr-1'); create_global_str(gstr + '8' , '/N=help-attr-2'); create_global_str(gstr + '9' , '/N=help-attr-3'); call PUT_PREVIOUS; RM('USERIN^SUBMENU /#=9/B=1/A=1/GCLR=1/S=' + str(jb) + '/BC=' + str(box_count) + '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 9) + '/G=' + gstr); jb := return_int; if jb < 1 then call CHECK_MOUSE; goto colors_loop; end; if jb = 1 then var_ofs := ofs(t_h_t_color); var_seg := seg(t_h_t_color); end; if jb = 2 then var_ofs := ofs(t_h_h_color); var_seg := seg(t_h_h_color); end; if jb = 3 then var_ofs := ofs(t_h_s_color); var_seg := seg(t_h_s_color); end; if jb = 4 then var_ofs := ofs(t_h_b_color); var_seg := seg(t_h_b_color); end; if jb = 5 then var_ofs := ofs(t_h_r_color); var_seg := seg(t_h_r_color); end; if jb = 6 then var_ofs := ofs(t_h_f_color); var_seg := seg(t_h_f_color); end; if jb = 7 then var_ofs := ofs(t_h_t1_color); var_seg := seg(t_h_t1_color); end; if jb = 8 then var_ofs := ofs(t_h_t2_color); var_seg := seg(t_h_t2_color); end; if jb = 9 then var_ofs := ofs(t_h_t3_color); var_seg := seg(t_h_t3_color); end; call change_colors; call no_message; call put_sample; goto menu3; end; if j1 = 4 then menu4: draw_outline( x1 + 51, y2 - 2 - 9, x1 + 70, y2 - 1,m_b_color ); create_global_str(gstr + '1' , '/N=Statusline/H=INCO'); create_global_str(gstr + '2' , '/N=statusline-Bold'); create_global_str(gstr + '3' , '/N=Fkey-Labels'); create_global_str(gstr + '4' , '/N=fkey-Numbers'); create_global_str(gstr + '5' , '/N=Error'); create_global_str(gstr + '6' , '/N=Message'); create_global_str(gstr + '7' , '/N=Working'); create_global_str(gstr + '8' , '/N=sHadow'); create_global_str(gstr + '9' , '/N=shadow-Character'); call PUT_PREVIOUS; RM('USERIN^SUBMENU /#=9/B=1/A=1/GCLR=1/S=' + str(jb) + '/BC=' + str(box_count) + '/X=' + str(x1 + 52) + '/Y=' + str(y2 - 1 - 9) + '/G=' + gstr); jb := return_int; if jb < 1 then call CHECK_MOUSE; goto colors_loop; end; if jb = 1 then var_ofs := ofs(t_stat1_color); var_seg := seg(t_stat1_color); end; if jb = 2 then var_ofs := ofs(t_stat2_color); var_seg := seg(t_stat2_color); end; if jb = 3 then var_ofs := ofs(t_fkey_color); var_seg := seg(t_fkey_color); end; if jb = 4 then var_ofs := ofs(t_fnum_color); var_seg := seg(t_fnum_color); end; if jb = 5 then var_ofs := ofs(t_error_color); var_seg := seg(t_error_color); end; if jb = 6 then var_ofs := ofs(t_message_color); var_seg := seg(t_message_color); end; if jb = 7 then var_ofs := ofs(t_working_color); var_seg := seg(t_working_color); end; if jb = 8 then var_ofs := ofs(t_shadow_color); var_seg := seg(t_shadow_color); end; if jb = 9 then put_box(x1 + 11, y1 + 13, x1 + 41, y1 + 20, 0, m_b_color, 'SELECT SHADOW CHARACTER',true); write(' |176|176|176|176', x1 + 12, y1 + 14, 0, m_s_color ); write(' |177|177|177|177 ', x1 + 12, y1 + 15, 0, m_s_color ); write(' |178|178|178|178',x1 + 12, y1 + 16, 0, m_s_color ); write(' |219|219|219|219', x1 + 12, y1 + 17, 0, m_s_color ); write(' Transparent', x1 + 12, y1 + 18, 0, m_s_color ); RM('userin^xmenu /T=1/X=' + str(x1 + 12) + '/Y=' + str(y1+14) + '/M=1-->(INCO)2-->()3-->()4-->()5-->()'); kill_box; j2 := return_int; if j2 > 0 then Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); shadow_char1 := char( j2 + 175 ); if j2 = 4 then shadow_char1 := '|219'; end; if j2 = 5 then shadow_char1 := '|0'; end; end; call no_message; end; if jb < 9 then call change_colors; end; call no_message; call put_sample; goto menu4; end; if j1 = 5 THEN draw_outline( x1 + 51, y2 - 2 - 3, x1 + 70, y2 - 1,m_b_color ); write( ' Setting', x1 + 52, y2 - 2 - 2, 0, m_t_color ); write( 'Background color', x1 + 52, y2 - 2 - 1, 0, m_t_color ); var_ofs := ofs(t_background_color); var_seg := seg(t_background_color); call change_colors; call no_message; call put_sample; call CHECK_MOUSE; goto colors_loop; END; goto colors_loop; goto exit; clear_menu: jx := 9; while jx < 19 do ++jx; draw_char(32,x1+51,y1+jx, m_t_color, 21 ); end; ret; change_message: write(' to change foreground color ', x1 + 11,y1+17,0,m_t_color); write(' to change background color. ', x1 + 11,y1+18,0,m_t_color); write(' to accept, aborts ', x1 + 11,y1+19,0,m_t_color); Draw_Char(205,x1+55,y1+20,m_b_color,13); call write_num; ret; no_message: Draw_Char(32,x1+11,y1+16,m_t_color,36); write('Select item from menu ────────────|16 ',x1+11,y1+17,0,m_t_color); Draw_Char(32,x1+11,y1+18,m_t_color,36); Draw_Char(32,x1+11,y1+19,m_t_color,38); ret; CHECK_MOUSE: IF ((Key1 = 0) and (Key2 = 250)) THEN Set_Global_Str('@INCOEV#1','/T=Previous/KC=<ESC>/K1=27/K2=1/R=1/W=13/X=' + Str(x1 + 55) + '/Y=' + Str(y1+20)); RM('USERIN^CheckEvents /M=1/G=@INCOEV#/#=1'); IF (Return_Int = 1) THEN WHILE (Check_Key) DO END; Key1 := 0; Key2 := 0; END; END; Ret; put_previous: Set_Global_Str('@INCOEV#1','/T=Previous/KC=<ESC>/K1=27/K2=1/R=1/W=13/X=' + Str(x1 + 55) + '/Y=' + Str(y1+20)); RM('USERIN^CheckEvents /M=2/G=@INCOEV#/#=1'); ret; write_num: write('Foreground = ' + str(j_color and $0f) + ' Background = ' + str(j_color shr 4) + ' ', x1 + 11, y1 + 16, 0, m_t_color); ret; change_colors: j_color := peek(var_seg,var_ofs); old_color := j_color; call change_message; loopj1: Set_Global_Str('@INCOEV#1','/T= /KC=<ESC>/K1=27/K2=1/R=1/W=7/X=' + Str(x1 + 30) + '/Y=' + Str(y1+19)); Set_Global_Str('@INCOEV#2','/T= /KC=<ENTER>/K1=13/K2=28/R=2/W=9/X=' + Str(x1 + 11) + '/Y=' + Str(y1+19)); Set_Global_Str('@INCOEV#3','/T= /KC= /K1=0/K2=72/R=3/W=3/X=' + Str(x1 + 14) + '/Y=' + Str(y1+17)); Set_Global_Str('@INCOEV#4','/T= /KC= /K1=0/K2=80/R=4/W=3/X=' + Str(x1 + 11) + '/Y=' + Str(y1+17)); Set_Global_Str('@INCOEV#5','/T= /KC=|27 /K1=0/K2=75/R=5/W=3/X=' + Str(x1 + 11) + '/Y=' + Str(y1+18)); Set_Global_Str('@INCOEV#6','/T= /KC= /K1=0/K2=77/R=6/W=3/X=' + Str(x1 + 14) + '/Y=' + Str(y1+18)); RM('USERIN^CheckEvents /M=2/G=@INCOEV#/#=6'); read_key; if key1 = 13 then ENTER: Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); ret; end; if key1 = 27 then ESCAPE: poke( var_seg, var_ofs, old_color); ret; end; if key1 = 0 then IF (Key2 = 250) THEN RM('USERIN^CheckEvents /M=1/G=@INCOEV#/#=6'); IF (Return_Int = 1) THEN Goto ESCAPE; ELSIF (Return_Int = 2) THEN Goto ENTER; ELSIF (Return_Int = 3) THEN Goto UP_ARROW; ELSIF (Return_Int = 4) THEN Goto DOWN_ARROW; ELSIF (Return_Int = 5) THEN Goto LEFT_ARROW; ELSIF (Return_Int = 6) THEN Goto RIGHT_ARROW; END; END; if key2 = 72 then UP_ARROW: j3 := j_color and $0f; ++j3; j_color := (j_color and $f0) or (j3 and $0f); end; if key2 = 80 then DOWN_ARROW: j3 := j_color and $0f; --j3; j_color := (j_color and $f0) or (j3 and $0f); end; if key2 = 77 then RIGHT_ARROW: j3 := (j_color and $f0) shr 4; ++j3; j_color := (j_color and $0f) or ((j3 and $0f) shl 4); end; if key2 = 75 then LEFT_ARROW: j3 := (j_color and $f0) shr 4; --j3; j_color := (j_color and $0f) or ((j3 and $0f) shl 4); end; end; call write_num; poke( var_seg, var_ofs, j_color); call put_sample; goto loopj1; put_sample: {Create a sample section of the main Multi-Edit display to show the colors with} Write('L: C: [ ]',x1+12,y1+2,0,t_stat1_color); Write(' WORKING ',x1+29,y1+2,0,t_working_color); Write('128', x1 + 14, y1 + 2, 0,t_stat2_color); Write('12', x1 + 22, y1 + 2, 0,t_stat2_color); Write( ' A fun message... ',x1+12,y1+3,0,t_message_color); Write( ' A fun error... ',x1+31,y1+3,0,t_Error_color); Write( '╔═╕ ╒════════════════════════════',x1+15,y1+4,0,t_w_b_color); Write( '*',x1+16,y1+4,0, t_w_s_color); Write( 'A',x1+18,y1+4,0, t_w_s_color); Write( 'C:\TEST.TXT',x1+37,y1+4,0, t_w_s_color); Write( 'This is ',x1+16,y1+05,0,t_w_t_color); Write( 'This is ',x1+16,y1+06,0,t_w_t_color); Write( 'This is ',x1+16,y1+07,0,t_w_t_color); Write( 'This is sa',x1+16,y1+08,0,t_w_t_color); Write( 'This is changed text. This is c',x1+16,y1+9,0,t_w_c_color); Write( 'This is sample text. This is sa',x1+16,y1+10,0,t_w_t_color); Write( 'This is block highlighted text. ',x1+16,y1+11,0,t_w_h_color); Write( '>>EOF<< ',x1+16,y1+12,0,t_w_eof_color); Write( '║',x1+15,y1+05,0,t_w_b_color); Write( '║',x1+15,y1+06,0,t_w_b_color); Write( '║',x1+15,y1+07,0,t_w_b_color); Write( '║',x1+15,y1+08,0,t_w_b_color); Write( '║',x1+15,y1+09,0,t_w_b_color); Write( '║',x1+15,y1+10,0,t_w_b_color); Write( '║',x1+15,y1+11,0,t_w_b_color); Write( '║',x1+15,y1+12,0,t_w_b_color); Write( '▒▒▒',x1+12,y1+04,0,t_background_color); Write( '▒▒▒',x1+12,y1+05,0,t_background_color); Write( '▒▒▒',x1+12,y1+06,0,t_background_color); Write( '▒▒▒',x1+12,y1+07,0,t_background_color); Write( '▒▒▒',x1+12,y1+08,0,t_background_color); Write( '▒▒▒',x1+12,y1+9,0,t_background_color); Write( '▒▒▒',x1+12,y1+10,0,t_background_color); Write( '▒▒▒',x1+12,y1+11,0,t_background_color); Write( '▒▒▒',x1+12,y1+12,0,t_background_color); Write( '▒▒▒',x1+12,y1+13,0,t_background_color); Write( '┌────────────────────BOX',x1+24,y1+05,0,t_m_b_color); Write( '│',x1+24,y1+06,0,t_m_b_color); write( ' ',x1+25,y1+06,0,t_m_t_color); Write( '╘═══════════════════════',x1+24,y1+07,0,t_m_b_color); if shadow_char1 = '|0' then tstr := 'mple. This is sample.'; else j3 := 0; tstr := ''; while j3 < 22 do tstr := tstr + shadow_char1; ++j3; end; end; Write( tstr,x1+26,y1+08,0,t_shadow_color); Write( 'Window Menu File Block',x1+25,y1+6,0,t_m_t_color); Write( 'Window',x1+25,y1+6,0,t_m_h_color); Write('M',x1+32,y1+6,0,t_m_s_color); Write('F',x1+37,y1+6,0,t_m_s_color); Write('B',x1+42,y1+6,0,t_m_s_color); Write( '╚════════════════════════════════',x1+15,y1+13,0,t_w_b_color); Write( '1',x1+12,y1+14,0,t_fnum_color); Write( 'Help ',x1+13,y1+14,0,t_fkey_color); Write( ' 2',x1+19,y1+14,0,t_fnum_color); Write( 'Menu ',x1+21,y1+14,0,t_fkey_color); Write( ' 3',x1+27,y1+14,0,t_fnum_color); Write( 'Save ',x1+29,y1+14,0,t_fkey_color); Write( ' 4',x1+35,y1+14,0,t_fnum_color); Write( 'Indent',x1+37,y1+14,0,t_fkey_color); Write( ' 5',x1+43,y1+14,0,t_fnum_color); Write( 'Mar',x1+45,y1+14,0,t_fkey_color); draw_outline( x1 + 50, y1 + 1, x1 + 71, y1 + 09, t_h_b_color); write('SAMPLE HELP', x1 + 55, y1 + 1, 0, t_h_b_color); Write(' CHAPTER HEADING ', x1 + 51, y1 + 2, 0, t_h_s_color); Write('This is help text. ', x1 + 51, y1 + 3, 0, t_h_t_color); Write('This is a ', x1 + 51, y1 + 4, 0, t_h_t_color); Write('LINK', x1 + 61, y1 + 4, 0, t_h_r_color); Write('Highlighted ', x1 + 51, y1 + 5, 0, t_h_t_color); Write('LINK', x1 + 63, y1 + 5, 0, t_h_h_color); Write('This is attribute 1 ', x1 + 51, y1 + 6, 0, t_h_t1_color); Write('This is attribute 2 ', x1 + 51, y1 + 7, 0, t_h_t2_color); Write('This is attribute 3 ', x1 + 51, y1 + 8, 0, t_h_t3_color); Write('<F1>Index,<F6>Search,<', x1 + 50, y1 + 9, 0, t_h_f_color); ret; exit: {Now, change the current colors to the new colors and get out} kill_box; Kill_Box; Kill_Box; m_t_color := t_m_t_color; m_h_color := t_m_h_color; m_b_color := t_m_b_color; m_s_color := t_m_s_color; h_t_color := t_h_t_color; h_h_color := t_h_h_color; h_b_color := t_h_b_color; h_s_color := t_h_s_color; h_r_color := t_h_r_color; h_f_color := t_h_f_color; h_t1_color := t_h_t1_color; h_t2_color := t_h_t2_color; h_t3_color := t_h_t3_color; error_color := t_error_color; message_color := t_message_color; working_color := t_working_color; shadow_color := t_shadow_color; shadow_char := shadow_char1; w_t_color := t_w_t_color; w_h_color := t_w_h_color; w_c_color := t_w_c_color; w_eof_color := t_w_eof_color; w_s_color := t_w_s_color; w_b_color := t_w_b_color; d_t_color := m_t_color; d_h_color := m_h_color; d_s_color := m_s_color; d_b_color := m_b_color; fkey_color := t_fkey_color; fnum_color := t_fnum_color; stat1_color := t_stat1_color; stat2_color := t_stat2_color; background_color := t_background_color; j1 := 0; j2 := cur_window; while j1 < window_count do ++j1; switch_window(j1); if window_color_stat = 0 then t_color := w_t_color; h_color := w_h_color; eof_color := w_eof_color; s_color := w_s_color; b_color := w_b_color; c_color := w_c_color; end; end; switch_window( j2 ); return_int := 0; END_MACRO; $MACRO DISPLAY_SETUP TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: DISPLAY_SETUP Description: The display configuration menu Parameters: /BC= Amount of boxes on the screen before this macro is called so it can clean up after it'self. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_str( gstr[20], bstr[10] ); def_int( tbc ); gstr := '!DSET!_'; tbc := parse_int('/BC=', mparm_str); bstr := ''; display_setup_loop: refresh := false; {Create_Global_Str(gstr+'1','/H=INCO');} Create_Global_Str(gstr+'X1','Colors...'); Create_Global_Str(gstr+'2','/M=SCRSTYLE'); Create_Global_Str(gstr+'X2','Screen layouts...'); {Create_Global_Str(gstr+'3','/H=INVI');} Create_Global_Str(gstr+'X3','Video mode toggle'); {Create_Global_Str(gstr+'4','/H=INEX');} Create_Global_Str(gstr+'X4','Explosions ^' + copy( 'No Yes', (Explosions <> 0) * 3 + 1, 3) ); {Create_Global_Str(gstr+'5','/H=INCT');} Create_Global_Str(gstr+'X5','ctrl Help box ^' + copy( 'No Yes', (Ctrl_Help <> 0) * 3 + 1, 3) ); {Create_Global_Str(gstr+'6','/H=INLO');} Create_Global_Str(gstr+'X6','Logo screen ^' + copy( 'No Yes', (Logo_Screen <> 0) * 3 + 1, 3) ); do_xmenu: RM('USERIN^SUBMENU /H=INDS/GCLR=1/#=6/M=' + gstr + 'X' + '/S=' +global_str(gstr+'0') +'/L=DISPLAY SETUP/G=' + gstr + bstr + MParm_Str); bstr := '/B=1/BO=1'; IF RETURN_INT = 1 THEN RM( 'SETCOLOR' ); CALL DO_KILL_BOXES; RETURN_INT := 1000; GOTO EXIT; ELSIF RETURN_INT = 3 THEN CALL DO_KILL_BOXES; RM( 'TGLVID' ); call set_changed; RETURN_INT := 1000; GOTO exit; ELSIF RETURN_INT = 4 THEN Explosions := NOT( Explosions ); call set_changed; ELSIF RETURN_INT = 5 THEN Ctrl_Help := NOT( Ctrl_Help ); call set_changed; ELSIF RETURN_INT = 6 THEN Logo_Screen := NOT( logo_screen ); call set_changed; ELSIF RETURN_INT <= 0 THEN GOTO EXIT; END; GOTO display_setup_loop; set_changed: Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); ret; DO_KILL_BOXES: WHILE (box_count > tbc) DO kill_box; END; RET; EXIT: ++tbc; call DO_KILL_BOXES; END_MACRO; $MACRO SRCHSET TRANS; {*******************************MULTI-EDIT MACRO****************************** Name: SRCHSET Description: Setup routine for default search/search and replace/multi-file search settings. Parameters: /Y= Y coordinate for menu box Global Strings Modified: 'DEF_SWITCHES' 'DEF_REPL_SWITCHES' 'DEF_FS_SWITCHES' 'DEF_FS_PATH' (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_int( use_reg_exp, case_sensitive, search_dirs, y1,x1,jx ); def_str( switches_str[40], temp_return ); temp_return := return_str; y1 := parse_int('/Y=', mparm_str); x1 := parse_int('/X=', mparm_str); if x1 = 0 THEN x1 := 2; END; if y1 = 0 then y1 := 2; end; jx := 1; loop: RM('XMENU /T=1/B=1/L=SEARCH DEFAULTS SETUP/S=' + str(jx) + '/X=' + str(x1) + '/Y=' + str(y1) + '/M=Search defaults()search and Replace defaults()Multi-file search defaults()'); jx := return_int; IF return_int < 1 THEN goto exit; ELSIF return_int = 1 THEN RM('MEUTIL2^SrchIntr /M=0/SWONLY=1/SWG=DEF_SWITCHES/H=INEDSE/X=' + str(x1) + '/Y=' + str(y1) ); ELSIF return_int = 2 THEN RM('MEUTIL2^SrchIntr /M=1/SWONLY=1/SWG=DEF_REPL_SWITCHES/H=INEDSE/X=' + str(x1) + '/Y=' + str(y1) ); ELSIF return_int = 3 THEN switches_str := global_str('DEF_FS_SWITCHES'); use_reg_exp := xpos('R',switches_str, 1) <> 0; case_sensitive := xpos('C',switches_str, 1) <> 0; search_dirs := xpos('S',switches_str, 1) <> 0; Set_Global_Int('SRIINT_1',search_dirs); Set_Global_Str('SRISTR_1','/T=X'); Set_Global_Str('SRIPARM_1','/T=Search Subdirectories: /C=1/W=1/TP=5'); Set_Global_Str('SRISTR_2',global_str('DEF_FS_PATH')); Set_Global_Str('SRIPARM_2','/T=Starting path: /C=1/W=40'); Set_Global_Int('SRIINT_3',case_sensitive); Set_Global_Str('SRISTR_3','/T=X'); Set_Global_Str('SRIPARM_3','/T=Case Sensitivity: /C=1/W=1/TP=5'); Set_Global_Int('SRIINT_4',use_reg_exp); Set_Global_Str('SRISTR_4','/T=X'); Set_Global_Str('SRIPARM_4','/T=Use Regular Expressions:/C=1/W=1/TP=5'); RM('UserIn^Data_In /PRE=SR/H=INEDSE/S=1/A=2/#=4/X=10/T=MULTI-FILE SEARCH SETUP/Y=' + str(y1)); search_dirs := global_int('SRIINT_1'); set_global_str('DEF_FS_PATH', global_str('SRISTR_2')); case_sensitive := global_int('SRIINT_3'); use_reg_exp := global_int('SRIINT_4'); set_global_str('SRISTR_1',''); set_global_str('SRISTR_2',''); set_global_str('SRISTR_3',''); set_global_str('SRISTR_4',''); switches_str := ''; if use_reg_exp then switches_str := 'R'; end; if case_sensitive then switches_str := switches_str + 'C'; end; if search_dirs then switches_str := switches_str + 'S'; end; set_Global_Str('DEF_FS_SWITCHES', switches_str); Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); END; goto loop; exit: return_str := temp_return; END_MACRO; $MACRO SETEDIT TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETEDIT Description: This is the edit settings menu. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} {Global variables used: Global_Int('Default_Insert_Mode') The insert mode upon startup of editor Global_Str('Def_Switches') The search switches upon startup of editor Global_Str('Format_Code_Delimit') The print formatter code delimiter } Def_Int(X1,Y1); X1 := parse_int('/X=', mparm_str ); Y1 := parse_int('/Y=', mparm_str ); Set_Global_Str('SEISTR_1', page_str); Set_Global_Str('SEIPARM_1','/T=Page break string......../C=1/TP=0/W=10/L=1/H=INEDPA'); Set_Global_Int('SEIINT_2', truncate_spaces); Set_Global_Str('SEISTR_2','/T=YES/F=NO'); Set_Global_Str('SEIPARM_2','/T=Truncate spaces........../C=1/W=3/H=INEDTR/L=2/TP=5'); Set_Global_Str('SEISTR_3', 'Setup autosave'); Set_Global_Str('SEIPARM_3','/T=/C=0/TP=8/W=14/ML=0/L=3/M=SETUP_AUTO'); { Set_Global_Int('SEIINT_3', parse_int('/T=', global_str('@AUTOSAVEPARMS')) ); Set_Global_Str('SEIPARM_3','/T=Autosave time (0 = OFF)../C=1/TP=1/W=3/L=3/H=INEDAU/MIN=0/MAX=254'); } Set_Global_Str('SEISTR_4', '/T=INSERT/F=OVERWRITE' ); Set_Global_Int('SEIINT_4', Global_Int('Default_Insert_Mode') ); Set_Global_Str('SEIPARM_4','/T=Default mode............./C=1/TP=5/W=10/L=4/H=INEDDE'); Set_Global_Int('SEIINT_5', tab_expand ); Set_Global_STR('SEISTR_5', '/T=TABS/F=SPACES' ); Set_Global_Str('SEIPARM_5','/T=Tab expand.............../C=1/TP=5/W=10/L=5/H=INEDTA'); Set_Global_Int('SEIINT_6', ins_cursor + 1 ); Set_Global_STR('SEISTR_6', 'Underline _()1/2 block ▄()2/3 block ▄()Full block █()' ); Set_Global_Str('SEIPARM_6','/T=Insert cursor............/C=1/TP=3/W=10/L=6/H=INEDIN'); Set_Global_Int('SEIINT_7', ovr_cursor + 1 ); Set_Global_STR('SEISTR_7', 'Underline _()1/2 block ▄()2/3 block ▄()Full block █()' ); Set_Global_Str('SEIPARM_7','/T=Overwrite cursor........./C=1/TP=3/W=10/L=7/H=INEDIN'); {Specchar and dlbparen properly represent unprintable ASCII codes in the menu} RM( 'userin^SPECCHAR ' + Word_Delimits ); Set_Global_Str('SEISTR_8', return_str); Set_Global_Str('SEIPARM_8','/T=Word delimits............/C=1/TP=0/W=20/ML=40/L=8/H=INEDWO'); Set_Global_Str('SEISTR_9', 'Search Settings'); Set_Global_Str('SEIPARM_9','/T=/C=0/TP=8/W=40/ML=0/L=9/H=INEDSE/M=SRCHSET'); Set_Global_Str('SEISTR_10', Global_Str('Format_Code_Delimit')); Set_Global_Str('SEIPARM_10','/T=Print formatter code...../C=1/TP=0/W=1/ML=1/L=10/H=INEDFO'); Set_Global_INT('SEIINT_11', max_undo); Set_Global_Str('SEIPARM_11','/T=Max undo count.........../C=1/TP=1/W=5/ML=5/L=11/H=INEDMA/MIN=0/MAX=32367'); Set_Global_Str('SEISTR_12', 'Set Key Repeat Speed'); Set_Global_Str('SEIPARM_12','/T=/C=0/TP=8/W=40/ML=0/L=12/H=INEDKE/M=KEYSPEED'); Set_Global_Int('SEIINT_13', ctrl_z ); Set_Global_STR('SEISTR_13', '/T=Yes/F=No' ); Set_Global_Str('SEIPARM_13','/T=Control-Z at EOF........./C=1/TP=5/W=3/L=13/H=INEDCT'); Set_Global_STR('SEISTR_14', '/T=Yes/F=No' ); Set_Global_Int('SEIINT_14', eof_cr ); Set_Global_Str('SEIPARM_14','/T=CR//LF at EOF............./C=1/TP=5/W=3/L=14/H=INEDEOFCR'); Set_Global_STR('SEISTR_15', '/T=Delete space/F=Leave space' ); Set_Global_Int('SEIINT_15', column_move_style ); Set_Global_Str('SEIPARM_15','/T=Column block move style../C=1/TP=5/W=12/L=15/H=INEDCBLKST'); RM('UserIn^Data_In /H=INED/PRE=SE/S=1/A=2/#=15/T=EDIT SETTINGS/X=' + str(x1) + '/Y=' + str(y1)); Page_Str := Global_Str( 'SEISTR_1' ); Truncate_Spaces := Global_Int( 'SEIINT_2' ); { RM('SetAutoSave /T=' + str( Global_Int( 'SEIINT_3' ))); } Set_Global_Int( 'Default_Insert_Mode', Global_Int( 'SEIINT_4' )); Tab_Expand := Global_Int( 'SEIINT_5' ); Ins_Cursor := Global_Int( 'SEIINT_6' ) - 1; Ovr_Cursor := Global_Int( 'SEIINT_7' ) - 1; RM('USERIN^VALCHAR ' + Global_Str( 'SEISTR_8' ) ); word_delimits := return_str; Set_Global_Str( 'FORMAT_CODE_DELIMIT', Global_Str( 'SEISTR_10' )); Max_Undo := Global_Int( 'SEIINT_11' ); ctrl_z := Global_Int( 'SEIINT_13' ); eof_cr := Global_Int( 'SEIINT_14' ); column_move_style := Global_Int( 'SEIINT_15' ); set_changed: Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); x1 := 1; WHILE x1 < 16 DO set_global_str( 'SESTR_' + str(x1), '' ); set_global_int( 'SEINT_' + str(x1), 0 ); ++x1; END; END_MACRO; $MACRO SETMEPATHS TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETMEPATHS Description: This menu sets up the backup methods, and backup and temp file paths Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(X1,Y1); X1 := parse_int('/X=', mparm_str ); Y1 := parse_int('/Y=', mparm_str ); {Build a menu with current settings} Set_Global_Str('ISTR_1','Off()Create .BAK file()Copy file to backup directory()'); Set_Global_Int('IINT_1', backups + 1 ); Set_Global_Str('IPARM_1','/T=BACKUP METHOD:/C=1/TP=3/W=30/L=1/H=INEDBA'); Set_Global_STR('ISTR_2', backup_path ); Set_Global_Str('IPARM_2','/T=Backup directory:/C=1/W=25/ML=80/TP=0/L=2'); Set_Global_STR('ISTR_3', temp_path ); Set_Global_Str('IPARM_3','/T=Temporary file directory:/C=1/W=25/ML=80/TP=0/L=3'); RM('UserIn^Data_In /H=INEDBA/S=1/A=2/#=3/T=BACKUPS // DIRECTORIES/X=' + str(x1) + '/Y=' + str(y1)); IF (backups <> (Global_Int( 'IINT_1' ) - 1)) OR (backup_path <> Global_Str('ISTR_2')) OR (temp_path <> Global_Str('ISTR_3')) THEN Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); END; backups := Global_Int( 'IINT_1' ) - 1; backup_path := Global_Str('ISTR_2'); temp_path := Global_Str('ISTR_3'); return_int := 0; END_MACRO; $MACRO SETMOUSE TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: SETMOUSE Description: This is the mouse settings menu. Parameters: /X= X coordinate for menu box /Y= Y coordinate for menu box (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} def_str( tstr[80] ); def_int( sensitivity ); tstr := global_str('@MOUSEPARMS'); sensitivity := parse_int('/S=', tstr ); Set_Global_Str('ISTR_1','/F=Off/T=On'); Set_Global_Int('IINT_1', mouse); Set_Global_Str('IPARM_1','/T=Mouse is............................................./TP=5/C=1/W=4'); Set_Global_Int('IINT_2', sensitivity ); Set_Global_Str('IPARM_2','/T=Mouse sensitivity [0(Default), 1(slow)..100(fast)].../MIN=0/MAX=100/TP=1/L=3/C=1/W=4'); Set_Global_Str('ISTR_3','/F=No/T=Yes'); Set_Global_Int('IINT_3', mou_disappear); Set_Global_Str('IPARM_3','/T=Turn mouse cursor off when keyboard is used........../TP=5/C=1/W=4'); Run_Macro( 'USERIN^Data_In /H=INMO/#=3/S=1/A=2/T=MOUSE SETUP' + '/X=' + parse_str('/X=', mparm_str) + '/Y=' + parse_str('/Y=', mparm_str ) ); IF mouse <> global_int('IINT_1') THEN mouse := global_int('IINT_1'); call set_changed; END; IF mou_disappear <> global_int('IINT_3') THEN call set_changed; mou_disappear := global_int('IINT_3'); END; IF (sensitivity <> global_int('IINT_2')) THEN call set_changed; sensitivity := global_int('IINT_2'); IF mou_installed and (sensitivity <> 0) THEN r_bx := sensitivity; r_cx := sensitivity; r_dx := sensitivity; r_ax := 26; intr($33); END; END; set_global_str('@MOUSEPARMS', '/S=' + str(sensitivity) ); return_int := 0; goto exit; set_changed: Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); ret; exit: END_MACRO; $MACRO PRTTYPE TRANS; {****************************************************************************** MULTI-EDIT MACRO NAME: PRTTYPE DESCRIPTION: This is the printer type menu. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Str(Old_Printer[2048]); { Set_Global_Str('PRNIHELP3','/C=2/L=2/H=Code name Format code Printer control code'); } Old_Printer := Global_Str('Printer_type'); RM('USERIN^DB /GLO=PRINTER_TYPE/LO=2/PRE=PRN/NOALPHA=1/ENC=1/F=' + 'PRINTERS.DB/LT=SELECT A PRINTER TYPE/DT=PRINTER DRIVER SETUP/H=INPR' + mparm_str); { Set_Global_Str('PRNIHELP3',''); } IF (Old_Printer <> Global_Str('Printer_type')) THEN Set_Global_Int('SETUP_CHANGED',Global_Int('SETUP_CHANGED') or $01); END; {Reload printer type into the global just in case there were changes made to the printer codes} RM('USERIN^DB /F=PRINTERS.DB/GLO=PRINTER_TYPE/RR=1/FV=' + Parse_Str('PT=',Global_Str('PRINTER_TYPE'))); END_MACRO; $MACRO EXTENS TRANS; {****************************************************************************** MULTI-EDIT MACRO NAME: EXTENS DESCRIPTION: This is the filename extension specific setup menu. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(Jx,Jy,T_Reg_Exp_Stat); Def_Str(Tstr[60]); { Set_Global_Str('T_Format', ' R ' ); } T_Reg_Exp_Stat := Reg_Exp_Stat; Set_Global_Str('T_Format',''); RM('USERIN^DB /F=MECONFIG.DB/Y=3/DPT=EXT.DB/PROTECT1=DEFAULT/PRE=EXT/LT=EXTENSION SETUP/NOALPHA=1/H=FE/GLO=EXT/CP=Input new extension: '); IF (Global_Int( '@DB_FILE_CHANGED' )) THEN {If we made any changes to the extension setup, reload all current extension globals} IF user_id = '' THEN tstr := CAPS(me_path + 'MECONFIG.DB'); ELSE tstr := CAPS(me_path + user_id + '.USR\' + 'MECONFIG.DB'); END; IF (switch_file( tstr )) THEN Last_Page_Break; Up; {The following may look like a lot of stuff to do, but this provides a high degree of confidence that we indeed are looking at the right place in MECONFIG.DB} IF (Get_Line = '|12EXT.DB') THEN Eol; IF (Search_Fwd('%{@*@*@*@*START@*@*@*@*}||{|12}',0)) THEN IF (Get_Line = '****START****') THEN Down; WHILE ((Not(At_Eof)) and (Cur_Char <> '|12')) DO TStr := '.' + Parse_Str('EXT=',Get_Line); IF (Global_Str(TStr) <> '') THEN Set_Global_Str(TStr,Get_Line); END; DOWN; END; END; END; END; END; END; Reg_Exp_Stat := T_Reg_Exp_Stat; Set_Global_Str('T_Format',''); END_MACRO; $MACRO LANG_MENU TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: LANG_MENU Description: Menu of language types for extension setup (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} RM('USERIN^DB /PRE=LANG/F=MECONFIG.DB/DPT=LANGUAGE.DB/NC=1/NE=1/LO=1/U=1/TT=1/H=FE_LANGUAGE/GLO=@LANG/MACRO=SETUP^LANG_WARNING'); END_MACRO; $MACRO PGM_MENU TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: PGM_MENU Description: Menu of compiler/program types for extension setup (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} RM('USERIN^DB /F=MECONFIG.DB/DPT=PGM.DB/PRE=PT/GLO=PGM/NE=1/NC=1/LO=1/U=1/LT=COMPILER////PROGRAM/H=FE_PROGRAM/MACRO=SETUP^PGM_WARNING'); END_MACRO; $MACRO PGM_DB TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: PGM_DB Description: Menu of program/compiler interfaces for the selected extension This macro is run by DATA_IN Parameters: /PRE= Prefix of the ISTR global. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Str( glob_name[20] ); glob_name := parse_str('/PRE=', mparm_str ) + 'ISTR_1'; RM('USERIN^DB /PRE=PGM/HPT=DEFAULT.PGM/F=MECONFIG.DB/DPT=' + global_str( glob_name ) + '.PGM/LT=COMPILER////PROGRAM SETUP/NOALPHA=1/H=FE_PROGRAM'); END_MACRO; $MACRO PGM_WARNING TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: PGM_WARNING Description: Warns user that he cannot just arbitrarily add program types without having support for them. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} IF (Parse_Int('/P=',MParm_Str)) THEN RM('MEERROR^MessageBox /T=WARNING/B=1/M=If you added any new program types, be sure that the macro CMPERROR in the macro file LANGUAGE.SRC has code to support it.'); END; END_MACRO; $MACRO LANG_WARNING TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: LANG_WARNING Description: Warns user that he cannot just arbitrarily add language types without having support for them. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} IF (Parse_Int('/P=',MParm_Str)) THEN RM('MEERROR^MessageBox /T=WARNING/B=1/M=If you added any new language types, be sure that you have the appropriate support macros.'); END; END_MACRO; $MACRO EXT_FORMAT TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: EXT_FORMAT Description: Allows creation and/or editing of extension specific format lines. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(Temp_Integer,T_Message_Row,Null); Temp_Integer := Cur_Window; {The format line editing macro "borrows" the line the cursor is on from the current window. We will make up a special window for this.} Switch_Window(Window_Count); Create_Window; Size_Window(1,9,78,11); File_Name := 'FORMAT-LINE'; Put_Box(1,9,80,12,0,m_b_Color,'',True); Format_Line := Global_Str('T_Format'); IF (Format_Line = '') THEN Format_Line := ' R '; END; Refresh := True; Redraw; Write('Editing format line. <Enter> or <Esc> to quit.', win_x1 + 2, win_y2, 0, b_color); T_Message_Row := Message_Row; Message_Row := 0; RM( 'meutil1^Edformat'); IF (Format_Stat) THEN Set_Global_Str('T_Format',Format_Line); ELSE Set_Global_Str('T_Format',''); END; Refresh := False; Delete_Window; Switch_Window(Temp_Integer); Kill_Box; Message_Row := T_Message_Row; Make_Message(''); Return_Str := 'Edit format line'; END_MACRO; $MACRO TGLVID TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: TGLVID Description: Toggles between 80X25 and 80X43 or 80X50 depending on the video card. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(Old_Mode); {The video mode before the toggle} Refresh := False; Old_Mode := Video_Mode; Toggle_Video; RM('SETSCRN'); REFRESH := TRUE; NEW_SCREEN; Mou_Set_Limits( 1, 1, Screen_Width, Screen_Length ); END_MACRO; $MACRO KEYCODE FROM ALL TRANS; {****************************************************************************** MULTI_EDIT MACRO Name: KEYCODE Description: The macro prompts for a key press and then returns the name and the main and extended codes for the key. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Make_Message('Type the desired key.'); READ_KEY; RM('MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2)); Make_Message(Return_Str + ' Keycode = '+Str(key1)+', Extended code = '+Str(key2)); END_MACRO; $MACRO MAKEKEY FROM ALL TRANS; {****************************************************************************** MULTI_EDIT MACRO Name: MAKEKEY Description: Takes two integer keycode parameters and returns the name of the keycode in RETURN_STR. See KEYCODE (above) for example. Parameters: /K1= Primary scan code. /K2= Extended scan code. Returns: Return_Str contains the key name (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int( what1, what0 ); What0 := Parse_Int('/K1=', MParm_Str); What1 := Parse_Int('/K2=', MParm_Str); Return_Str := ''; If (What0 = 0) and (What1 = 0) then Goto exit; END; Return_Str := 'Alt '; If What0 = 0 THEN If (What1 >= 59) and (What1 <= 68) THEN Return_Str := Str(What1 - 58); Return_Str := 'F'+Return_Str; Goto Exit2; end; If (What1 >= 84) and (What1 <= 93) THEN Return_Str := Str(What1 - 83); Return_Str := 'ShftF'+Return_Str; Goto Exit2; end; If (What1 >= 94) and (What1 <= 103) THEN Return_Str := Str(What1 - 93); Return_Str := 'CtrlF'+Return_Str; Goto Exit2; end; If (What1 >= 104) and (What1 <= 113) THEN Return_Str := Str(What1 - 103); Return_Str := 'AltF'+Return_Str; Goto Exit2; end; Return_Str := ''; Return_Str := Parse_Str('/'+Str(What1)+'=', '/129=Alt0/130=Alt-/131=Alt=/16=AltQ/17=AltW/18=AltE/19=AltR/20=AltT/21=AltY/40=Alt''/39=Alt;'+ '/22=AltU/23=AltI/24=AltO/25=AltP/30=AltA/31=AltS/32=AltD/33=AltF/34=AltG'); If Return_Str = '' THEN Return_Str := Parse_Str('/'+Str(What1)+'=', '/35=AltH/36=AltJ/37=AltK/38=AltL/44=AltZ/45=AltX/46=AltC/47=AltV/48=AltB'+ '/49=AltN/50=AltM/75=LF/77=RT/72=UP/80=DN/71=HOME/79=END' + '/15=ShftTAB/115=CtrlLF/116=CtrlRT/119=CtrlHOME/117=CtrlEND/132=CtrlPGUP/118=CtrlPGDN'); END; If Return_Str = '' THEN Return_Str := Parse_Str('/'+Str(What1)+'=', '/120=Alt1/121=Alt2/122=Alt3/123=Alt4/124=Alt5/125=Alt6/126=Alt7/127=Alt8/128=Alt9'+ '/82=INS/83=DEL/133=F11/134=F12/135=ShftF11/136=ShftF12/137=CtrlF11/138=CtrlF12'+ '/246=Btn2/240=MsUP/241=MsDN/243=MsRT/242=MsLF/250=MEVENT'); END; If Return_Str = '' THEN Return_Str := Parse_Str('/'+Str(What1)+'=', '/73=PGUP/81=PGDN/141=CtrlUP/145=CtrlDN/143=CtrlCNTR/1=AltESC/251=MEVENT2/252=MEVENT3'+ '/76=CNTR/41=Alt`/51=Alt</52=Alt>/53=Alt?/146=CtrlINS/147=CtrlDEL/144=CtrlGREY+/142=CtrlGREY-' + '/139=AltF11/140=AltF12/244=Btn0/245=Btn1/150=CtrlGREY*/55=AltGREY*' ); END; If Return_Str = '' THEN Return_Str := Parse_Str('/'+Str(What1)+'=', '/74=AltGREY-/78=AltGREY+/166=AltGREYENTER/148=CtrlTAB/165=AltTAB/14=AltBS/28=AltENTER' + '/26=Alt[/27=Alt]/3=Ctrl@/238=ScrollLockOn/239=ScrollLockOff/43=Alt\/162=AltIns/163=AltDel/151=AltHOME' + '/159=AltEND/153=AltPgUp/161=AltPgDn/152=AltUP/160=AltDN/155=AltLF/157=AltRT' ); END; if (what1 = 164) then return_str := 'AltGREY/'; end; if (what1 = 149) then return_str := 'CtrlGREY/'; end; Goto Exit2; END; Return_Str := ''; Return_Str := Parse_Str('/'+Str(What0)+','+Str(What1)+'=', '/13,28=ENTER/13,224=GreyENTER/13,50=CtrlM/10,28=CtrlENTER/10,36=CtrlJ/27,1=ESC/27,26=Ctrl[/8,14=BS/8,35=CtrlH'+ '/10,224=CtrlGreyENTER/9,15=TAB/9,23=CtrlI/55,8=7/55,71=ShftHOME/56,9=8/56,72=ShftUP/57,10=9/57,73=ShftPGUP'); If Return_Str = '' THEN Return_Str := Parse_Str('/'+Str(What0)+','+Str(What1)+'=', '/45,12=-/45,74=GREY-/42,9=*/42,55=GREY*/52,5=4/52,75=ShftLF/53,6=5/53,76=ShftCNTR'+ '/54,7=6/54,77=ShftRT/43,13=+/43,78=GREY+/49,2=1/49,79=ShftEND/50,3=2/50,80=ShftDN'+ '/51,4=3/51,81=ShftPGDN/48,11=0/48,82=ShftINS/46,52=./46,83=ShftDEL'); END; if (what0 = 47) and (what1 = 224) then return_str := 'GREY/'; end; If Return_Str = '' THEN Return_Str := Parse_Str('/'+Str(What0)+'=', '/127=CtrlBS'); END; If Return_Str = '' THEN IF (What0 >= 1) and (What0 <= 31) THEN Return_Str := 'Ctrl'+Char(What0 + 64); Else Return_Str := char(What0); goto exit; end; END; Exit2: Return_Str := '<' + Return_Str + '>'; EXIT: END_MACRO; {**** THESE 2 MACROS ARE NECCESSARY IF WE EMPLOY OUR KEYSTROKE ASSIGNMENTS "ON THE FLY" TECHNIQUE} $MACRO MAKE_SCAN_CODES FROM ALL TRANS; {****************************************************************************** MULTI_EDIT MACRO Name: MAKE_SCAN_CODES Description: Takes a valid keycode (like <CtrlF2>) and returns the proper scan codes. Essentially the opposite of MAKEKEY. Parameters: Return_Str should contain the key name Returns: If successful, Return_Str contains: /K1= Primary scan code. /K2= Extended scan code. Otherwise, Return_Str = ''. Also, Return_Int contains the combined scan codes in a 2 byte value. Otherwise, Return_Int = 0. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(jx,Jy); Def_Str(KName[20],TStr); KNAME := Return_Str; Return_Str := ''; Return_Int := 0; If (Kname = '') then Goto exit; END; {Strip <> if present} IF (Svl(KName) > 2) THEN IF (Str_Char(KName,1) <> '<') THEN Goto EXIT; END; IF (Str_Char(KName,Svl(KName)) <> '>') THEN Goto EXIT; END; Kname := Caps(Copy(Kname,2,Svl(KName) - 2)); END; {If it is a function key...} IF (Xpos('F',Kname,1)) THEN TStr := Kname; IF (XPos('SHFT',TStr,1) = 1) THEN Tstr := Copy(Tstr,5,20); Jx := 25; ELSIF (XPos('CTRL',tstr,1) = 1) THEN Tstr := Copy(Tstr,5,20); Jx := 35; ELSIF (XPos('ALT',tstr,1) = 1) THEN Tstr := Copy(Tstr,4,20); Jx := 45; ELSE Jx := 0; END; IF (Str_Char(Tstr,1) <> 'F') THEN Goto NOT_FKEY; END; Tstr := Copy(Tstr,2,20); IF ((Tstr = '') or (Svl(Tstr) > 2)) THEN Goto NOT_FKEY; END; IF (Val(Jy,Tstr) or (Jy < 1) or (Jy > 10)) THEN Goto NOT_FKEY; END; Return_Str := Str(Jy + 58 + Jx); IF (Jx) THEN Jx := Jx - 15; END; Set_Global_Int('!FKEY@',Jy + Jx); Goto EXIT2; END; NOT_FKEY: Set_Global_Int('!FKEY@',0); Return_Str := Parse_Str('' + Kname + '≡', 'ALT0≡129ALT-≡130ALT=≡131ALTQ≡16ALTW≡17ALTE≡18ALTR≡19ALTT≡20ALTY≡21' + 'ALT''≡40ALT;≡39ALTU≡22ALTI≡23ALTO≡24ALTP≡25ALTA≡30ALTS≡31ALTD≡32' + 'ALTF≡33ALTG≡34'); IF (Return_Str <> '') THEN Goto EXIT2; END; Return_Str := Parse_Str('' + Kname + '≡', 'ALTH≡35ALTJ≡36ALTK≡37ALTL≡38ALTZ≡44ALTX≡45ALTC≡46ALTV≡47ALTB≡48' + 'ALTN≡49ALTM≡50LF≡75RT≡77UP≡72DN≡80HOME≡71END≡79SHFTTAB≡15' + 'CTRLLF≡115CTRLRT≡116CTRLHOME≡119CTRLEND≡117CTRLPGUP≡132CTRLPGDN≡118'); IF (Return_Str <> '') THEN Goto EXIT2; END; Return_Str := Parse_Str('' + Kname + '≡', 'ALT1≡120ALT2≡121ALT3≡122ALT4≡123ALT5≡124ALT6≡125ALT7≡126ALT8≡127' + 'ALT9≡128INS≡82DEL≡83F11≡133F12≡134SHFTF11≡135SHFTF12≡136CTRLF11≡137' + 'CTRLF12≡138BTN2≡246MSUP≡240MSDN≡241MSRT≡243MSLF≡242MEVENT≡250'); IF (Return_Str <> '') THEN Goto EXIT2; END; Return_Str := Parse_Str('' + Kname + '≡', 'PGUP≡73PGDN≡81CTRLUP≡141CTRLDN≡145CTRLCNTR≡143ALTESC≡1MEVENT2≡251' + 'MEVENT3≡252CNTR≡76ALT`≡41ALT<≡51ALT>≡52ALT?≡53CTRLINS≡146' + 'CTRLDEL≡147CTRLGREY+≡144CTRLGREY-≡142ALTF11≡139ALTF12≡140BTN0≡244' + 'BTN1≡245CTRLGREY*≡150ALTGREY*≡55'); IF (Return_Str <> '') THEN Goto EXIT2; END; Return_Str := Parse_Str('' + Kname + '≡', 'ALTGREY-≡74ALTGREY+≡78ALTGREYENTER≡166CTRLTAB≡148ALTTAB≡165ALTBS≡14' + 'ALTENTER≡28ALT[≡26ALT]≡27CTRL@≡3SCROLLLOCKON≡238SCROLLLOCKOFF≡239' + 'ALT\≡43ALTINS≡162ALTDEL≡163ALTHOME≡151ALTEND≡159ALTPGUP≡153' + 'ALTPGDN≡161ALTUP≡152ALTDN≡160ALTLF≡155ALTRT≡157ALTGREY/≡164' + 'CTRLGREY/≡149'); IF (Return_Str <> '') THEN Goto EXIT2; END; Return_Str := Parse_Str('' + Kname + '≡', 'ENTER≡13/K2=28GREYENTER≡13/K2=224CTRLM≡13/K2=50CTRLENTER≡10/K2=28' + 'CTRLJ≡10/K2=36ESC≡27/K2=1CTRL[≡27/K2=26BS≡8/K2=14CTRLH≡8/K2=35' + 'CTRLGREYENTER≡10/K2=224TAB≡9/K2=15CTRLI≡9/K2=237≡55/K2=8' + 'SHFTHOME≡55/K2=718≡56/K2=9SHFTUP≡56/K2=729≡57/K2=10SHFTPGUP≡57/K2=73'); IF (Return_Str <> '') THEN Return_Str := '/K1=' + Return_Str; Goto EXIT; END; Return_Str := Parse_Str('' + Kname + '≡', '-≡45/K2=12GREY-≡45/K2=74*≡42/K2=9GREY*≡42/K2=554≡52/K2=5' + 'SHFTLF≡52/K2=755≡53/K2=6SHFTCNTR≡53/K2=766≡54/K2=7SHFTRT≡54/K2=77' + '+≡43/K2=13GREY+≡43/K2=781≡49/K2=2SHFTEND≡49/K2=792≡50/K2=3' + 'SHFTDN≡50/K2=803≡51/K2=4SHFTPGDN≡51/K2=810≡48/K2=11SHFTINS≡48/K2=82' + '.≡46/K2=52SHFTDEL≡46/K2=83GREY/≡47/K2=244CTRLBS≡127/K2=14'); IF (Return_Str <> '') THEN Return_Str := '/K1=' + Return_Str; Goto EXIT; END; IF ((XPos('CTRL',kname,1) = 1) and (Svl(Kname) = 5)) THEN Jx := Ascii(Str_Char(Kname,5)); IF ((Jx > 63) and (Jx < 96)) THEN TStr := '|3|30|48|46|32|18|33|34|35|23|36|37|38|50|49|24|25|16|19|31|20|22|47|17|45' + '|21|44|26|43|27|7|12'; Return_Str := '/K1=' + Str(Ascii(Kname)) + '/K2=' + Str(Ascii(Str_Char(Tstr,Jx - 63))); Goto EXIT; END; END; IF (Svl(Kname) = 1) THEN {Alphanumeric} Jx := Ascii(Kname); IF ((Jx > 31) and (Jx < 127)) THEN TStr := '|57|2|40|4|5|6|8|40|10|11|9|13|51|12|52|53|11|2|3|4|5|6|7|8|9|10|39|39|51' + '|13|52|53|3|30|48|46|32|18|33|34|35|23|36|37|38|50|49|24|25|16|19|31|20|22' + '|47|17|45|21|44|26|43|27|7|12|41|30|48|46|32|18|33|34|35|23|36|37|38|50|49' + '|24|25|16|19|31|20|22|47|17|45|21|44|26|43|27|41'; Return_Str := '/K1=' + Str(Ascii(Kname)) + '/K2=' + Str(Ascii(Str_Char(Tstr,Jx - 31))); Goto EXIT; END; END; EXIT2: Return_Str := '/K1=0/K2='+ Return_Str; EXIT: IF (Return_Str <> '') THEN Return_Int := (Parse_Int('/K2=',Return_Str) shl 8) or Parse_Int('/K1=',Return_Str); END; END_MACRO; $MACRO ASSIGN_CMD FROM ALL TRANS; {****************************************************************************** MULTI_EDIT MACRO Name: ASSIGN_CMD Description: Takes a valid command name (like DEL_CHAR) and assigns a valid key value to it. Parameters: Return_Str should contain the command name Return_Int should contain the 2 byte key value Returns: Return_Int = 1 if successful, 0 if not. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Str(Cmd[20] := Caps(Parse_Str('/C=',MParm_Str))); Def_int( C_Mode := Parse_Int('/M=',MParm_Str), Key := Parse_Int('/K=',MParm_Str) ); Return_Int := 0; IF (Key < 1) THEN Goto EXIT; END; IF (Cmd = '') THEN Goto EXIT; END; IF (C_Mode < 0) THEN C_Mode := 0; END; Return_Int := 1; IF (Cmd = 'DEL_CHAR') THEN Cmd_to_Key(Key,DEL_CHAR,C_Mode); ELSIF (Cmd = 'BACK_SPACE') THEN Cmd_to_Key(Key,BACK_SPACE,C_Mode); ELSIF (Cmd = 'DEL_LINE') THEN Cmd_to_Key(Key,DEL_LINE,C_Mode); ELSIF (Cmd = 'UNDO') THEN Cmd_to_Key(Key,UNDO,C_Mode); ELSIF (Cmd = 'REDO') THEN Cmd_to_Key(Key,REDO,C_Mode); ELSIF (Cmd = 'LEFT') THEN Cmd_to_Key(Key,LEFT,C_Mode); ELSIF (Cmd = 'RIGHT') THEN Cmd_to_Key(Key,RIGHT,C_Mode); ELSIF (Cmd = 'UP') THEN Cmd_to_Key(Key,UP,C_Mode); ELSIF (Cmd = 'DOWN') THEN Cmd_to_Key(Key,DOWN,C_Mode); ELSIF (Cmd = 'PAGE_UP') THEN Cmd_to_Key(Key,PAGE_UP,C_Mode); ELSIF (Cmd = 'PAGE_DOWN') THEN Cmd_to_Key(Key,PAGE_DOWN,C_Mode); ELSIF (Cmd = 'TOF') THEN Cmd_to_Key(Key,TOF,C_Mode); ELSIF (Cmd = 'EOF') THEN Cmd_to_Key(Key,EOF,C_Mode); ELSIF (Cmd = 'NEXT_PAGE_BREAK') THEN Cmd_to_Key(Key,NEXT_PAGE_BREAK,C_Mode); ELSIF (Cmd = 'LAST_PAGE_BREAK') THEN Cmd_to_Key(Key,LAST_PAGE_BREAK,C_Mode); ELSIF (Cmd = 'WORD_LEFT') THEN Cmd_to_Key(Key,WORD_LEFT,C_Mode); ELSIF (Cmd = 'WORD_RIGHT') THEN Cmd_to_Key(Key,WORD_RIGHT,C_Mode); ELSIF (Cmd = 'TAB_RIGHT') THEN Cmd_to_Key(Key,TAB_RIGHT,C_Mode); ELSIF (Cmd = 'TAB_LEFT') THEN Cmd_to_Key(Key,TAB_LEFT,C_Mode); ELSIF (Cmd = 'INDENT') THEN Cmd_to_Key(Key,INDENT,C_Mode); ELSIF (Cmd = 'UNDENT') THEN Cmd_to_Key(Key,UNDENT,C_Mode); ELSIF (Cmd = 'KEY_RECORD') THEN Cmd_to_Key(Key,KEY_RECORD,C_Mode); ELSE Return_Int := 0; END; EXIT: END_MACRO; {$MACRO CMD_VAL FROM ALL TRANS; {****************************************************************************** MULTI_EDIT MACRO Name: CMD_VAL Description: Takes a valid command name (like DEL_CHAR) and returns the proper Numeric value. Parameters: Return_Str should contain the command name Returns: If successful, Return_Int contains the value, otherwise Return_Int = 0. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Return_Int := Parse_Int('/' + Caps(Return_Str) + '=', '/DEL_CHAR=24/BACK_SPACE=25/DEL_LINE=26/UNDO=27/REDO=80/LEFT=1/RIGHT=2/UP=3' + '/DOWN=4/PAGE_UP=7/PAGE_DOWN=8/TOF=9/EOF=10/NEXT_PAGE_BREAK=11' + '/LAST_PAGE_BREAK=12/WORD_LEFT=13/WORD_RIGHT=14/TAB_RIGHT=20/TAB_LEFT=21' + '/INDENT=22/UNDENT=23/KEY_RECORD=67'); END_MACRO; } $MACRO BUILDKEY FROM EDIT TRANS; {****************************************************************************** MULTI-EDIT MACRO Name: BUILDKEY Description: This macro converts a keystroke macro into a KEY_IN macro statement and optionally creates an entire macro from it. (C) Copyright 1989 by American Cybernetics, Inc. ******************************************************************************} Def_Int(JX,JY,JJ,T_Insert_Mode); Def_Str(TStr,Macro_Name); T_Insert_Mode := Insert_Mode; Put_Box(16,3,65,8,0,m_b_color,'CREATE KEYSTROKE MACRO SOURCE',True); RM('USERIN^XMENU /X=28/Y=5/M=Complete macro(KM)Key_In only()'); jj := return_int; If JJ < 1 THEN Kill_Box; GOTO Exit; END; Write(' Multi-Edit mode = ',17,5,0,m_s_Color); RM('USERIN^XMENU /X=37/Y=5/M=EDIT(IN)DOS_SHELL()TERM()ALL()'); jx := return_int; If JX < 1 THEN Kill_Box; GOTO Exit; END; Macro_Name := ''; IF (JJ = 1) THEN MACRO_NAME_AGAIN: draw_char(32,46,5,m_t_color,14); return_str := ''; RM('USERSTR /P= Enter macro name: /W=8/X=17/Y=5/H=KM'); IF return_int = 0 THEN GOTO EXIT; END; macro_name := return_str; IF (Macro_Name = '') THEN RM('MEERROR^Beeps /C=1'); Goto MACRO_NAME_AGAIN; END; END; Macro_Name := Caps(Macro_Name); Write(' Press the desired key... ',20,5,0,m_s_Color); READ_KEY; Kill_Box; Insert_Mode := True; Push_Undo; If JJ = 1 THEN Create_Window; File_Name := Macro_Name + '.SRC'; RM('EXTSETUP'); RM('keycode^MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2)); TStr := Return_Str; If Copy(TStr,1,1) = '<' Then TStr := Str_Del(Tstr,1,1); END; IF Copy(TStr,Length(TStr),1) = '>' THEN Tstr := Str_Del(TStr,Length(TStr),1); END; { RM('keycode^MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2)); TStr := Return_Str; } TEXT('$MACRO ' + MACRO_NAME + ' TO ' + RETURN_STR + ' FROM ' + remove_space(copy('EDIT DOS_SHELLTERM ALL',((jx-1)*9) + 1,9))); CR; CR; TEXT('END_MACRO;'); UP; Goto_Col(3); END; Text('Key_In('); Jy := C_Col; Play_Key_Macro(key1,key2,MODE); While Check_Key DO IF (C_COL > 70) THEN CR; GOTO_COL(1); end; RM('keycode^MAKEKEY /K1='+Str(key1)+'/K2='+Str(key2)); TStr := Return_Str; IF (XPos(TStr,'><()',1)) THEN Text('<' + TStr + '>'); ELSE Text(Tstr); END; END; Text(');'); Redraw; IF JJ = 1 THEN Tof; Make_Message('Invoke COMPILE to compile this keystroke macro.'); END; POP_Undo; EXIT: Insert_Mode := T_Insert_Mode; END_MACRO; {end of setup.src}