home *** CD-ROM | disk | FTP | other *** search
- { MSPROMPT.INC
- MS 4.0
- Copyright (c) 1985, 87 by Borland International, Inc. }
-
- procedure EdUpdateCmdLine;
- {-Update the top command line}
-
- begin {EdUpdateCmdLine}
- if EdKeyInterrupt or Recurring then
- Exit;
- Move(PromptLine[1], Tline, PhyScrCols);
- FillChar(Aline, PhyScrCols, ScreenAttr[CmdColor]);
- EdWrline(PromptRow);
- end; {EdUpdateCmdLine}
-
- procedure EdEraseMenuHelp;
- {-Remove menu help from the prompt line}
-
- begin {EdEraseMenuHelp}
- if EdKeyInterrupt or Recurring then
- Exit;
- if ShowMenuHelp then begin
- FillChar(PromptLine[MenuHelpPos], Succ(PhyScrCols-MenuHelpPos), Blank);
- EdUpdateCmdLine;
- end;
- end; {EdEraseMenuHelp}
-
- procedure EdShowMenuHelp;
- {-Put the menu help into the prompt line}
-
- begin {EdShowMenuHelp}
- if EdPtrIsNil(CurrMenu) and ShowMenuHelp then begin
- Move(HelpPromptLine[1], PromptLine[1], PhyScrCols);
- PromptCol := 1;
- EdUpdateCmdLine;
- end;
- end; {EdShowMenuHelp}
-
- procedure EdAppPromptLine(S : VarString);
- {-Append command name to prompt line}
- var
- Len : Integer;
-
- begin {EdAppPromptLine}
- Len := Length(S);
- if Len > 0 then begin
- {Truncate if too long}
- if PromptCol+Len > MaxPromptChars then
- Len := Succ(MaxPromptChars-PromptCol);
- Move(S[1], PromptLine[PromptCol], Len);
- PromptCol := PromptCol+Len;
- if not(SolidCursor) then
- EdGotoxy(PromptCol, PromptRow);
- end;
- end; {EdAppPromptLine}
-
- procedure EdZapPromptLine;
- {-Zap prompt line, leaving it blank}
-
- begin {EdZapPromptLine}
- FillChar(PromptLine[1], MaxPromptChars, Blank);
- {Reset the next column number}
- PromptCol := 1;
- UpdateCursor := True;
- end; {EdZapPromptLine}
-
- procedure EdResetPromptLine;
- {-Clear partial command indicator from command line}
-
- begin {EdResetPromptLine}
- CmdPtr := 0;
- EdZapPromptLine;
- UpdateScreen := True;
- UpdateCursor := True;
- end; {EdResetPromptLine}
-
- procedure EdWritePromptLine(S : VarString);
- {-Write a new message line to the screen}
-
- begin {EdWritePromptLine}
- EdZapPromptLine;
- EdAppPromptLine(S);
- EdUpdateCmdLine;
- end; {EdWritePromptLine}
-
- procedure EdForceMessage(msg : VarString);
- {-Guarantee that a message is displayed}
-
- begin {EdForceMessage}
- Intrflag := NoInterr;
- EdWritePromptLine(msg);
- Intrflag := Interr;
- end; {EdForceMessage}
-
- procedure EdDisplayCommandBuffer;
- {-Indicate that a partial command has been entered}
- var
- Cmd : VarString;
- I : Integer;
- Ch : Char;
-
- begin {EdDisplayCommandBuffer}
- {Get out fast if other keys are waiting}
- if (Circin = Circout) then begin
- I := 1;
- Cmd := '';
- while I <= CmdPtr do begin
- Ch := CmdBuf[I];
- case Ch of
- #0 :
- begin
- {Don't try to interpret extended keystrokes}
- Inc(I);
- Cmd := Cmd+'+';
- end;
- #1..#31 :
- Cmd := Cmd+'^'+Chr(Ord(Ch)+64)
- else
- Cmd := Cmd+Ch;
- end;
- Inc(I);
- end;
- EdWritePromptLine(Cmd);
- end;
- end; {EdDisplayCommandBuffer}
-
- procedure EdWait;
- {-Display a Wait signal}
- begin {EdWait}
- EdWritePromptLine(EdGetMessage(327));
- end; {EdWait}