2012-02-13 16:50:48 -08:00
|
|
|
Unit bbs_Ansi_Help;
|
|
|
|
|
|
|
|
{$I M_OPS.PAS}
|
|
|
|
|
|
|
|
Interface
|
|
|
|
|
|
|
|
Const
|
2012-02-15 12:01:43 -08:00
|
|
|
mysMaxHelpTest = 200;
|
|
|
|
mysMaxHelpKeyLen = 20;
|
|
|
|
mysMaxHelpLineLinks = 10;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
Type
|
2012-03-10 00:57:33 -08:00
|
|
|
TLinkInfoRec = Record
|
|
|
|
Key : String[mysMaxHelpKeyLen];
|
|
|
|
LinkPos : Byte;
|
|
|
|
LinkLen : Byte;
|
|
|
|
End;
|
|
|
|
|
|
|
|
TLineInfoRec = Record
|
|
|
|
Text : String;
|
2012-02-13 16:50:48 -08:00
|
|
|
Links : Byte;
|
2012-03-10 00:57:33 -08:00
|
|
|
Link : Array[1..mysMaxHelpLineLinks] of TLinkInfoRec
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
|
|
|
TAnsiMenuHelp = Class
|
|
|
|
HelpFile : Text;
|
2012-02-15 12:01:43 -08:00
|
|
|
CurKey : String[mysMaxHelpKeyLen];
|
|
|
|
Text : Array[1..mysMaxHelpTest] of TLineInfoRec;
|
2012-02-13 16:50:48 -08:00
|
|
|
Lines : Word;
|
|
|
|
|
|
|
|
Constructor Create;
|
|
|
|
Destructor Destroy; Override;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
Function ReadKeywordData : Boolean;
|
2012-02-27 06:30:13 -08:00
|
|
|
Procedure OpenHelp (Str: String);
|
2012-02-15 14:24:35 -08:00
|
|
|
Function StripLinks (Str: String) : String;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
|
|
|
Implementation
|
|
|
|
|
|
|
|
Uses
|
|
|
|
m_Strings,
|
2012-03-10 00:57:33 -08:00
|
|
|
bbs_Ansi_MenuBox,
|
2012-02-27 06:30:13 -08:00
|
|
|
bbs_Core,
|
2012-03-16 17:05:32 -07:00
|
|
|
bbs_Common,
|
2012-03-10 00:57:33 -08:00
|
|
|
MPL_Execute;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
2012-02-17 22:52:13 -08:00
|
|
|
Constructor TAnsiMenuHelp.Create;
|
|
|
|
Begin
|
|
|
|
Inherited Create;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Destructor TAnsiMenuHelp.Destroy;
|
|
|
|
Begin
|
|
|
|
Inherited Destroy;
|
|
|
|
End;
|
|
|
|
|
2012-02-15 14:24:35 -08:00
|
|
|
Function TAnsiMenuHelp.StripLinks (Str: String) : String;
|
2012-02-14 22:00:38 -08:00
|
|
|
Var
|
|
|
|
A : Byte;
|
|
|
|
B : Byte;
|
|
|
|
Begin
|
|
|
|
A := 255;
|
|
|
|
|
|
|
|
While A > 0 Do Begin
|
2012-02-15 14:24:35 -08:00
|
|
|
A := Pos('<link=', Str);
|
2012-02-14 22:00:38 -08:00
|
|
|
|
|
|
|
If A > 0 Then Begin
|
|
|
|
B := 1;
|
2012-03-10 00:57:33 -08:00
|
|
|
While Str[A + 6 + B] <> '>' Do Inc(B);
|
2012-02-15 14:24:35 -08:00
|
|
|
Delete (Str, A, 7 + B);
|
2012-02-14 22:00:38 -08:00
|
|
|
|
2012-02-15 14:24:35 -08:00
|
|
|
A := Pos('</link>', Str);
|
|
|
|
If A = 0 Then A := Length(Str);
|
|
|
|
Delete (Str, A, 7);
|
2012-02-14 22:00:38 -08:00
|
|
|
End;
|
|
|
|
End;
|
|
|
|
|
2012-02-15 14:24:35 -08:00
|
|
|
Result := Str;
|
2012-02-14 22:00:38 -08:00
|
|
|
End;
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
Function TAnsiMenuHelp.ReadKeywordData : Boolean;
|
|
|
|
Var
|
|
|
|
Str : String;
|
|
|
|
Key : String;
|
|
|
|
Temp1 : Byte;
|
|
|
|
Temp2 : Byte;
|
|
|
|
Done : Boolean;
|
|
|
|
Buffer : Array[1..2048] of Char;
|
|
|
|
Begin
|
|
|
|
SetTextBuf (HelpFile, Buffer);
|
|
|
|
Reset (HelpFile);
|
|
|
|
|
|
|
|
Done := False;
|
|
|
|
|
|
|
|
While Not Eof(HelpFile) And Not Done Do Begin
|
|
|
|
ReadLn (HelpFile, Str);
|
|
|
|
|
|
|
|
Temp1 := Pos('<keyword> ', Str);
|
2012-02-15 14:24:35 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
If Temp1 = 0 Then Continue;
|
|
|
|
|
|
|
|
Key := Copy(Str, Temp1 + 10, Length(Str));
|
|
|
|
|
|
|
|
If Key <> CurKey Then Continue;
|
|
|
|
|
|
|
|
Lines := 0;
|
|
|
|
|
|
|
|
While Not Eof(HelpFile) Do Begin
|
|
|
|
ReadLn (HelpFile, Str);
|
|
|
|
|
|
|
|
If Pos('<end>', Str) > 0 Then Begin
|
|
|
|
Done := True;
|
|
|
|
Break;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Inc (Lines);
|
|
|
|
|
|
|
|
Text[Lines].Text := StripLinks(Str);
|
|
|
|
Text[Lines].Links := 0;
|
|
|
|
Str := strStripPipe(Str);
|
|
|
|
|
|
|
|
Repeat
|
2012-02-14 22:00:38 -08:00
|
|
|
Temp1 := Pos('<link=', Str);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
If Temp1 = 0 Then Break;
|
|
|
|
|
|
|
|
Inc (Text[Lines].Links);
|
|
|
|
|
|
|
|
Text[Lines].Link[Text[Lines].Links].LinkPos := Temp1;
|
|
|
|
|
|
|
|
Temp2 := 0;
|
|
|
|
Key := '';
|
|
|
|
|
2012-02-14 22:00:38 -08:00
|
|
|
While Str[Temp1 + 6 + Temp2] <> '>' Do Begin
|
|
|
|
Key := Key + Str[Temp1 + 6 + Temp2];
|
|
|
|
Inc (Temp2);
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
2012-02-14 22:00:38 -08:00
|
|
|
Delete (Str, Temp1, 7 + Temp2);
|
|
|
|
Temp2 := Pos('</link>', Str);
|
|
|
|
Delete (Str, Temp2, 7);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
Text[Lines].Link[Text[Lines].Links].LinkLen := Temp2 - Temp1;
|
|
|
|
Text[Lines].Link[Text[Lines].Links].Key := Key;
|
|
|
|
Until False;
|
|
|
|
End;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Close (HelpFile);
|
|
|
|
|
|
|
|
Result := Done And (Lines > 0);
|
|
|
|
End;
|
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
Procedure TAnsiMenuHelp.OpenHelp (Str: String);
|
|
|
|
Const
|
|
|
|
WinX1 : Byte = 2;
|
|
|
|
WinY1 : Byte = 2;
|
|
|
|
WinX2 : Byte = 78;
|
|
|
|
WinY2 : Byte = 22;
|
2012-02-13 16:50:48 -08:00
|
|
|
Var
|
2012-02-27 06:30:13 -08:00
|
|
|
FN : String;
|
2012-03-10 00:57:33 -08:00
|
|
|
Template : String[20];
|
2012-02-27 06:30:13 -08:00
|
|
|
Keyword : String;
|
|
|
|
TopPage : Integer;
|
|
|
|
CurLine : Integer;
|
2012-03-18 15:27:20 -07:00
|
|
|
CurLPos : Byte = 1;
|
2012-02-27 06:30:13 -08:00
|
|
|
WinSize : Integer;
|
|
|
|
LastPos : Byte;
|
|
|
|
LastKey : Array[1..10] of String[mysMaxHelpKeyLen];
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
Procedure LinkOFF (LineNum: Word; YPos, LPos: Byte);
|
|
|
|
Var
|
|
|
|
S : String;
|
|
|
|
Begin
|
|
|
|
If Text[LineNum].Links = 0 Then Exit;
|
|
|
|
|
|
|
|
With Text[LineNum] Do
|
|
|
|
S := Copy(strStripPipe(Text), Link[LPos].LinkPos, Link[LPos].LinkLen);
|
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
WriteXY (WinX1 + Text[LineNum].Link[LPos].LinkPos - 1, YPos, 9, S);
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
|
|
|
Procedure DrawPage;
|
|
|
|
Var
|
|
|
|
Count1 : Byte;
|
|
|
|
Count2 : Byte;
|
|
|
|
Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
For Count1 := 1 to WinSize Do Begin
|
|
|
|
If TopPage + Count1 - 1 <= Lines Then Begin
|
|
|
|
WriteXYPipe (WinX1, Count1 + WinY1 - 1, 7, WinX2 - WinX1 + 1, Text[TopPage + Count1 - 1].Text);
|
2012-02-14 22:00:38 -08:00
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
For Count2 := 1 to Text[TopPage + Count1 - 1].Links Do
|
|
|
|
LinkOFF (TopPage + Count1 - 1, Count1 + WinY1 - 1, Count2);
|
2012-02-13 16:50:48 -08:00
|
|
|
End Else
|
2012-02-27 06:30:13 -08:00
|
|
|
WriteXYPipe (WinX1, Count1 + WinY1 - 1, 7, WinX2 - WinX1 + 1, '');
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Procedure LinkON;
|
|
|
|
Var
|
|
|
|
S : String;
|
|
|
|
Begin
|
|
|
|
With Text[TopPage + CurLine - 1] Do
|
|
|
|
S := Copy(strStripPipe(Text), Link[CurLPos].LinkPos, Link[CurLPos].LinkLen);
|
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
WriteXY (WinX1 + Text[TopPage + CurLine - 1].Link[CurLPos].LinkPos - 1, WinY1 + CurLine - 1, 31, S);
|
2012-02-13 16:50:48 -08:00
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
Session.io.AnsiGotoXY (WinX1 + Text[TopPage + CurLine - 1].Link[CurLPos].LinkPos - 1, WinY1 + CurLine - 1);
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
|
|
|
Procedure UpdateCursor;
|
|
|
|
Begin
|
|
|
|
If Text[TopPage + CurLine - 1].Links > 0 Then Begin
|
|
|
|
If CurLPos > Text[TopPage + CurLine - 1].Links Then CurLPos := Text[TopPage + CurLine - 1].Links;
|
|
|
|
If CurLPos < 1 Then CurLPos := 1;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
LinkON;
|
|
|
|
End Else Begin
|
|
|
|
CurLPos := 1;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
|
|
|
Session.io.AnsiGotoXY (WinX1, WinY1 + CurLine - 1);
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Procedure PageDown;
|
|
|
|
Begin
|
|
|
|
If Lines > WinSize Then Begin
|
|
|
|
If TopPage + WinSize <= Lines - WinSize Then Begin
|
|
|
|
Inc (TopPage, WinSize);
|
|
|
|
End Else Begin
|
2012-02-14 22:00:38 -08:00
|
|
|
TopPage := Lines - WinSize + 1;
|
2012-02-13 16:50:48 -08:00
|
|
|
CurLine := WinSize;
|
|
|
|
End;
|
|
|
|
End Else
|
|
|
|
CurLine := Lines;
|
|
|
|
End;
|
|
|
|
|
2012-03-10 00:57:33 -08:00
|
|
|
Procedure ShowTemplate;
|
|
|
|
Begin
|
|
|
|
Session.io.OutFile(Template, False, 0);
|
|
|
|
|
|
|
|
WinX1 := Session.io.ScreenInfo[1].X;
|
|
|
|
WinY1 := Session.io.ScreenInfo[1].Y;
|
|
|
|
WinX2 := Session.io.ScreenInfo[2].X;
|
|
|
|
WinY2 := Session.io.SCreenInfo[2].Y;
|
|
|
|
End;
|
|
|
|
|
2012-03-18 15:27:20 -07:00
|
|
|
Procedure ExecuteMenuCommands;
|
|
|
|
Var
|
|
|
|
Key : String;
|
|
|
|
Temp : String;
|
|
|
|
Cmd : String[2];
|
|
|
|
Data : String;
|
|
|
|
Begin
|
|
|
|
Session.io.AnsiColor(7);
|
|
|
|
|
|
|
|
Key := Text[TopPage + CurLine - 1].Link[CurLPos].Key;
|
|
|
|
|
|
|
|
Repeat
|
|
|
|
Delete (Key, 1, 1);
|
|
|
|
|
|
|
|
Temp := strWordGet(1, Key, ']');
|
|
|
|
|
|
|
|
Cmd := strWordGet(1, Temp, ';');
|
|
|
|
Data := strWordGet(2, Temp, ';');
|
|
|
|
|
|
|
|
Delete (Key, 1, Length(Temp) + 1);
|
|
|
|
|
|
|
|
Session.Menu.ExecuteCommand (Cmd, Data);
|
|
|
|
Until Key = '';
|
|
|
|
|
|
|
|
ShowTemplate;
|
|
|
|
End;
|
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
Var
|
|
|
|
OK : Boolean;
|
|
|
|
Count : Byte;
|
|
|
|
Ch : Char;
|
|
|
|
Begin
|
2012-03-17 14:16:00 -07:00
|
|
|
FillChar(LastKey, SizeOf(LastKey), 0);
|
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
FN := strWordGet(1, Str, ';');
|
|
|
|
Template := strWordGet(2, Str, ';');
|
|
|
|
Keyword := strWordGet(3, Str, ';');
|
|
|
|
|
2012-03-16 17:05:32 -07:00
|
|
|
If Pos(PathChar, FN) = 0 Then FN := Session.Lang.TextPath + FN;
|
|
|
|
|
|
|
|
Assign (HelpFile, FN + '.hlp');
|
2012-02-27 06:30:13 -08:00
|
|
|
{$I-} Reset (HelpFile); {$I+}
|
2012-02-13 16:50:48 -08:00
|
|
|
|
|
|
|
If IoResult <> 0 Then Exit;
|
|
|
|
|
|
|
|
Close (HelpFile);
|
|
|
|
|
2012-03-10 00:57:33 -08:00
|
|
|
ShowTemplate;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
TopPage := 1;
|
|
|
|
CurLine := 1;
|
|
|
|
LastPos := 0;
|
2012-02-27 06:30:13 -08:00
|
|
|
WinSize := WinY2 - WinY1 + 1;
|
2012-02-13 16:50:48 -08:00
|
|
|
CurKey := Keyword;
|
|
|
|
OK := ReadKeywordData;
|
|
|
|
|
|
|
|
If Not OK and (CurKey <> 'INDEX') Then Begin
|
|
|
|
CurKey := 'INDEX';
|
2012-03-10 00:57:33 -08:00
|
|
|
OK := ReadKeywordData;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
|
|
|
If Not OK Then Exit;
|
|
|
|
|
|
|
|
While OK Do Begin
|
|
|
|
TopPage := 1;
|
|
|
|
CurLine := 1;
|
|
|
|
|
|
|
|
DrawPage;
|
|
|
|
|
|
|
|
For Count := 1 to WinSize Do
|
|
|
|
If Text[Count].Links > 0 Then Begin
|
|
|
|
CurLine := Count;
|
|
|
|
Break;
|
|
|
|
End;
|
|
|
|
|
|
|
|
UpdateCursor;
|
|
|
|
|
|
|
|
Session.io.AllowArrow := True;
|
|
|
|
|
|
|
|
Repeat
|
|
|
|
Ch := Session.io.GetKey;
|
|
|
|
|
|
|
|
If Session.io.IsArrow Then Begin
|
|
|
|
Case Ch of
|
|
|
|
#71 : If (TopPage > 1) or (CurLine > 1) Then Begin
|
|
|
|
TopPage := 1;
|
|
|
|
CurLine := 1;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
DrawPage;
|
|
|
|
UpdateCursor;
|
|
|
|
End;
|
|
|
|
#72 : Begin
|
|
|
|
If (CurLine = 1) and (TopPage > 1) Then Begin
|
|
|
|
Dec (TopPage);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
DrawPage;
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End Else If CurLine > 1 Then Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
LinkOFF(TopPage + CurLine - 1, WinY1 + CurLine - 1, CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
Dec (CurLine);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
End;
|
|
|
|
#73 : Begin
|
|
|
|
If TopPage - WinSize > 0 Then Begin
|
|
|
|
Dec (TopPage, WinSize);
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
DrawPage;
|
|
|
|
UpdateCursor;
|
2012-02-15 12:01:43 -08:00
|
|
|
End Else If CurLine > 1 Then Begin
|
2012-02-13 16:50:48 -08:00
|
|
|
TopPage := 1;
|
|
|
|
CurLine := 1;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
DrawPage;
|
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
End;
|
|
|
|
#75 : If (CurLPos > 1) and (Text[TopPage + CurLine - 1].Links > 0) Then Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
LinkOFF(TopPage + CurLine - 1, WinY1 + CurLine - 1, CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
Dec(CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
LinkON;
|
|
|
|
End;
|
|
|
|
#77 : If CurLPos < Text[TopPage + CurLine - 1].Links Then Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
LinkOFF(TopPage + CurLine - 1, WinY1 + CurLine - 1, CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
Inc(CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
LinkON;
|
|
|
|
End;
|
2012-02-15 12:01:43 -08:00
|
|
|
#79 : If TopPage + WinSize <= Lines Then Begin
|
2012-02-13 16:50:48 -08:00
|
|
|
Repeat
|
|
|
|
PageDown;
|
|
|
|
Until TopPage >= Lines - WinSize - 1;
|
2012-02-27 06:30:13 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
DrawPage;
|
|
|
|
UpdateCursor;
|
2012-02-15 12:01:43 -08:00
|
|
|
End Else
|
|
|
|
If TopPage + CurLine <= Lines Then Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
LinkOFF (TopPage + CurLine - 1, WinY1 + CurLine - 1, CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-15 12:01:43 -08:00
|
|
|
CurLine := Lines - TopPage + 1;
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-15 12:01:43 -08:00
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
#80 : Begin
|
|
|
|
If (CurLine = WinSize) and (TopPage + WinSize <= Lines) Then Begin
|
|
|
|
Inc(TopPage);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
DrawPage;
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End Else
|
|
|
|
If (CurLine < WinSize) And (TopPage + CurLine <= Lines) Then Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
LinkOFF(TopPage + CurLine - 1, WinY1 + CurLine - 1, CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
Inc(CurLine);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-14 21:28:26 -08:00
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
End;
|
2012-02-15 12:01:43 -08:00
|
|
|
#81 : If TopPage + WinSize <= Lines Then Begin
|
2012-02-13 16:50:48 -08:00
|
|
|
PageDown;
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
DrawPage;
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
UpdateCursor;
|
2012-02-15 12:01:43 -08:00
|
|
|
End Else
|
|
|
|
If TopPage + CurLine <= Lines Then Begin
|
2012-02-27 06:30:13 -08:00
|
|
|
LinkOFF (TopPage + CurLine - 1, WinY1 + CurLine - 1, CurLPos);
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-15 12:01:43 -08:00
|
|
|
CurLine := Lines - TopPage + 1;
|
2012-03-03 19:07:43 -08:00
|
|
|
|
2012-02-15 12:01:43 -08:00
|
|
|
UpdateCursor;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
2012-02-15 12:01:43 -08:00
|
|
|
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
End Else Begin
|
|
|
|
Case Ch of
|
2012-02-14 22:10:00 -08:00
|
|
|
#08 : Begin
|
|
|
|
If LastPos = 0 Then
|
|
|
|
CurKey := Keyword
|
|
|
|
Else Begin
|
|
|
|
CurKey := LastKey[LastPos];
|
|
|
|
Dec (LastPos);
|
|
|
|
End;
|
|
|
|
|
|
|
|
OK := ReadKeywordData;
|
|
|
|
|
|
|
|
If Not OK Then Begin
|
|
|
|
CurKey := 'INDEX';
|
|
|
|
OK := ReadKeywordData;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Break;
|
|
|
|
End;
|
2012-02-14 22:00:38 -08:00
|
|
|
#13 : If Text[TopPage + CurLine - 1].Links > 0 Then Begin
|
|
|
|
If Text[TopPage + CurLine - 1].Link[CurLPos].Key = '@PREV' Then Begin
|
2012-02-13 16:50:48 -08:00
|
|
|
If LastPos = 0 Then
|
2012-02-14 22:10:00 -08:00
|
|
|
CurKey := Keyword
|
2012-02-13 16:50:48 -08:00
|
|
|
Else Begin
|
|
|
|
CurKey := LastKey[LastPos];
|
|
|
|
Dec (LastPos);
|
|
|
|
End;
|
|
|
|
End Else Begin
|
2012-03-10 00:57:33 -08:00
|
|
|
Case Text[TopPage + CurLine - 1].Link[CurLPos].Key[1] of
|
|
|
|
'!' : Begin
|
|
|
|
Session.io.AnsiColor(7);
|
|
|
|
|
|
|
|
ExecuteMPL(NIL, Copy(Text[TopPage + CurLine - 1].Link[CurLPos].Key, 2, 255));
|
|
|
|
|
|
|
|
ShowTemplate;
|
|
|
|
End;
|
2012-03-18 15:27:20 -07:00
|
|
|
'[' : ExecuteMenuCommands;
|
2012-02-13 16:50:48 -08:00
|
|
|
Else
|
2012-03-10 00:57:33 -08:00
|
|
|
If LastPos < 10 Then
|
|
|
|
Inc (LastPos)
|
|
|
|
Else
|
|
|
|
For Count := 1 to 9 Do LastKey[Count] := LastKey[Count + 1];
|
2012-02-13 16:50:48 -08:00
|
|
|
|
2012-03-10 00:57:33 -08:00
|
|
|
LastKey[LastPos] := CurKey;
|
2012-02-14 22:00:38 -08:00
|
|
|
|
2012-03-10 00:57:33 -08:00
|
|
|
CurKey := Text[TopPage + CurLine - 1].Link[CurLPos].Key;
|
|
|
|
End;
|
2012-02-13 16:50:48 -08:00
|
|
|
End;
|
|
|
|
|
|
|
|
OK := ReadKeywordData;
|
|
|
|
|
|
|
|
If Not OK Then Begin
|
|
|
|
CurKey := 'INDEX';
|
|
|
|
OK := ReadKeywordData;
|
|
|
|
End;
|
|
|
|
|
|
|
|
Break;
|
|
|
|
End;
|
|
|
|
#27 : Begin
|
|
|
|
OK := False;
|
|
|
|
Break;
|
|
|
|
End;
|
|
|
|
End;
|
|
|
|
End;
|
|
|
|
Until False;
|
|
|
|
End;
|
|
|
|
End;
|
|
|
|
|
2012-02-27 06:30:13 -08:00
|
|
|
End.
|