home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-12 | 52.2 KB | 2,058 lines |
- $MACRO_FILE WINDOW;
- {******************************************************************************
- MULTI-EDIT MACRO FILE WINDOW.SRC
-
- This file contains all of the window oriented macros.
-
- WINMENU - The general purpose window list (menu) routine
- FINDWIN - If the current window is hidden, finds one that isn't
- NEXTWIN - Switches to the next non hidden window.
- LASTWIN - Switches to the preceding non hidden window.
- SWITWIN - The SWITCH WINDOW menu. Uses WINMENU.
- COPYBL - Interwindow copy menu. Uses WINMENU.
- MOVEBL - Interwindow move menu. Uses WINMENU.
- LINKWIN - Link window menu. Uses WINMENU.
- SETBTMS - Determines whether or not a window should have a bottom boarder
- DELWIN - Delete window with verify.
- MAKEWIN - Creates a new window.
- MOD_WIN - Uses MOVE_WIN to modify the current window size
- MOVE_WIN - Moves or resizes windows.
- ZOOM - Replaces the ZOOM macro command.
- SPLITWIN - Creates a new window and splits it vertically or horizontally
- WIN_OP - Performs various window operations.
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- $MACRO WINMENU TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- Name: WINMENU
-
- Description: A general purpose window list (menu) routine
-
- Parameters:
- /WT=<String> The title of the top of the box.
- /WH=<String> The "help" at the bottom of the box.
- /HS=<String> The help index for HELP FILE if F1 is pressed.
- /HE=<Integer> Enables user to hide windows, 0 or 1
- /DB=<Integer> Causes display of only windows with marked blocks, 0 or 1.
- /DC=<Integer> Causes display of the active window with the list, 0 or 1.
- Global_Int('@WINDOW_LIST_MODE@') If <> 0, Causes display format to have the
- window letter first so that the incremental search will key
- off of that instead of the file name.
-
- Returns:
- Return_Int = the number of the chosen window.
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(T_Refresh,
- Display_Current,Display_Blocked_Only,
- Active_Window,Menu_Window,
- Temp_Window,Start_Window,
- Menu_X,Menu_Y,
- Temp_Integer,Active_Line,Global_Hidden,
- Hide_Enable,Letter_First,
- Name_Col,Letter_Col,Attribute_Col,Path_Col,ID_Col,
-
- Start_Window_Id,
- Old_Window_ID,
- Menu_Window_Id,
- Cur_Window_Id );
-
- Def_Str( Temp_String[128], attr_str[40] );
-
- Undo_Stat := False;
-
- Letter_First := (Global_Int('@WINDOW_LIST_MODE@') <> 0);
- Messages := False;
- Push_Labels;
- T_Refresh := Refresh;
- Refresh := False;
- Hide_Enable := Parse_Int('/HE=',MParm_Str);
- Display_Current := Parse_Int('/DC=',MParm_Str);
- Display_Blocked_Only := Parse_Int('/DB=',MParm_Str);
-
- If (Hide_Enable) Then
- Flabel('DelWin',2,$FF);
- Flabel('Save',3,$FF);
- Flabel('HideWn',4,$FF);
- Flabel('HidAll',5,$FF);
- End;
- Flabel('View',6,$FF);
- Menu_X := 1;
- Menu_Y := 3;
- Attribute_Col := 17;
- Path_Col := 41;
- Id_Col := 91;
- IF (Letter_First) THEN
- Letter_Col := 1;
- Name_Col := 3;
- ELSE
- Letter_Col := 14;
- Name_Col := 1;
- END;
- If (Global_Hidden <> 1) Then
- Global_Hidden := False;
- End;
- Active_Window := Window_Id;
- Start_Window_Id := Window_Id;
- Cur_Window_Id := Window_Id;
-
- START_OVER:
- {Find the numerically highest window}
- Switch_Window(Window_Count);
- Error_Level := 0;
- Create_Window;
- IF (Error_Level <> 0) THEN
- Make_Message('Too many windows to run this macro!');
- Error_Level := 0;
- Goto ABORT;
- END;
- Menu_Window := Cur_Window;
- Menu_Window_Id := Window_Id;
- File_Name := 'MEMENU.TMP';
- CALL NO_ERASE_LIST;
-
- {If there are no windows to display, then....}
- IF (C_Line < 2) THEN
- Return_Int := 0;
- Goto END_OF_MAC;
- END;
- CALL Find_Cur_Window_Id;
- Ignore_Case := True;
- Active_Line := C_Line;
-
- DO_MENU:
-
- Temp_Integer := 2;
- Set_Global_Str('@WL1','/T=Select/K1=13/K2=28/R=1/LL=1');
- Set_Global_Str('@WL2','/T=Cancel/K1=27/K2=1/R=0/LL=1');
-
- IF (Hide_Enable) THEN
- Temp_Integer := 7;
- Set_Global_Str('@WL3','/T=Delete/K1=0/K2=60/R=2/FL=Delete');
- Set_Global_Str('@WL4','/T=Save/K1=0/K2=61/R=3/FL=Save');
- Set_Global_Str('@WL5','/T=Hide window/K1=0/K2=62/R=4/FL=HidWin');
- Set_Global_Str('@WL6','/T=Hide all/K1=0/K2=63/R=5/FL=HidAll');
- Set_Global_Str('@WL7','/T=Delete/K1=0/K2=83/R=2/LL=1');
- END;
- ++Temp_Integer;
- Set_Global_Str('@WL' + Str(Temp_Integer),'/T=Preview/K1=0/K2=64/R=6/FL=PrView');
-
- RM('WMENU /DBL=1/X=' + Str(Menu_X) + '/Y=' + Str(Menu_Y) + '/S=' +
- Str(Active_Line) + '/W=78/OR=5/SM=' + Str(Letter_First) + '/EV=@WL/EV#=' + Str(Temp_Integer) + '/T=' +
- Parse_Str('/WT=',MParm_Str));
- Active_Line := C_Line;
-
- IF (Return_Int < 2) THEN
- Goto MENU_EXIT;
- END;
-
- IF (Return_Int = 2) THEN
- {Delete window}
- Call Get_Cur_Window_Id;
- Old_Window_Id := Cur_Window_Id;
- Mark_Pos;
- Eof;
- IF (C_Col = 1) THEN
- Up;
- END;
- Return_Int := (C_Line > 1);
- Goto_Mark;
- IF (Return_Int) THEN
- Switch_Win_Id( Cur_Window_Id );
- RM( 'DELWIN');
- END;
- Switch_Win_Id( Menu_Window_Id );
- Menu_Window := Cur_Window;
-
- IF (Return_Int <> 0) THEN
- Active_Line := C_Line;
- CALL Rebuild_LIST;
- Goto_Line( Active_Line );
- Goto_Col(1);
- IF AT_EOF THEN
- Up;
- END;
- CALL Get_Cur_Window_Id;
- Active_Line := C_Line;
- IF old_Window_Id = Start_Window_Id THEN
- Start_Window_Id := Cur_Window_Id;
- END;
- END;
-
- Goto DO_MENU;
- End;
-
- IF (Return_Int = 3) THEN
- {Save file in window}
- Active_Line := C_Line;
- CALL Get_Cur_Window_Id;
- Switch_Win_Id( Cur_Window_Id );
- RM( 'MEUTIL1^SAVEFILE /R=4/BC=' + str(box_count) );
- Switch_Window(Menu_Window);
- CALL Rebuild_List;
- Goto_Line( Active_Line );
- Goto DO_MENU;
- End;
-
- If (Return_Int = 4) Then
- {Hide a window}
- Active_Line := C_Line;
- CALL Get_Cur_Window_Id;
- Switch_Win_Id( Cur_Window_Id );
- IF (Window_Attr and $01) THEN
- Window_Attr := Window_Attr and $FE;
- Else
- Window_Attr := Window_Attr or $01;
- END;
- CALL Rebuild_List;
- Goto_Line( Active_Line );
- Goto DO_MENU;
- End;
-
- IF (Return_Int = 5) THEN
- Temp_Integer := 1;
- WHILE Temp_Integer < Menu_Window DO
- Switch_Window( temp_integer );
- IF (Window_Attr AND $80) = 0 THEN
- IF (Global_Hidden) THEN
- Window_Attr := Window_Attr and $FE;
- ELSE
- Window_Attr := Window_Attr or $01;
- END;
- END;
- ++Temp_Integer;
- END;
- Global_Hidden := Not(Global_Hidden);
- Switch_Window( Menu_Window );
- Active_Line := C_Line;
- CALL Rebuild_List;
- Goto_Line( Active_Line );
- GOTO Do_Menu;
- END;
-
- IF (Return_Int = 6) THEN
- Call PREVIEW;
- END;
-
- Goto DO_MENU;
-
- MENU_EXIT:
- IF (Return_Int = 1) THEN
- CALL Get_Cur_Window_Id;
- Switch_Win_Id( Cur_Window_Id );
- Active_Window := Cur_Window_Id;
- Return_Int := Cur_Window;
- ELSE
- Active_Window := Start_Window_Id;
- END;
- Goto END_OF_MAC;
-
- PREVIEW:
- CALL Get_Cur_Window_Id;
- Window_Attr := Window_Attr or $81;
- Switch_Win_Id(Cur_Window_Id);
- RM('PreviewWindow');
- IF RETURN_INT THEN
- Cur_Window_Id := Window_Id;
- END;
- Call Find_Cur_Window_Id;
- Active_Line := C_Line;
- RET;
-
-
- REBUILD_LIST:
- Switch_Window( Menu_Window );
- Erase_Window;
-
- No_Erase_List:
- Switch_Window(1);
- Working;
- While (Cur_Window < Menu_Window) Do
- Temp_Window := Cur_Window;
- If (((Display_Current = True) or (Window_Id <> Active_Window)) and
- ((Display_Blocked_Only = False) or (Block_Stat <> False)))
- AND ((window_attr AND $80) = 0) THEN
- Temp_String := ' ';
- Temp_String := Str_Ins(Truncate_Path(File_Name),Temp_String,Name_Col);
- Temp_String := Str_Ins(window_name,Temp_String,Letter_Col);
- Attr_str := '';
-
- { START OF ASV MODIFICATION NO 1 }
- IF (global_int(Truncate_Extension(Truncate_Path(File_Name)) + '.' +
- global_str('autosave_ext'))) THEN
- File_Changed := TRUE;
- END;
- { END OF ASV MODIFICATION NO 1 }
-
- If Read_Only THEN
- Attr_str := 'ReadOnly ';
- ELSIF (File_Changed) THEN
- attr_str := 'Modified ';
- END;
- IF (Link_Stat) THEN
- attr_str := attr_str + 'Linked ';
- END;
- IF (Window_Attr and $01) THEN
- attr_str := attr_str + 'Hidden ';
- END;
- Temp_String := Str_Ins( attr_str, Temp_String, Attribute_Col );
- Temp_String := Str_Ins(Get_Path(File_Name),Temp_String,Path_Col);
- Temp_String := Str_Ins( str( window_id ), Temp_String, Id_Col );
-
- Switch_Window(Menu_Window);
- Put_Line( Shorten_Str(Temp_String) );
- Down;
- End;
- Switch_Window(Temp_Window + 1);
- End;
-
- Switch_Window(Menu_Window);
- RET;
-
-
- GET_Cur_Window_Id:
- Switch_Window( Menu_Window );
- VAL( Cur_Window_Id, Shorten_Str(copy(get_line,Id_Col,4)) );
- RET;
-
- FIND_Cur_Window_Id:
- Switch_Window( Menu_Window );
- TOF;
- FCWN_LOOP:
- VAL( temp_integer, Shorten_Str(copy(get_line,Id_Col,4)) );
- IF (temp_integer <> Cur_Window_Id) AND NOT(AT_EOF) THEN
- DOWN;
- Goto FCWN_LOOP;
- END;
- RET;
-
- END_OF_MAC:
- Refresh := False;
-
- Switch_Win_Id( Menu_Window_Id );
-
- Delete_Window;
-
- ABORT:
- Switch_Win_Id(Start_Window_Id);
- Refresh := T_Refresh;
- Pop_Labels;
- Messages := True;
- Undo_Stat := True;
- exit:
- END_MACRO;
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: PreviewWindow
-
- Description: Allows to preview windows before actually moving into them
- to edit. Called only by WINMENU
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO PreviewWindow;
- Refresh := True;
- Redraw;
- WHILE ((Key1 <> 27) and (Key1 <> 13 )) DO
- Make_Message('|26=switch window <PgUp> <PgDn> <CtrlHome> <CtrlEnd> to browse. <Enter>=select');
- Read_Key;
- IF (Key1 = 0) THEN
- IF (key2 = 250) THEN {process mouse event}
- IF (Mou_Last_X = Win_X2) THEN
- RM('MOUSE^HandleScrollBar');
- ELSE
- RM('Mouse^MouseInWindow');
- IF return_int THEN
- RM('Mouse^MOUSE_MOVE /V=1/H=1');
- END;
- END;
- ELSIF (Key2 = 251) THEN
- IF (Mou_Last_X = Win_X2) THEN
- RM('MOUSE^GotoScrollBar');
- return_int := screen_num;
- ELSE
- RM('Mouse^MouseInWindow');
- IF return_int THEN
- RM('Mouse^MOUSE_MOVE /V=1/H=1');
- END;
- END;
- ELSIF (Key2 = 119) THEN
- Tof;
- ELSIF (Key2 = 73) THEN
- Page_Up;
- ELSIF (Key2 = 117) THEN
- Eof;
- ELSIF (Key2 = 81) THEN
- Page_Down;
- ELSIF (Key2 = 77) THEN
- RM('NEXTWIN');
- REDRAW;
- ELSIF (Key2 = 75) THEN
- RM('LASTWIN');
- REDRAW;
- END;
- PREVIEW_EXIT:
- END;
- END;
-
- RETURN_INT := (Key1 = 13);
- Refresh := False;
- Make_Message('');
-
- END_MACRO;
-
- $MACRO FINDWIN;
- {******************************************************************************
- MULTI-EDIT MACRO FINDWIN
- Name: FINDWIN
-
- Description: Finds the next non hidden window
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(JX);
-
- JX := Cur_Window;
- While ((Window_Attr and $81) <> 0) DO
- switch_window(cur_window + 1);
- if jx = cur_window then
- IF (window_attr and $80) = 0 THEN
- Window_Attr := Window_Attr and $FE;
- Redraw;
- END;
- goto exit;
- end;
- end;
-
- EXIT:
-
- END_MACRO;
-
- $MACRO NEXTWIN FROM EDIT TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: NEXTWIN
-
- Description: Switch to next window
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- DEF_INT( tr, old_win, nw );
- old_win := cur_window;
- TR := REFRESH;
- REFRESH := FALSE;
- SWITCH_WINDOW(CUR_WINDOW + 1);
- RM( 'FINDWIN' );
- nw := cur_window;
- switch_window(old_win);
- REFRESH := TRUE;
- switch_window(nw);
- refresh := tr;
- END_MACRO;
-
- $MACRO LASTWIN FROM EDIT TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: NEXTWIN
-
- Description: Switch to last window
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(JX);
-
- DEF_INT( tr, nw, ow );
- TR := REFRESH;
- ow := cur_window;
- nw := cur_window;
- REFRESH := FALSE;
- SWITCH_WINDOW(CUR_WINDOW - 1);
- JX := Cur_Window;
- While ((Window_Attr and $81) <> 0) DO
- switch_window(cur_window - 1);
- if jx = cur_window then
- goto exit;
- end;
- end;
- nw := cur_window;
- EXIT:
- SWITCH_WINDOW( ow );
- REFRESH := TRUE;
- SWITCH_WINDOW( nw );
- REFRESH := TR;
- END_MACRO;
-
- $MACRO ADJACENT_WIN TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: ADJACENT_WIN
-
- Description: On a split window, prompts for and switches to an adjacent
- window.
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int(Active_Window,New_Window,Active_Screen,Active_X1,Active_Y1,Active_X2,
- Active_Y2,T_Refresh,Common,T_Common,Ev_Count);
-
- T_Refresh := Refresh;
- Refresh := False;
- Active_Window := Window_Id;
- Active_Screen := Screen_Num;
- New_Window := Active_Window;
- Active_X1 := Win_X1;
- Active_Y1 := Win_Y1;
- Active_X2 := Win_X2;
- Active_Y2 := Win_Y2;
- Common := 0;
- T_Common := 0;
-
- RM('SCREEN_SHARE');
-
- Put_Box(26,2, 55, 11, 0, m_b_color, 'Switch to window', true);
-
- IF (Return_Int = 0) THEN
- {We stuck the checking of return_int from SCREEN_SHARE down here to minimize
- the delay between the PUT_BOX and this message}
- RM('MEERROR^Beeps /C=1');
- Write('No adjacent windows',30,5,0,m_b_color);
- Write('to switch to!',33,6,0,m_b_color);
- Write('PRESS ANY KEY' ,34,10,0,m_b_color);
- Read_Key;
- Kill_Box;
- Goto EXIT;
- END;
-
- Ev_Count := 0;
- IF (Active_Y1 > Min_Window_Row) THEN
- {Enable up movement}
- ++Ev_Count;
- Draw_Char(24, 39, 5, m_t_color, 1 );
- Set_Global_Str('@WSEV#' + Str(Ev_Count), '/T=/KC=<UP>/K1=0/K2=72/R=3/W=4/X=38/Y=4');
- END;
- IF (Active_Y2 < Max_Window_Row) THEN
- {Enable down movement}
- ++Ev_Count;
- Draw_Char(25, 39, 7, m_t_color, 1 );
- Set_Global_Str('@WSEV#' + Str(Ev_Count), '/T=/KC=<DOWN>/K1=0/K2=80/R=4/W=6/X=37/Y=8');
- END;
- IF (Active_X1 > 1) THEN
- {Enable left movement}
- ++Ev_Count;
- Draw_Char(27, 36, 6, m_t_color, 1 );
- Set_Global_Str('@WSEV#' + Str(Ev_Count), '/T=/KC=<LEFT>/K1=0/K2=75/R=2/W=6/X=29/Y=6');
- END;
- IF (Active_X2 < Screen_Width) THEN
- {Enable right movement}
- ++Ev_Count;
- Draw_Char(26, 42, 6, m_t_color, 1 );
- Set_Global_Str('@WSEV#' + Str(Ev_Count), '/T=/KC=<RIGHT>/K1=0/K2=77/R=1/W=7/X=44/Y=6');
- END;
- ++Ev_Count;
- Set_Global_Str('@WSEV#' + Str(Ev_Count), '/T=Cancel/KC=<ESC>/K1=27/K2=1/R=0/W=11/X=35/Y=10');
- RM('CheckEvents /M=2/G=@WSEV#/#=' + Str(Ev_Count));
- Read_Key;
-
- if (key1 = 0) AND (key2 = 250) THEN
- RM('CheckEvents /G=@WSEV#/M=1/#=' + Str(Ev_Count));
- else
- RM('CheckEvents /G=@WSEV#/M=0/#=' + Str(Ev_Count));
- end;
- Kill_Box;
- IF return_int <> 0 THEN
- return_int := parse_int('/R=', return_str);
- END;
-
- SEEK_WINDOW:
- Switch_Window(Cur_Window + 1);
- IF (Window_Id <> Active_Window) THEN
- IF (Screen_Num = Active_Screen) THEN
-
- IF (Return_Int = 1) THEN
- {Move to window to the right}
- IF (Win_X2 > Active_X2) THEN
- {Determine if this window is right of active window}
- IF (Win_X1 <= Active_X2) THEN
- {Determine if this window's left border is at or left of active window's right
- border.}
- Goto CHECK_COMMON_VERTIC;
- END;
- END;
- END;
- IF (Return_Int = 2) THEN
- {Move to window to the left}
- IF (Win_X1 < Active_X1) THEN
- {Determine if this window is left of active window}
- IF (Win_X2 >= Active_X1) THEN
- {Determine if this window's right border is at or right of active window's left
- border.}
- Goto CHECK_COMMON_VERTIC;
- END;
- END;
- END;
- IF (Return_Int = 3) THEN
- {Move to window above}
- IF (Win_Y1 < Active_Y1) THEN
- {Determine if this window is above active window}
- IF (Win_Y2 >= Active_Y1) THEN
- {Determine if this window's lower border is at or below active window's upper
- border.}
- Goto CHECK_COMMON_HORIZ;
- END;
- END;
- END;
- IF (Return_Int = 4) THEN
- {Move to window below}
- IF (Win_Y2 > Active_Y2) THEN
- {Determine if this window is below active window}
- IF (Win_Y1 <= Active_Y2) THEN
- {Determine if this window's upper border is at or above active window's lower
- border.}
- Goto CHECK_COMMON_HORIZ;
- END;
- END;
- END;
- END;
- Goto SEEK_WINDOW;
- END;
- Goto EXIT;
-
- CHECK_COMMON_HORIZ:
- T_Common := Active_X2 - Active_X1;
- IF (Win_X1 > Active_X1) THEN
- T_Common := T_Common - (Win_X1 - Active_X1);
- END;
- IF (Win_X2 < Active_X2) THEN
- T_Common := T_Common - (Active_X2 - Win_X2);
- END;
- Goto CHECK_COMMON;
-
- CHECK_COMMON_VERTIC:
- T_Common := Active_Y2 - Active_Y1;
- IF (Win_Y1 > Active_Y1) THEN
- T_Common := T_Common - (Win_Y1 - Active_Y1);
- END;
- IF (Win_Y2 < Active_Y2) THEN
- T_Common := T_Common - (Active_Y2 - Win_Y2);
- END;
-
- CHECK_COMMON:
- IF (T_Common > Common) THEN
- {See if this window has more common width with the active than any previously
- looked at window}
- Common := T_Common;
- New_Window := Window_Id;
- END;
- Goto SEEK_WINDOW;
-
- EXIT:
- IF (Switch_Win_Id(New_Window)) THEN
- END;
- Refresh := T_Refresh;
- Redraw;
- END_MACRO;
-
- $MACRO SCREEN_SHARE TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: SCREEN_SHARE
-
- Description: Determines if the current window's screen is shared by another
- window.
-
- Returns:
- Return_Int := True if the screen is shared
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int(Active_Window,Active_Screen,T_refresh);
-
- T_refresh := refresh;
- refresh := false;
- Return_Int := 0;
- Active_Window := Window_Id;
- Active_Screen := Screen_Num;
-
- IF (Screen_Num = 0) THEN
- Goto EXIT;
- END;
-
- CHECK_SCREEN_SHARING:
- Switch_Window(Cur_Window + 1);
- IF (Window_Id <> Active_Window) THEN
- IF (Screen_Num = Active_Screen) THEN
- Return_Int := 1;
- Goto EXIT;
- END;
- Goto CHECK_SCREEN_SHARING;
- END;
-
- EXIT:
- Switch_Win_Id(Active_Window);
- refresh := t_refresh;
- END_MACRO;
-
- $MACRO SWITWIN TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: SWITWIN
-
- Description: Brings up a menu of all windows for the purpose of switching
- directly to a new window without toggling through those in
- between
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- RM( 'WINMENU /WT=WINDOW LIST/WH=Press <ENTER> to select window, <ESC> to return to original window./HS=WINLIST/HE=1/DB=0/DC=1' + MParm_Str);
- If (Return_Int <> 0) Then
- Switch_Window(Return_Int);
- End;
- Window_Attr := Window_Attr and $FE;
- redraw;
- END_MACRO;
-
- $MACRO COPYBL TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: COPYBL
-
- Description: Brings up a menu of all windows who have a block defined for
- inter-window block copying
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- RM( 'WINMENU /WT=INTER-WINDOW COPY/WH=Select window to copy from and press <ENTER>, or <ESC> to abort/HS=BLOCKWIN/HE=0/DB=1/DC=0' + MParm_Str);
- Window_Attr := Window_Attr and $FE;
- If (Return_Int <> 0) Then
- Window_Copy(Return_Int);
- End;
- END_MACRO;
-
- $MACRO MOVEBL TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: MOVEBL
-
- Description: Brings up a menu of all windows who have a block defined for
- inter-window block moving
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- RM( 'WINMENU /WT=INTER-WINDOW MOVE/WH=Select window to move from and press <ENTER>, or <ESC> to abort/HS=BLOCKWIN/HE=0/DB=1/DC=0' + MParm_Str);
- Window_Attr := Window_Attr and $FE;
- If (Return_Int <> 0) Then
- Window_Move(Return_Int);
- End;
- END_MACRO;
-
- $MACRO LINKWIN TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: LINKWIN
-
- Description: Brings up a menu of all windows for linking
-
- Parameters:
- /X= X coordinate for the menu box
- /Y= Y coordinate for the menu box
- /BC= Number of boxes to kill upon exit
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(jx, mr);
-
- MR := Parse_Int('/Y=',MParm_Str);
- IF MR = 0 THEN
- MR := 2;
- END;
- IF (File_Changed) and (link_stat = 0) THEN
- RM('USERIN^CHECKFILE /H=WINLINK/Y=' + str(mr) + '/X=' +
- parse_str('/X=',mparm_str));
- IF return_int <= 0 THEN
- Return_Int := 0;
- GOTO Exit;
- END;
- END;
-
- jx := Parse_Int('/BC=',mparm_str);
- while box_count > jx do
- kill_box;
- end;
-
- RM( 'WINMENU /WT=LINK WINDOW/WH=Select window to link to and press <ENTER>, or <ESC> to abort/HS=WINLINK/HE=0/DB=0/DC=0' + MParm_Str);
- If (Return_Int <> 0) Then
- Link_Window(Return_Int);
- Return_Int := 1;
- RM('WINDOW^SetWindowNames');
- End;
- Window_Attr := Window_Attr and $FE;
-
- return_int := 100;
- EXIT:
-
- END_MACRO;
-
- $MACRO SETBTMS TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: SETBTMS
-
- Description: Determines if a window should have a bottom line or not.
-
- Parameters:
- /SN= Screen number(Screen_Num) of window to check
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int(jx, ts, found_count, t_win);
- def_int( mx1, mx2, my1, my2 );
-
- t_win := cur_window;
- ts := parse_int('/SN=', mparm_str);
- found_count := 0;
- mx1 := win_x1; mx2 := win_x2; my1 := win_y1; my2 := win_y2;
- if ts <> 0 then
- jx := 0;
- while jx < window_count do
- ++jx;
- switch_window(jx);
- if (screen_num = ts) then
- IF (win_y1 = my2) THEN
- IF (win_x1 < mx2) AND (win_x2 > mx1) THEN
- ++found_count;
- goto found_exit;
- END;
- END;
- END;
- END;
- END;
-
- found_exit:
- switch_window( t_win );
- w_bottom_line := (found_count = 0);
- END_MACRO;
-
- $MACRO DELWIN TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: DELWIN
-
- Description: Deletes a window after checking to see if file has been saved
-
- Parameters:
- /X= X coordinate for the menu box
- /Y= Y coordinate for the menu box
- /BC= Number of boxes leave upon exit
- /NODEL=1 Perform all operations as if the window was
- deleted (like resizing other windows) but do not
- actually delete the window.
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- Def_Int(jx, mr, x1,y1, x2,y2, ts, new_win, new_ts, tr);
- def_int( w_id, mx1, mx2, my1, my2, no_del );
-
- Return_Int := False;
- tr := refresh;
- MR := Parse_Int('/Y=',MParm_Str);
- IF MR = 0 THEN
- MR := 2;
- END;
- new_win := 0;
- IF (File_Changed) and (link_stat =0) THEN
- RM('USERIN^CHECKFILE /H=WINDELETE/Y=' + str(mr) +
- '/X=' + parse_str('/X=', mparm_str));
- IF return_int <= 0 THEN
- return_int := false;
- GOTO Exit;
- END;
- END;
- jx := Parse_Int('/BC=',mparm_str);
- while box_count > jx do
- kill_box;
- end;
- Return_Int := True;
- WORKING;
- IF global_str('!WINZOOM#' + str(window_id)) <> '' THEN
- RM('ZOOM');
- END;
- x1 := win_x1;
- y1 := win_y1;
- x2 := win_x2;
- y2 := win_y2;
- mx1 := screen_width;
- mx2 := 0;
- my1 := screen_length;
- my2 := 0;
- ts := screen_num;
- w_id := window_id;
- Refresh := False;
-
- IF (Cur_Window = Window_Count) THEN
- switch_window( cur_window - 1);
- new_win := window_id;
- switch_window( cur_window + 1);
- ELSE
- switch_window( cur_window + 1);
- new_win := window_id;
- switch_window( cur_window - 1);
- END;
- no_del := parse_int('/NODEL=', mparm_str);
- IF no_del = 0 THEN
- set_global_str('!WINZOOM#' + str(window_id), '');
- DELETE_WINDOW;
- END;
- new_ts := screen_num;
- jx := 0;
- refresh := false;
- if ts <> 0 then
- jx := 0;
- while jx < window_count do
- ++jx;
- switch_window(jx);
- if (screen_num = ts) AND (window_id <> w_id) then
- if (y2 = win_y1) and (x1 <= win_x1) and (x2 >= win_x2) then
- new_win := window_id;
- size_window( win_x1, y1, win_x2, win_y2);
- if (x1 = win_x1) then
- x1 := win_x2;
- end;
- if x2 = win_x2 then
- x2 := win_x1;
- end;
- if x2 < x1 then
- x2 := 0;
- x1 := 0;
- y2 := y1;
- end;
- end;
- if (y1 = win_y2) and (x1 <= win_x1) and (x2 >= win_x2) then
- new_win := window_id;
- size_window( win_x1, win_y1, win_x2, y2);
- if (x1 = win_x1) then
- x1 := win_x2;
- end;
- if x2 = win_x2 then
- x2 := win_x1;
- end;
- if x2 < x1 then
- x2 := 0;
- x1 := 0;
- y1 := y2;
- end;
- end;
- if (x1 = win_x2) and (y1 <= win_y1) and (y2 >= win_y2) then
- new_win := window_id;
- size_window( win_x1, win_y1, x2, win_y2);
- if (y1 = win_y1) then
- y1 := win_y2;
- end;
- if y2 = win_y2 then
- y2 := win_y1;
- end;
- if y2 < y1 then
- y2 := 0;
- y1 := 0;
- x1 := x2;
- end;
- end;
- if (x2 = win_x1) and (y1 <= win_y1) and (y2 >= win_y2) then
- new_win := window_id;
- size_window( x1, win_y1, win_x2, win_y2);
- if (y1 = win_y1) then
- y1 := win_y2;
- end;
- if y2 = win_y2 then
- y2 := win_y1;
- end;
- if y2 < y1 then
- y2 := 0;
- y1 := 0;
- x2 := x1;
- end;
- end;
- if win_x1 < mx1 then
- mx1 := win_x1;
- end;
- if win_x2 > mx2 then
- mx2 := win_x2;
- end;
- if win_y1 < my1 then
- my1 := win_y1;
- end;
- if win_y2 > my2 then
- my2 := win_y2;
- end;
- end;
- end;
- jx := 0;
- while jx < window_count do
- ++jx;
- switch_window(jx);
- if (screen_num = ts) then
- w_bottom_line := (win_y2 >= my2);
- end;
- end;
- end;
-
- out:
- IF no_del THEN
- switch_win_id( w_id );
- ELSE
- if switch_win_id(new_win) then end;
- RM( 'FINDWIN' );
- IF (window_attr AND $80) <> 0 THEN
- RM('CREATEWINDOW');
- RM('EXTSETUP /PRE=1');
- END;
- RM( 'WINDOW^SetWindowNames');
- END;
- return_int := 100;
- refresh := TR;
- New_Screen;
- EXIT:
- END_MACRO;
-
- $MACRO MAKEWIN TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
- Name: MAKEWIN
-
- Description: Creates a new window after checking to see if the window limit
- has been reached
-
- Parameters:
- /NL=1 Will not load a file or attempt a link. Use this if you
- just want to create a window with a window name and you'll
- take care of loading a file yourself.
-
- /L=1 Will cause the new window to be linked to the
- original window if the file is already loaded AND
- the user has requested the file NOT be reloaded.
-
- /NC=1 Will bypass the creation of the window, and just prompt for
- loading a file and taking care of linking if the file is already
- loaded.
-
- Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
-
- def_int( tw1, tw2, jx,nc );
-
- If Window_Count >= 100 THEN
- Error_Level := 1001;
- Goto Exit;
- END;
- nc := parse_int('/NC=', mparm_str);
- refresh := FALSE;
- IF nc = 0 THEN
- tw2 := window_id;
- RM('CreateWindow');
- tw1 := cur_window;
- switch_win_id( tw2);
- refresh := true;
- switch_window( tw1 );
- tw1 := window_id;
- RM('EXTSETUP /PRE=1');
- ELSE
- tw1 := window_id;
- END;
- IF (Parse_Int('/NL=',MParm_Str)) THEN
- Goto NL_EXIT;
- END;
- Bypass_Create:
- RM('MEUTIL1^LOADFILE /X=' + Str(win_x1) + '/Y=' + str(win_y1));
- tw2 := window_id;
- if tw2 <> tw1 then
- refresh := false;
- jx := cur_window;
- if switch_win_id( tw1 ) then
- if caps(file_name) = '?NO-FILE?' then
- IF parse_int('/L=',mparm_str) THEN
- link_window( jx );
- make_message('Window linked.');
- ELSIF nc = 0 THEN
- delete_window;
- new_screen;
- if switch_win_id( tw2 ) then
- end;
- END;
- end;
- end;
- end;
- NL_EXIT:
- RM('WINDOW^SetWindowNames');
- Exit:
- END_MACRO;
-
- $MACRO MOD_WIN TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- NAME: MOD_WIN
-
- DESCRIPTION: Replaces the MODIFY_WINDOW macro command.
-
- /MS= Enables mouse support
- /MM= If 0, resize window. If 1, move window.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int( x1, x2, y1, y2, jx, old_refresh, tw, ts );
- def_int( nx1, nx2, ny1, ny2, w_id, jx, mouse_move, mm );
-
- def_int( ux1, ux2, uy1, uy2, move_mode, screen_share_count );
- def_str( sx1[20], sx2[20], sy1[20], sy2[20] );
-
- ts := screen_num;
- old_refresh := refresh;
- refresh := false;
- tw := cur_window;
- x1 := win_x1;
- y1 := win_y1;
- x2 := win_x2;
- y2 := win_y2;
-
-
- ux1 := 0;
- ux2 := 0;
- uy1 := 0;
- uy2 := 0;
- sx1 := '';
- sx2 := '';
- sy1 := '';
- sy2 := '';
- mouse_move := Parse_Int('/MS=', mparm_str);
- move_mode := Parse_Int('/MM=', mparm_str);
-
- screen_share_count := 0;
- jx := 0;
- IF screen_num <> 0 THEN
- while jx < window_count do
- ++jx;
- switch_window(jx);
- if screen_num = ts then
- ++screen_share_count;
- if (win_x2 = x1) then
- if (win_y1 < y2) and (win_y2 > y1) then
- if (win_y1 < y1) or (win_y2 > y2) then
- ux1 := 1;
- else
- sx1 := sx1 + char(cur_window);
- end;
- end;
- end;
- if (win_x1 = x2) then
- if (win_y1 < y2) and (win_y2 > y1) then
- if (win_y1 < y1) or (win_y2 > y2) then
- ux2 := 1;
- else
- sx2 := sx2 + char(cur_window);
- end;
- end;
- end;
- if (win_y2 = y1) then
- if (win_x1 < x2) and (win_x2 > x1) then
- if (win_x1 < x1) or (win_x2 > x2) then
- uy1 := 1;
- else
- sy1 := sy1 + char(cur_window);
- end;
- end;
- end;
- if (win_y1 = y2) then
- if (win_x1 < x2) and (win_x2 > x1) then
- if (win_x1 < x1) or (win_x2 > x2) then
- uy2 := 1;
- else
- sy2 := sy2 + char(cur_window);
- end;
- end;
- end;
- end;
- end;
- END;
-
- switch_window(tw);
-
- IF (sx1 <> '') OR (sx2 <> '') OR (Sy1 <> '') OR (sy2 <> '') THEN
- ux1 := (sx1 = '');
- ux2 := (sx2 = '');
- uy1 := (sy1 = '');
- uy2 := (sy2 = '');
- END;
- RM('MOVE_WIN /M=1/X1=' + str(win_x1)+'/Y1=' + Str(win_y1) + '/X2=' +
- Str(win_x2) + '/Y2=' + Str(win_y2) + '/MS=' + str(mouse_move) +
- '/MX1=' + str( (Window_Attr AND $40) <> 0) + '/MY1=' + Str(Min_Window_Row) + '/MX2=' +
- Str(Screen_Width + ((Window_Attr AND $40) = 0)) + '/MY2=' + Str(Max_Window_Row) +
- '/MM=' + str(mouse_move) +
- '/UX1=' + str(ux1) +
- '/UX2=' + str(ux2) +
- '/UY1=' + str(uy1) +
- '/UY2=' + str(uy2) + '/K=' + str((move_mode = 0))
- );
- return_int := 1;
- refresh := false;
- Size_Window(Parse_Int('/X1=',Return_Str),Parse_Int('/Y1=',Return_Str),
- Parse_Int('/X2=',Return_Str),Parse_Int('/Y2=',Return_Str));
-
- while svl(sx1) > 0 do
- switch_window( ascii(copy(sx1,1,1)));
- sx1 := str_del(sx1,1,1);
- size_window(win_x1,win_y1,Parse_Int('/X1=', return_str), win_y2);
- end;
- while svl(sx2) > 0 do
- switch_window( ascii(copy(sx2,1,1)));
- sx2 := str_del(sx2,1,1);
- size_window(Parse_Int('/X2=', return_str),win_y1,win_x2, win_y2);
- end;
- while svl(sy1) > 0 do
- switch_window( ascii(copy(sy1,1,1)));
- sy1 := str_del(sy1,1,1);
- size_window(win_x1,win_y1,win_x2, Parse_Int('/Y1=',return_str));
- end;
- while svl(sy2) > 0 do
- switch_window( ascii(copy(sy2,1,1)));
- sy2 := str_del(sy2,1,1);
- size_window(win_x1,Parse_Int('/Y2=', return_str),win_x2, win_y2);
- end;
- RM('setbtms /SN=' + str(ts));
- switch_window(tw);
- refresh := true;
- IF NOT( virtual_display ) THEN
- New_Screen;
- END;
- END_MACRO;
-
- $MACRO MOVE_WIN FROM ALL TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: Move_Win
-
- Description: Used for moving a window without changing it's shape.
-
- Paramters: /X1= Current upper left column
- /Y1= Current upper left row
- /X2= Current lower right column
- /Y2= Current lower right row
- /MX1= Mininum upper left column
- /MX2= Maximum upper left column
- /MY1= Mininum lower right row
- /MY2= Maximum lower right row
- /UX1= If 1, inhibits movement of top window border
- /UX2= If 1, inhibits movement of bottom window border
- /UY1= If 1, inhibits movement of left window border
- /UY2= If 1, inhibits movement of right window border
- /MM= 0 = Move whole window
- 1 = Move upper left corner
- 2 = Move upper right corner
- 3 = Move lower left corner
- 4 = Move lower right cornter
- /M=1 Use virtual screen moves. This is available ONLY when
- sizing a text window in EDIT MODE.
- /K=1 Use keyboard mode
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int( x1, x2, y1, y2, min_x, max_x, min_y, max_y,
- ox1, oy1, ox2, oy2, mx, my, o_bl,
- w, h, t_int, old_attr, move_count, mmode, t_s_color, t_b_color, shift_stat );
- def_int( mou_orig_x, mou_orig_y, mou_orig_x2, mou_orig_y2, k1, k2,
- mm, ux1, ux2, uy1, uy2, min_width, min_height, use_key );
-
- working;
-
- { set_global_int('MENU_LEVEL', global_int('MENU_LEVEL') + 1);}
-
- mmode := parse_int('/M=', mparm_str ) AND virtual_display AND (mode = EDIT);
- use_key := parse_int('/K=', mparm_str );
-
- Min_X := Parse_Int('/MX1=',MParm_Str);
- IF ((Min_X < 0) or (Min_X > (Screen_Width + 1))) THEN
- Min_X := 0;
- END;
- Min_Y := Parse_Int('/MY1=',MParm_Str);
- IF ((Min_Y < 0) or (Min_Y > (Screen_Length + 1))) THEN
- Min_Y := 0;
- END;
- Max_X := Parse_Int('/MX2=',MParm_Str);
- IF ((Max_X < 1) or (Max_X > (Screen_Width + 1))) THEN
- Max_X := Screen_Width + 1;
- END;
- Max_Y := Parse_Int('/MY2=',MParm_Str);
- IF ((Max_Y < 1) or (Max_Y > (Screen_Length + 1))) THEN
- Max_Y := Screen_Length + 1;
- END;
-
- X1 := Parse_Int('/X1=',MParm_Str);
- IF ((X1 < Min_X) or (X1 > (Max_X - 1))) THEN
- X1 := Min_X;
- END;
- Y1 := Parse_Int('/Y1=',MParm_Str);
- IF ((Y1 < Min_Y) or (Y1 > (Max_Y - 1))) THEN
- Y1 := Min_Y;
- END;
- X2 := Parse_Int('/X2=',MParm_Str);
- IF ((X2 < (Min_X + 1)) or (X2 > Max_X)) THEN
- X2 := Max_X;
- END;
- Y2 := Parse_Int('/Y2=',MParm_Str);
- IF ((Y2 < (Min_Y + 1)) or (Y2 > Max_Y)) THEN
- Y2 := Max_Y;
- END;
-
- MIN_HEIGHT := parse_int('/H=', mparm_str );
- IF min_height = 0 THEN
- min_height := 1;
- END;
- MIN_WIDTH := parse_int('/W=', mparm_str );
- IF min_width = 0 THEN
- min_width := 2;
- END;
-
- ox1 := x1;
- oy1 := y1;
- ox2 := x2;
- oy2 := y2;
-
- ux1 := Parse_Int( '/UX1=', mparm_str);
- ux2 := Parse_Int( '/UX2=', mparm_str);
- uy1 := Parse_Int( '/UY1=', mparm_str);
- uy2 := Parse_Int( '/UY2=', mparm_str);
-
-
- mm := Parse_Int('/MM=', mparm_str);
-
- w := x2 - x1;
- h := y2 - y1;
- IF NOT(use_key) THEN
- mou_orig_x := mou_last_x - x1;
- mou_orig_y := mou_last_y - y1;
- mou_orig_x2 := x2 - mou_last_x;
- mou_orig_y2 := y2 - mou_last_y;
- IF mm = 0 THEN
- Mou_Set_Limits(min_x + mou_orig_x,min_y,max_x - w + mou_orig_x, max_y - h);
- ELSIF mm = 1 THEN
- ux2 := 1;
- uy2 := 1;
- ELSIF mm = 2 THEN
- ux1 := 1;
- uy2 := 1;
- ELSIF mm = 3 THEN
- ux2 := 1;
- uy1 := 1;
- ELSIF mm = 4 THEN
- ux1 := 1;
- uy1 := 1;
- END;
- END;
- t_int := box_count;
-
- set_virtual_display;
- IF mmode THEN
- old_attr := window_attr;
- window_attr := 1;
- o_bl := w_bottom_line;
- w_bottom_line := true;
- refresh := true;
- new_screen;
- override_screen_seg;
- save_box( 1, 1, screen_width, screen_length );
- reset_screen_seg;
- Clear_Virtual_Display;
- t_b_color := b_color;
- t_s_color := s_color;
- s_color := error_color;
- b_color := error_color;
- redraw;
- window_attr := old_attr;
- update_virtual_display;
- ELSE
- update_status_line;
- save_box( 1, 1, screen_width, screen_length );
- END;
-
- IF use_key THEN
- goto key_loop;
- END;
-
- move_loop:
- call resize;
- move_loop2:
- mx := mou_last_x;
- my := mou_last_y;
- Mou_Check_Status;
- IF (Mou_Last_Status and 1) THEN
- IF (mou_last_x <> mx) OR (mou_last_y <> my) THEN
- IF (mm = 0) THEN
- IF (((X1 + mou_orig_x) <> Mou_Last_X) or (Y1 <> Mou_Last_Y)) THEN
- X1 := Mou_Last_X - mou_orig_x;
- Y1 := Mou_Last_Y;
- x2 := x1 + w;
- y2 := y1 + h;
- goto move_loop;
- END;
- ELSIF (mm = 1) THEN
- IF (((X1 + mou_orig_x) <> Mou_Last_X) or ((Y1 + mou_orig_y) <> Mou_Last_Y)) THEN
- X1 := Mou_Last_X - mou_orig_x;
- Y1 := Mou_Last_Y - mou_orig_y;
- call clip_x1;
- call clip_y1;
- goto move_loop;
- END;
- ELSIF (mm = 2) THEN
- IF (((X2 - mou_orig_x2) <> Mou_Last_X) or ((Y1 + mou_orig_y) <> Mou_Last_Y)) THEN
- X2 := Mou_Last_X + mou_orig_x2;
- Y1 := Mou_Last_Y - mou_orig_y;
- call clip_x2;
- call clip_y1;
- goto move_loop;
- END;
- ELSIF (mm = 3) THEN
- IF (((X1 + mou_orig_x) <> Mou_Last_X) or ((Y2 - mou_orig_y2) <> Mou_Last_Y)) THEN
- X1 := Mou_Last_X - mou_orig_x;
- Y2 := mou_orig_y2 + mou_last_y;
- call clip_x1;
- call clip_y2;
- goto move_loop;
- END;
- ELSIF (mm = 4) THEN
- IF (((X2 - mou_orig_x2) <> Mou_Last_X) or ((Y2 - mou_orig_y2) <> Mou_Last_Y)) THEN
- X2 := Mou_Last_X + mou_orig_x2;
- Y2 := mou_orig_y2 + mou_last_y;
- call clip_x2;
- call clip_y2;
- goto move_loop;
- END;
- END;
- END;
- goto move_loop2;
- END;
- goto move_done;
-
-
- key_loop:
- call resize;
- key_loop2:
- loopxxx:
- read_key;
- K1 := Key1;
- K2 := Key2;
-
- {This is to take care of key type ahead filling up the buffer}
- IF (Check_Key) THEN
- IF (key1 = k1) AND (key2 = k2) THEN
- goto loopxxx;
- ELSE
- push_key(key1,key2);
- END;
- END;
- R_AX := $0200;
- INTR($16);
- Shift_Stat := ((R_AX and $0003) > 0);
-
- IF (k1 = 0) OR ((k1 > 48) AND (k1 < 58)) THEN
- IF (k1 > 48) AND (k1 < 58) THEN
- shift_stat := TRUE;
- END;
- IF (k2 = 75) THEN
- IF (Shift_Stat) THEN
- --x2;
- call clip_x2;
- ELSIF (x1 > min_x) THEN
- --x1;
- --x2;
- END;
- ELSIF (k2 = 77) AND (x2 < max_x) THEN
- IF (Shift_Stat) THEN
- ++x2;
- ELSE
- ++x1;
- ++x2;
- END;
- ELSIF (k2 = 72) THEN
- IF (Shift_Stat) THEN
- --y2;
- call clip_y2;
- ELSIF (y1 > min_y) THEN
- --y1;
- --y2;
- END;
- ELSIF (k2 = 80) THEN
- IF (Shift_Stat) THEN
- IF y2 < max_y THEN
- ++y2;
- END;
- ELSE
- IF NOT(uy2) THEN
- IF y2 < max_y THEN
- ++y2;
- ++y1;
- END;
- ELSE
- ++y1;
- call clip_y1;
- END;
- END;
- ELSIF (k1 = 0) AND (k2 = 239) THEN
- goto key_move_done;
- ELSE
- goto key_loop2;
- END;
- goto key_loop;
- ELSIF (k1 = 27) OR (k1 = 13) THEN
- goto key_move_done;
- END;
- goto key_loop2;
-
- key_move_done:
- {turn scrolllock off}
- poke( 0, $417, peek(0, $417) and $EF );
- goto move_done;
-
- resize:
- Call Check_Width;
- Call Check_Height;
- IF mmode THEN
- size_window( x1, y1, x2, y2 );
- restore_box;
- redraw;
- Update_Virtual_Window( 1, 1, screen_width, screen_length );
- ELSE
- restore_box;
- draw_outline(x1,y1,x2,y2,Error_Color);
- update_virtual_window( 1, 1, screen_width, screen_length );
- clear_virtual_display;
- END;
- ret;
-
- move_done:
- while box_count > t_int do
- kill_box;
- END;
- Mou_Set_Limits( 1, 1, Screen_Width, Screen_Length );
- Return_Str :=
- '/X1=' + str(x1) +
- '/X2=' + str(x2) +
- '/Y1=' + str(Y1) +
- '/Y2=' + str(Y2);
- RETURN_INT := 1;
- IF mmode THEN
- w_bottom_line := o_bl;
- b_color := t_b_color;
- s_color := t_s_color;
- redraw;
- END;
- UPDATE_STATUS_LINE;
- update_virtual_display;
- reset_virtual_display;
- goto exit;
-
- check_width:
- IF ux1 THEN
- x1 := ox1;
- END;
- IF ux2 THEN
- x2 := ox2;
- END;
- w := x2 - x1;
- ret;
-
- check_height:
- IF uy1 THEN
- y1 := oy1;
- END;
- IF uy2 THEN
- y2 := oy2;
- END;
- h := y2 - y1;
- ret;
-
-
- clip_x1:
- IF (x1 > (x2 - min_width)) THEN
- x1 := x2 - min_width;
- END;
- IF (x1 < min_x) THEN
- x1 := min_x;
- END;
- ret;
-
- clip_x2:
- IF (x2 < (x1 + min_width)) THEN
- x2 := x1 + min_width;
- END;
- IF (x2 > max_x) THEN
- x2 := max_x;
- END;
- ret;
-
- clip_y1:
- IF (y1 > (y2 - min_height)) THEN
- y1 := y2 - min_height;
- END;
- IF (y1 < min_y) THEN
- y1 := min_y;
- END;
- ret;
-
- clip_y2:
- IF (y2 < (y1 + min_height)) THEN
- y2 := y1 + min_height;
- END;
- IF (y2 > max_y) THEN
- y2 := max_y;
- END;
- ret;
-
- exit:
- { set_global_int('MENU_LEVEL', global_int('MENU_LEVEL') - 1);}
- END_MACRO;
-
- $MACRO ZOOM TRANS;
- {******************************************************************************
- MULTI-EDIT MACRO
-
- NAME: ZOOM
-
- DESCRIPTION: Replaces the ZOOM macro command.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int( old_refresh, osn, jx, owin, t_id, min, x, y );
- def_str(tstr[80]);
-
- old_refresh := refresh;
- refresh := false;
- min := Parse_Int('/MINIMIZE=', mparm_str );
- tstr := global_str('!WINZOOM#' + str(window_id));
-
- osn := screen_num;
- IF min THEN
- IF (window_attr AND $40) = 0 THEN
- x := parse_int('/OMX=', tstr );
- y := parse_int('/OMY=', tstr );
- IF (x = 0) OR (y = 0) THEN
- x := win_x1;
- y := win_y1;
- END;
- IF parse_str('/X1=', tstr) <> '' THEN
- tstr := '/X1=' + parse_str('/X1=', tstr ) +
- '/Y1=' + parse_str('/Y1=', tstr ) +
- '/X2=' + parse_str('/X2=', tstr ) +
- '/Y2=' + parse_str('/Y2=', tstr );
- ELSE
- tstr := '';
- END;
- tstr := tstr +
- '/MX1=' + str(win_x1) +
- '/MX2=' + str(win_x2) +
- '/MY1=' + str(win_y1) +
- '/MY2=' + str(win_y2) +
- '/MSN=' + str(screen_num) + '/MZC=' + zoom_char;
- t_id := window_id;
- window_attr := $41;
- RM('WINDOW^DelWin /NODEL=1');
- switch_win_id(t_id );
- window_attr := $40;
- size_window( x, y, x + 14, y + 1 );
- zoom_char := '|24';
- set_global_str('!WINZOOM#' + str(window_id), tstr + '/ZC=' + zoom_char );
- END;
- elsif (window_attr AND $40) <> 0 THEN
- zoom_char := parse_str('/MZC=', tstr );
- window_attr := window_attr AND $BF;
- screen_num := parse_int('/MSN=', tstr);
- x := win_x1;
- y := win_y1;
- size_window( Parse_Int('/MX1=', tstr),
- Parse_Int('/MY1=', tstr),
- Parse_Int('/MX2=', tstr),
- Parse_Int('/MY2=', tstr) );
- IF parse_str('/X1=', tstr) <> '' THEN
- tstr := '/X1=' + parse_str('/X1=', tstr ) +
- '/Y1=' + parse_str('/Y1=', tstr ) +
- '/X2=' + parse_str('/X2=', tstr ) +
- '/Y2=' + parse_str('/Y2=', tstr );
- ELSE
- tstr := '';
- END;
- tstr := tstr + '/OMX=' + str(x) + '/OMY=' + str(y);
- set_global_str('!WINZOOM#' + str(window_id), tstr + '/ZC=' + zoom_char );
- elsif (parse_str('/X1=', tstr) <> '') then
- screen_num := parse_int('/SN=', tstr);
- size_window( Parse_Int('/X1=', tstr),
- Parse_Int('/Y1=', tstr),
- Parse_Int('/X2=', tstr),
- Parse_Int('/Y2=', tstr) );
- tstr := '/OMX=' + str(parse_int('/OMX=', tstr )) +
- '/OMY=' + str(parse_int('/OMY=', tstr ));
- set_global_str('!WINZOOM#' + str(window_id), tstr + '/ZC=' + zoom_char);
- zoom_char := '|24';
- elsif (win_x1 <> min_window_col) or (win_y1 <> min_window_row) or
- (win_x2 <> max_window_col) or (win_y2 <> max_window_row) then
- IF parse_str('/OMX=', tstr) <> '' THEN
- tstr := '/OMX=' + parse_str('/OMX=', tstr ) +
- '/OMY=' + parse_str('/OMY=', tstr );
- ELSE
- tstr := '';
- END;
- tstr := tstr + '/X1=' + str(win_x1) +
- '/X2=' + str(win_x2) +
- '/Y1=' + str(win_y1) +
- '/Y2=' + str(win_y2) +
- '/OMX=' + str(parse_int('/OMX=', tstr )) +
- '/OMY=' + str(parse_int('/OMY=', tstr )) +
- '/SN=' + str(screen_num);
- screen_num := global_int('@SCREEN_COUNT') + 1;
- if screen_num <= 1 then
- screen_num := 2;
- end;
- set_global_int('@SCREEN_COUNT', screen_num );
- window_attr := window_attr AND $BF;
- size_window(min_window_col, min_window_row, max_window_col, max_window_row );
- zoom_char := '|25';
- set_global_str('!WINZOOM#' + str(window_id), tstr + '/ZC=' + zoom_char );
- else
- goto exit;
- end;
-
- owin := cur_window;
- jx := 0;
- WHILE jx < window_count DO
- ++jx;
- switch_window( jx );
- IF ((window_attr AND $81) = 0) AND (screen_num = osn) THEN
- RM('SETBTMS');
- END;
- END;
- switch_window( owin );
- new_screen;
- exit:
- refresh := old_refresh;
- END_MACRO;
-
-
- $MACRO SPLITWIN TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SPLITWIN
-
- Description: Splits a window horizontally or vertically.
-
- Parameters: Prompts the user if no parameters are passed.
-
- /DIR=str Direction (str is NOT case sensitive)
- str = Up
- str = Down
- str = Left
- str = Right
- /LN#=n Number of lines (or columns) in the new window.
- 0 means use half of the original window.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- Def_Int( Old_Refresh, x,y,j1, j2, ty1, ty2, newx1,newy1, newx2, newy2 );
- def_int( oldx1, oldx2, oldy1, oldy2, old_win, cur_screen,tw1,tw2 );
-
- def_int( w_id );
- def_int( num_lines, nl1, nl2, event_count );
- def_str( direction[10], event_str[20] );
-
- If Window_Count >= 100 THEN
- Error_Level := 1001;
- Goto Exit;
- END;
-
- direction := caps(parse_str('/DIR=', mparm_str));
- num_lines := parse_int('/LN#=', mparm_str);
-
- Old_Refresh := Refresh;
- Refresh := False;
-
- w_id := window_id;
-
- oldx1 := win_x1;
- oldx2 := win_x2;
- oldy1 := win_y1;
- oldy2 := win_y2;
-
- newx1 := oldx1;
- newx2 := oldx2;
- newy1 := oldy1;
- newy2 := oldy2;
- old_win := cur_window;
-
- if num_lines = 0 then
- nl1 := (newy2 - newy1) / 2;
- nl2 := (newx2 - newx1) / 2;
- else
- nl1 := num_lines;
- nl2 := num_lines;
- end;
-
- if direction <> '' then
- goto loopout;
- end;
- x := win_x1 + (((win_x2 - win_x1) / 2) - 15);
- IF x < 1 THEN
- x := 1;
- END;
- IF (x + 29) > screen_width THEN
- x := screen_width - 29;
- END;
- y := win_y1 + (((win_y2 - win_y1) / 2) - 5);
- IF (y < min_window_row) THEN
- y := min_window_row;
- END;
- IF (y < 2) THEN
- y := 2;
- END;
- IF (y + 9) > (max_window_row - 1) THEN
- y := (max_window_row - 10);
- END;
- event_count := 5;
- Set_Global_Str('@WSEV#1', '/T=/KC=<RIGHT>/K1=0/K2=77/R=1/W=7/X=' + str( x + 18){44} + '/Y=' + str(y + 4){6});
- Set_Global_Str('@WSEV#2', '/T=/KC=<LEFT>/K1=0/K2=75/R=2/W=6/X=' + str( x + 3) + '/Y=' + str(y + 4){/X=29/Y=6});
- Set_Global_Str('@WSEV#3', '/T=/KC=<UP>/K1=0/K2=72/R=3/W=4/X=' + str( x + 12) + '/Y=' + str(y + 2){/X=38/Y=4});
- Set_Global_Str('@WSEV#4', '/T=/KC=<DOWN>/K1=0/K2=80/R=4/W=6/X=' + str( x + 11) + '/Y=' + str(y + 6){/X=37/Y=8});
- Set_Global_Str('@WSEV#5', '/T=Cancel/KC=<ESC>/K1=27/K2=1/R=0/W=11/X=' + str( x + 9) + '/Y=' + str(y + 8){/X=35/Y=10});
- Put_Box(x,y, x + 29, y+9, 0, m_b_color, 'Indicate side to split', true);
- Draw_Char(24, x + 13, y + 3, m_t_color, 1 );
- Draw_Char(25, x + 13, y + 5, m_t_color, 1 );
- Draw_Char(27, x + 10, y + 4, m_t_color, 1 );
- Draw_Char(26, x + 16, y + 4, m_t_color, 1 );
- RM('CheckEvents /M=2/G=@WSEV#/#=5');
- loop:
- read_key;
- return_int := 0;
- if (key1 = 0) AND (key2 = 250) THEN
- RM('CheckEvents /G=@WSEV#/#=5/M=1');
- else
- RM('CheckEvents /G=@WSEV#/#=5/M=0');
- end;
- IF return_int <> 0 THEN
- return_int := parse_int('/R=', return_str);
- set_global_int('s_direction',return_int); {MODIFIED 10-3-89 BY SUE FOR USE WITH FILE COMPARISON MACRO}
- IF return_int = 0 then
- kill_box;
- goto exit;
- elsIF return_int = 3 then
- direction := 'UP';
- elsif return_int = 4 then
- direction := 'DOWN';
- elsif return_int = 1 then
- direction := 'RIGHT';
- elsif return_int = 2 then
- direction := 'LEFT';
- else
- goto loop;
- end;
- goto loopout;
- end;
- goto loop;
-
- loopout:
- kill_box;
-
- if direction = 'UP' then
- newy2 := newy1 + nl1;
- oldy1 := newy2;
- else
- if direction = 'DOWN' then
- newy1 := newy2 - nl1;
- oldy2 := newy1;
- else
- if direction = 'RIGHT' then
- newx1 := newx2 - nl2;
- oldx2 := newx1;
- else
- if direction = 'LEFT' then
- newx2 := newx1 + nl2;
- oldx1 := newx2;
- else
- goto exit;
- end;
- end;
- end;
- end;
-
- Size_Window(oldx1,oldy1,oldx2,oldy2);
- IF direction = 'DOWN' THEN
- w_bottom_line := false;
- END;
- if screen_num = 0 then
- screen_num := global_int('@SCREEN_COUNT') + 1;
- if screen_num <= 1 then
- screen_num := 2;
- end;
- set_global_int('@SCREEN_COUNT', screen_num );
- end;
- cur_screen := screen_num;
- refresh := true;
- redraw;
- refresh := false;
- switch_window( window_count );
- Create_Window;
- RM('EXTSETUP /PRE=1');
- Size_Window(newx1,newy1,newx2,newy2);
-
- screen_num := cur_screen;
-
- RM('setbtms /SN=' + str(cur_screen));
- j2 := cur_window;
-
- Refresh := true;
- Redraw;
- tw1 := window_id;
- RM('MEUTIL1^LOADFILE /X=' + str(win_x1) + '/Y=' + str(win_y1));
- if return_int = 0 then
- link_window(old_win);
- make_message( 'Window linked.');
- else
- tw2 := window_id;
- j1 := cur_window;
- if tw2 <> tw1 then
- refresh := false;
- if switch_win_id( tw1 ) then
- if caps(file_name) = '?NO-FILE?' then
- link_window( j1 );
- make_message( 'Window linked.');
- end;
- end;
- end;
- end;
- RM('WINDOW^SetWindowNames');
- Exit:
- RM('CheckEvents /G=@WSEV#/#=5/M=3');
- END_MACRO;
-
-
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: SetWindowNames
-
- Description: Goes through the entire set of windows currently loaded
- and assigns alphabetic WINDOW_NAMEs to them, skipping any with the
- INVISIBLE (Bit 7) attribute.
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- $MACRO SetWindowNames;
-
- DEF_INT( tw, jx, jy,jz, t_refresh );
-
- t_refresh := refresh;
- refresh := FALSE;
- tw := cur_window;
-
- jx := 0;
- jy := 0;
- jz := 0;
- WHILE jx < window_count DO
- ++jx;
- switch_window(jx);
- IF (window_attr AND $80) = 0 THEN
- ++jy;
- IF jy > 26 THEN
- jy := 1;
- ++jz;
- END;
- IF jz > 0 THEN
- window_name := CHAR( jz + 48) + CHAR( jy + 64 );
- ELSE
- window_name := CHAR( jy + 64 );
- END;
- END;
- END;
-
- switch_window( tw );
- refresh := t_refresh;
-
- END_MACRO;
-
-
- $MACRO WINOP TRANS;
- {*******************************MULTI-EDIT MACRO******************************
-
- Name: WINOP
-
- Description: Performs various window operations
-
- Parameters: /T=0 Create window
- /T=1 Delete window
- /T=2 Hide window
- /T=3 Window list
- /T=4 Split window
- /T=5 Resize window
- /T=6 Link window
- /T=7 Unlink window
- /T=8 Zoom window
-
- (C) Copyright 1989 by American Cybernetics, Inc.
- ******************************************************************************}
- def_int( tt );
- Def_Int(jx, mr);
-
- tt := Parse_Int('/T=', mparm_str);
-
- if tt = 0 then
- RM('MAKEWIN');
- goto exit;
- end;
-
- if tt = 1 then
- RM('DELWIN ' + mparm_str);
- end;
-
- if tt = 2 then
- Window_Attr := Window_Attr or $01;
- RM( 'FindWin' );
- New_Screen;
- goto exit;
- end;
-
- if tt = 3 then
- RM( 'SwitWin' );
- goto exit;
- end;
-
- if tt = 4 then
- RM( 'SPLITWIN' );
- goto exit;
- end;
-
- if tt = 5 then
- RM('MOD_WIN');
- end;
-
- if tt = 6 then
- RM('LINKWIN ' + mparm_str);
- end;
-
- if tt = 7 then
- unlink_window;
- end;
-
- if tt = 8 then
- RM('zoom');
- end;
-
- Exit:
- END_MACRO;
-