FS editor lightbars

This commit is contained in:
mysticbbs 2012-08-16 09:14:56 -04:00
parent 5b0e664c1f
commit 1065e51a0b
1 changed files with 163 additions and 71 deletions

View File

@ -40,7 +40,8 @@
// Set Prompt #213 to "!to-prmpt MESSAGE" // Set Prompt #213 to "!to-prmpt MESSAGE"
// E-mail reading prompt : Set Prompt #115 to "!to-prmpt EMAIL" // E-mail reading prompt : Set Prompt #115 to "!to-prmpt EMAIL"
// File Listing prompt : Set Prompt #044 to "!to-prmpt FILE" // File Listing prompt : Set Prompt #044 to "!to-prmpt FILE"
// Pause prompt : Set Prompt #132 to "!to-prmpt PAUSE" // YNC Pause prompt : Set Prompt #132 to "!to-prmpt PAUSE"
// Msg Editor prompt : Set Prompt #354 to "!to-prmpt EDITOR"
// //
// When you have changed the prompts, you must compile them again with // When you have changed the prompts, you must compile them again with
// MAKETHEME, or if you changed them inside the internal prompt editor, the // MAKETHEME, or if you changed them inside the internal prompt editor, the
@ -55,6 +56,7 @@
// - Added the 'H' command to the message reader prompt (set lastread) // - Added the 'H' command to the message reader prompt (set lastread)
// - Added the 'M' command to the message reader prompt (move message) // - Added the 'M' command to the message reader prompt (move message)
// - Added the 'F' command to the message reader prompt (forward) // - Added the 'F' command to the message reader prompt (forward)
// - Added the FS editor prompt option
// - Some conversions of IF statements to CASE statements for code clarity // - Some conversions of IF statements to CASE statements for code clarity
// //
// =========================================================================== // ===========================================================================
@ -62,6 +64,86 @@
Var Var
Selection : Byte; Selection : Byte;
Function EditPromptMenu : Byte
Var
Ch : Char;
Done : Boolean;
Bar : Byte;
Cmd : Array[1..7] of String[80];
Xpos : Array[1..7] of String[80];
Begin
Done := False
Bar := 1
Xpos[1] := '|[X14'
Xpos[2] := '|[X20'
Xpos[3] := '|[X27'
Xpos[4] := '|[X34'
Xpos[5] := '|[X44'
Xpos[6] := '|[X52'
Xpos[7] := '|[X59'
Cmd[1] := ' |15S|07ave '
Cmd[2] := ' |15Q|07uote '
Cmd[3] := ' |15A|07bort '
Cmd[4] := ' |15C|07ontinue '
Cmd[5] := ' |15U|07pload '
Cmd[6] := ' |15T|07itle '
Cmd[7] := ' |15H|07elp '
Repeat
If Graphics > 0 Then
Write ('|15|17' + Xpos[Bar]+stripmci(Cmd[Bar]) + '|00|16');
Ch := ReadKey
If Graphics > 0 and IsArrow Then Begin
Write (Xpos[bar] + Cmd[Bar] + '|00|16');
If Ord(Ch) = 75 Then Begin
If Bar > 1 Then
Bar := Bar - 1
End Else
If Ord(Ch) = 77 Then Begin
If Bar < 7 Then
Bar := Bar + 1
End
End Else
If Ch = #13 and Graphics > 0 Then Begin
EditPromptMenu := Bar
Done := True
End Else
If Upper(Ch) = 'S' Then Begin
EditPromptMenu := 1
Done := True
End Else
If Upper(Ch) = 'Q' Then Begin
EditPromptMenu := 2
Done := True
End Else
If Upper(Ch) = 'A' Then Begin
EditPromptMenu := 3
Done := True
End Else
If Upper(Ch) = 'C' Then Begin
EditPromptMenu := 4
Done := True
End Else
If Upper(Ch) = 'U' Then Begin
EditPromptMenu := 5
Done := True
End Else
If Upper(Ch) = 'T' Then Begin
EditPromptMenu := 6
Done := True
End Else
If Upper(Ch) = 'H' Then Begin
EditPromptMenu := 7
Done := True
End
Until Done
End
Function FPromptMenu : Byte Function FPromptMenu : Byte
Var Var
Ch : Char; Ch : Char;
@ -74,17 +156,17 @@ Begin
Done := False Done := False
Bar := 1 Bar := 1
Xpos[1] := '|[X40' Xpos[1] := '|[X38'
Xpos[2] := '|[X45' Xpos[2] := '|[X44'
Xpos[3] := '|[X54' Xpos[3] := '|[X54'
Xpos[4] := '|[X59' Xpos[4] := '|[X60'
Xpos[5] := '|[X64' Xpos[5] := '|[X66'
Cmd[1] := '|15n|07ext' Cmd[1] := ' |15N|07ext '
Cmd[2] := '|15p|07revious' Cmd[2] := ' |15P|07revious '
Cmd[3] := '|15f|07lag' Cmd[3] := ' |15F|07lag '
Cmd[4] := '|15v|07iew' Cmd[4] := ' |15V|07iew '
Cmd[5] := '|15q|07uit' Cmd[5] := ' |15Q|07uit '
Repeat Repeat
If Graphics > 0 Then If Graphics > 0 Then
@ -142,21 +224,21 @@ Begin
Done := False Done := False
Bar := 1 Bar := 1
Xpos[1] := '|[X23' Xpos[1] := '|[X22'
Xpos[2] := '|[X28' Xpos[2] := '|[X28'
Xpos[3] := '|[X37' Xpos[3] := '|[X38'
Xpos[4] := '|[X43' Xpos[4] := '|[X45'
Xpos[5] := '|[X49' Xpos[5] := '|[X52'
Xpos[6] := '|[X54' Xpos[6] := '|[X58'
Xpos[7] := '|[X61' Xpos[7] := '|[X66'
Cmd[1] := '|15n|07ext' Cmd[1] := ' |15N|07ext '
Cmd[2] := '|15p|07revious' Cmd[2] := ' |15P|07revious '
Cmd[3] := '|15a|07gain' Cmd[3] := ' |15A|07gain '
Cmd[4] := '|15r|07eply' Cmd[4] := ' |15R|07eply '
Cmd[5] := '|15j|07ump' Cmd[5] := ' |15J|07ump '
Cmd[6] := '|15d|07elete' Cmd[6] := ' |15D|07elete '
Cmd[7] := '|15q|07uit' Cmd[7] := ' |15Q|07uit '
Repeat Repeat
If Graphics > 0 Then If Graphics > 0 Then
@ -223,28 +305,27 @@ End
Function MPromptMenu : Byte; Function MPromptMenu : Byte;
Var Var
Done : Boolean;
Ch : Char Ch : Char
Done : Boolean
Bar : Byte Bar : Byte
Cmd : Array[1..6] of String[80] Cmd : Array[1..6] of String[80]
Xpos : Array[1..6] of String[80] Xpos : Array[1..6] of String[80]
Begin Begin
Done := False Bar := 1;
Bar := 1
Xpos[1] := '|[X38' Xpos[1] := '|[X36'
Xpos[2] := '|[X43' Xpos[2] := '|[X42'
Xpos[3] := '|[X52' Xpos[3] := '|[X52'
Xpos[4] := '|[X58' Xpos[4] := '|[X59'
Xpos[5] := '|[X64' Xpos[5] := '|[X66'
Xpos[6] := '|[X69' Xpos[6] := '|[X72'
Cmd[1] := '|15n|07ext|00|16' Cmd[1] := ' |15N|07ext|00|16 '
Cmd[2] := '|15p|07revious|00|16' Cmd[2] := ' |15P|07revious|00|16 '
Cmd[3] := '|15a|07gain|00|16' Cmd[3] := ' |15A|07gain|00|16 '
Cmd[4] := '|15r|07eply|00|16' Cmd[4] := ' |15R|07eply|00|16 '
Cmd[5] := '|15j|07ump|00|16' Cmd[5] := ' |15J|07ump|00|16 '
Cmd[6] := '|15q|07uit|00|16' Cmd[6] := ' |15Q|07uit|00|16 '
Repeat Repeat
If Graphics > 0 Then If Graphics > 0 Then
@ -292,7 +373,7 @@ Begin
Else Else
If (Pos(Ch, 'MEFD') > 0 And ACS('OM')) OR (Pos(Ch, 'X?[]HITGL') > 0) Then Begin If (Pos(Ch, 'MEFD') > 0 And ACS('OM')) OR (Pos(Ch, 'X?[]HITGL') > 0) Then Begin
StuffKey(Ch); StuffKey(Ch);
Done := True; Break;
End; End;
End; End;
End; End;
@ -310,17 +391,17 @@ Begin
Done := False Done := False
Bar := 1 Bar := 1
Xpos[1] := '|[X22' Xpos[1] := '|[X21'
Xpos[2] := '|[X26' Xpos[2] := '|[X26'
Xpos[3] := '|[X29' Xpos[3] := '|[X30'
Cmd[1] := '|15y|07es' Cmd[1] := ' |15Y|07es '
Cmd[2] := '|15n|07o' Cmd[2] := ' |15N|07o '
Cmd[3] := '|15c|07ontinuous' Cmd[3] := ' |15C|07ontinuous '
Repeat Repeat
If Graphics > 0 Then If Graphics > 0 Then
Write ('|11|19' + XPos[Bar] + StripMCI(Cmd[Bar]) + '|00|16') Write ('|15|17' + XPos[Bar] + StripMCI(Cmd[Bar]) + '|00|16')
Ch := ReadKey Ch := ReadKey
@ -354,34 +435,29 @@ End
Procedure MESSAGE Procedure MESSAGE
Begin Begin
Write ('|CR|08 >>|07 Reading messages |15|$L04|&5 |07of |15|$R04|&6 |08// |15n|09ext |15p|07revious |15a|07gain |15r|07eply |15j|07ump |15q|07uit |00') Write ('|CR|08>>|07 Reading messages |15|$L04|&5 |07of |15|$R04|&6 |08// |15N|09ext |15P|07revious |15A|07gain |15R|07eply |15J|07ump |15Q|07uit |00')
Selection := MPromptMenu Selection := MPromptMenu
If Selection = 1 Then MoveX(1);
stuffkey('N') TextColor(7);
Else ClrEOL;
If Selection = 2 Then
stuffkey('P') Case Selection of
Else 1 : stuffkey('N');
If Selection = 3 Then 2 : stuffkey('P');
stuffkey('A') 3 : stuffkey('A');
Else 4 : stuffkey('R');
If Selection = 4 Then 5 : stuffkey('J');
stuffkey('R') 6 : stuffkey('Q');
Else End;
If Selection = 5 Then
stuffkey('J')
Else
If Selection = 6 Then
stuffkey('Q')
End End
Procedure DOPAUSE Procedure DOPAUSE
Var Var
SavedX : Byte; SavedX : Byte;
Begin Begin
Write ('|08 >> |07Paused |13-|07 more|08 // |15y|09es |15n|07o |15c|07ontinuous |00'); Write ('|08>> |07Paused |08- |07More|08 // |15Y|09es |15N|07o |15C|07ontinuous |00');
SavedX := WhereX; SavedX := WhereX;
@ -427,9 +503,24 @@ Begin
stuffkey('Q') stuffkey('Q')
End End
Procedure Editor;
Begin
Write ('|CR|08<< |07Editor |08// |15S|07ave |15Q|07uote |15A|07bort |15C|07ontinue |15U|07pload |15T|07itle |15H|07elp |08>>');
Case EditPromptMenu of
1 : stuffKey('S');
2 : stuffKey('Q');
3 : stuffKey('A');
4 : stuffKey('C');
5 : stuffKey('U');
6 : stuffKey('T');
7 : stuffKey('H');
End;
End;
Procedure File Procedure File
Begin Begin
Write ('|CR|07(|07|$R31|FB|07) |08// |15n|07ext |15p|07revious |15f|07lag |15v|07iew |15q|07uit >>') Write ('|CR|08[|07|$R31|FB|08] |08// |15N|07ext |15P|07revious |15F|07lag |15V|07iew |15Q|07uit |08>>')
Selection := FPromptMenu Selection := FPromptMenu
@ -450,7 +541,7 @@ Begin
End End
Const Const
FailStr = '|CRUSAGE: to-prmpt [ MESSAGE | FILE | EMAIL | PAUSE ]|CR|PA'; FailStr = '|CRUSAGE: to-prmpt [ MESSAGE | FILE | EMAIL | PAUSE | EDITOR ]|CR|CR|PA';
Begin Begin
AllowArrow := True; AllowArrow := True;
@ -463,6 +554,7 @@ Begin
'FILE' : FILE; 'FILE' : FILE;
'EMAIL' : EMAIL; 'EMAIL' : EMAIL;
'PAUSE' : DOPAUSE; 'PAUSE' : DOPAUSE;
'EDITOR' : EDITOR;
Else Else
WriteLn(FailStr); WriteLn(FailStr);
End; End;