Tons of changes and fixes. Too much to track
This commit is contained in:
parent
88c3d56e82
commit
ac9f49a166
|
@ -454,6 +454,7 @@ Begin
|
||||||
SearchX := 0;
|
SearchX := 0;
|
||||||
SearchY := 0;
|
SearchY := 0;
|
||||||
SearchA := 0;
|
SearchA := 0;
|
||||||
|
TopPage := 1;
|
||||||
|
|
||||||
Session.io.BufFlush;
|
Session.io.BufFlush;
|
||||||
End;
|
End;
|
||||||
|
@ -616,6 +617,9 @@ Begin
|
||||||
WinSize := BY2 - Y1 - 1;
|
WinSize := BY2 - Y1 - 1;
|
||||||
TagPos := X1 + 1;
|
TagPos := X1 + 1;
|
||||||
|
|
||||||
|
While Picked > TopPage + WinSize - 1 Do
|
||||||
|
Inc (TopPage);
|
||||||
|
|
||||||
If PosBar Then
|
If PosBar Then
|
||||||
For Count := 1 to WinSize Do
|
For Count := 1 to WinSize Do
|
||||||
WriteXY (X1 + Width + 1, Y1 + Count, Box.BoxAttr2, #176);
|
WriteXY (X1 + Width + 1, Y1 + Count, Box.BoxAttr2, #176);
|
||||||
|
|
|
@ -20,9 +20,7 @@ Procedure EditArchive (Var Arc: RecArchive);
|
||||||
Var
|
Var
|
||||||
Box : TAnsiMenuBox;
|
Box : TAnsiMenuBox;
|
||||||
Form : TAnsiMenuForm;
|
Form : TAnsiMenuForm;
|
||||||
Topic : String;
|
|
||||||
Begin
|
Begin
|
||||||
Topic := '';
|
|
||||||
Box := TAnsiMenuBox.Create;
|
Box := TAnsiMenuBox.Create;
|
||||||
Form := TAnsiMenuForm.Create;
|
Form := TAnsiMenuForm.Create;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ Type
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Const
|
Const
|
||||||
Num_Cmds = 97;
|
Num_Cmds = 98;
|
||||||
MenuCmds : Array[1..Num_Cmds] of CmdRec = (
|
MenuCmds : Array[1..Num_Cmds] of CmdRec = (
|
||||||
// AUTOSIG MENU COMMANDS
|
// AUTOSIG MENU COMMANDS
|
||||||
( Name: 'AE'; Desc: 'Autosig editor' ),
|
( Name: 'AE'; Desc: 'Autosig editor' ),
|
||||||
|
@ -61,8 +61,8 @@ Const
|
||||||
( Name: 'FU'; Desc: 'Upload files' ),
|
( Name: 'FU'; Desc: 'Upload files' ),
|
||||||
( Name: 'FV'; Desc: 'View archive' ),
|
( Name: 'FV'; Desc: 'View archive' ),
|
||||||
( Name: 'FZ'; Desc: 'Toggle newscan bases' ),
|
( Name: 'FZ'; Desc: 'Toggle newscan bases' ),
|
||||||
( Name: 'F1'; Desc: '(SYSOP) Mass upload' ),
|
( Name: 'F1'; Desc: '(SYS) Mass upload' ),
|
||||||
( Name: 'F2'; Desc: '(SYSOP) Directory editor' ),
|
( Name: 'F2'; Desc: '(SYS) Directory editor' ),
|
||||||
( Name: 'F3'; Desc: 'Send file by location' ),
|
( Name: 'F3'; Desc: 'Send file by location' ),
|
||||||
|
|
||||||
// GENERAL MENU COMMANDS
|
// GENERAL MENU COMMANDS
|
||||||
|
@ -109,6 +109,7 @@ Const
|
||||||
// OFFLINE MAIL MENU COMMANDS
|
// OFFLINE MAIL MENU COMMANDS
|
||||||
( Name: 'OS'; Desc: 'Set QWK scanned bases' ),
|
( Name: 'OS'; Desc: 'Set QWK scanned bases' ),
|
||||||
( Name: 'OD'; Desc: 'Download QWK packet' ),
|
( Name: 'OD'; Desc: 'Download QWK packet' ),
|
||||||
|
( Name: 'OE'; Desc: 'Download QWKE packet' ),
|
||||||
( Name: 'OU'; Desc: 'Upload REP packet' ),
|
( Name: 'OU'; Desc: 'Upload REP packet' ),
|
||||||
|
|
||||||
// DOWNLOAD QUEUE MENU COMMANDS
|
// DOWNLOAD QUEUE MENU COMMANDS
|
||||||
|
@ -144,18 +145,18 @@ Const
|
||||||
( Name: '-Y'; Desc: 'Ask Yes/No (default Yes)' ),
|
( Name: '-Y'; Desc: 'Ask Yes/No (default Yes)' ),
|
||||||
|
|
||||||
// SYSOP/EDITORS MENU COMMANDS
|
// SYSOP/EDITORS MENU COMMANDS
|
||||||
( Name: '*#'; Desc: '(SYSOP) Menu editor' ),
|
( Name: '*#'; Desc: '(SYS) Menu editor' ),
|
||||||
( Name: '*A'; Desc: '(SYSOP) Archive editor' ),
|
( Name: '*A'; Desc: '(SYS) Archive editor' ),
|
||||||
( Name: '*E'; Desc: '(SYSOP) Event editor' ),
|
( Name: '*E'; Desc: '(SYS) Event editor' ),
|
||||||
( Name: '*F'; Desc: '(SYSOP) File base editor' ),
|
( Name: '*F'; Desc: '(SYS) File base editor' ),
|
||||||
( Name: '*G'; Desc: '(SYSOP) Message group editor' ),
|
( Name: '*G'; Desc: '(SYS) Message group editor' ),
|
||||||
( Name: '*L'; Desc: '(SYSOP) Security level editor'),
|
( Name: '*L'; Desc: '(SYS) Security level editor' ),
|
||||||
( Name: '*B'; Desc: '(SYSOP) Message base editor' ),
|
( Name: '*B'; Desc: '(SYS) Message base editor' ),
|
||||||
( Name: '*P'; Desc: '(SYSOP) Protocol editor' ),
|
( Name: '*P'; Desc: '(SYS) Protocol editor' ),
|
||||||
( Name: '*R'; Desc: '(SYSOP) File group editor' ),
|
( Name: '*R'; Desc: '(SYS) File group editor' ),
|
||||||
( Name: '*S'; Desc: '(SYSOP) System configuration' ),
|
( Name: '*S'; Desc: '(SYS) System configuration' ),
|
||||||
( Name: '*U'; Desc: '(SYSOP) User editor' ),
|
( Name: '*U'; Desc: '(SYS) User editor' ),
|
||||||
( Name: '*V'; Desc: '(SYSOP) Voting booth editor' )
|
( Name: '*V'; Desc: '(SYS) Voting booth editor' )
|
||||||
); {123456789012345678901234567890}
|
); {123456789012345678901234567890}
|
||||||
|
|
||||||
Var
|
Var
|
||||||
|
@ -451,23 +452,24 @@ Begin
|
||||||
Box.Header := ' Menu Flags (' + MenuName + ') ';
|
Box.Header := ' Menu Flags (' + MenuName + ') ';
|
||||||
Topic := '|03(|09Menu Flags|03) |01-|09> |15';;
|
Topic := '|03(|09Menu Flags|03) |01-|09> |15';;
|
||||||
|
|
||||||
Box.Open (6, 5, 75, 20);
|
Box.Open (6, 5, 75, 21);
|
||||||
|
|
||||||
VerticalLine (22, 7, 19);
|
VerticalLine (22, 7, 20);
|
||||||
|
|
||||||
Form.AddStr ('D', ' Description' , 9, 7, 24, 7, 13, 30, 30, @Menu.Info.Description, Topic + 'Description of menu');
|
Form.AddStr ('D', ' Description' , 9, 7, 24, 7, 13, 30, 30, @Menu.Info.Description, Topic + 'Description of menu');
|
||||||
Form.AddStr ('A', ' Access' , 14, 8, 24, 8, 8, 30, 30, @Menu.Info.Access, Topic + 'Security requirements to access this menu');
|
Form.AddStr ('A', ' Access' , 14, 8, 24, 8, 8, 30, 30, @Menu.Info.Access, Topic + 'Security requirements to access this menu');
|
||||||
Form.AddTog ('T', ' Menu Type' , 11, 9, 24, 9, 11, 13, 0, 2, 'Standard Lightbar Lightbar/Grid', @Menu.Info.MenuType, Topic + 'Type of menu');
|
Form.AddStr ('B', ' Fallback' , 12, 9, 24, 9, 10, 20, 20, @Menu.Info.Fallback, Topic + 'Menu loaded if user has no access (Blank/Last)');
|
||||||
Form.AddTog ('I', ' Input Type' , 10, 10, 24, 10, 12, 12, 0, 2, 'User_Defined HotKey LongKey', @Menu.Info.InputType, Topic + 'Input type for this menu');
|
Form.AddTog ('T', ' Menu Type' , 11, 10, 24, 10, 11, 13, 0, 2, 'Standard Lightbar Lightbar/Grid', @Menu.Info.MenuType, Topic + 'Type of menu');
|
||||||
Form.AddTog ('C', ' Input Chars' , 9, 11, 24, 11, 13, 9, 0, 2, 'Uppercase Lowercase Hidden', @Menu.Info.CharType, Topic + 'Input format display');
|
Form.AddTog ('I', ' Input Type' , 10, 11, 24, 11, 12, 12, 0, 2, 'User_Defined HotKey LongKey', @Menu.Info.InputType, Topic + 'Input type for this menu');
|
||||||
Form.AddBol ('G', ' Use Global' , 10, 12, 24, 12, 12, 3, @Menu.Info.Global, Topic + 'Include global menu options in this menu?');
|
Form.AddTog ('C', ' Input Chars' , 9, 12, 24, 12, 13, 9, 0, 2, 'Uppercase Lowercase Hidden', @Menu.Info.CharType, Topic + 'Input format display');
|
||||||
Form.AddStr ('N', ' Node Status' , 9, 13, 24, 13, 13, 30, 30, @Menu.Info.NodeStatus, Topic + 'Node/User status set when this menu is loaded');
|
Form.AddBol ('G', ' Use Global' , 10, 13, 24, 13, 12, 3, @Menu.Info.Global, Topic + 'Include global menu options in this menu?');
|
||||||
Form.AddStr ('F', ' Display File', 8, 14, 24, 14, 14, 20, 20, @Menu.Info.DispFile, Topic + 'Display file shown instead of generated menu');
|
Form.AddStr ('N', ' Node Status' , 9, 14, 24, 14, 13, 30, 30, @Menu.Info.NodeStatus, Topic + 'Node/User status set when this menu is loaded');
|
||||||
Form.AddTog ('L', ' Display Cols', 8, 15, 24, 15, 14, 1, 1, 4, '1 2 3 4', @Menu.Info.DispCols, Topic + 'Number of columns in generated menu');
|
Form.AddStr ('F', ' Display File', 8, 15, 24, 15, 14, 20, 20, @Menu.Info.DispFile, Topic + 'Display file shown instead of generated menu');
|
||||||
Form.AddPipe ('H', ' Menu Header' , 9, 16, 24, 16, 13, 50, 160, @Menu.Info.Header, Topic + 'Menu header displayed in generated menu');
|
Form.AddTog ('L', ' Display Cols', 8, 16, 24, 16, 14, 1, 1, 4, '1 2 3 4', @Menu.Info.DispCols, Topic + 'Number of columns in generated menu');
|
||||||
Form.AddPipe ('P', ' Menu Prompt' , 9, 17, 24, 17, 13, 50, 160, @Menu.Info.Footer, Topic + 'Menu prompt displayed in generated menu');
|
Form.AddPipe ('H', ' Menu Header' , 9, 17, 24, 17, 13, 50, 160, @Menu.Info.Header, Topic + 'Menu header displayed in generated menu');
|
||||||
Form.AddByte ('X', ' X' , 19, 18, 24, 18, 3, 2, 0, 80, @Menu.Info.DoneX, Topic + 'Locate to X coordinate after lightbar menu');
|
Form.AddPipe ('P', ' Menu Prompt' , 9, 18, 24, 18, 13, 50, 160, @Menu.Info.Footer, Topic + 'Menu prompt displayed in generated menu');
|
||||||
Form.AddByte ('Y', ' Y' , 19, 19, 24, 19, 3, 2, 0, 50, @Menu.Info.DoneY, Topic + 'Locate to Y coordinate after lightbar menu');
|
Form.AddByte ('X', ' X' , 19, 19, 24, 19, 3, 2, 0, 80, @Menu.Info.DoneX, Topic + 'Locate to X coordinate after lightbar menu');
|
||||||
|
Form.AddByte ('Y', ' Y' , 19, 20, 24, 20, 3, 2, 0, 50, @Menu.Info.DoneY, Topic + 'Locate to Y coordinate after lightbar menu');
|
||||||
|
|
||||||
Form.Execute;
|
Form.Execute;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ Uses
|
||||||
// replace with MDL/FP RTL functions
|
// replace with MDL/FP RTL functions
|
||||||
|
|
||||||
Const
|
Const
|
||||||
WinConsoleTitle = 'Mystic Node ';
|
WinConsoleTitle = mysSoftwareID + ' Node ';
|
||||||
CopyID = 'Copyright (C) ' + mysCopyYear + ' By James Coyle. All Rights Reserved.';
|
CopyID = 'Copyright (C) ' + mysCopyYear + ' By James Coyle. All Rights Reserved.';
|
||||||
DateTypeStr : Array[1..4] of String[8] = ('MM/DD/YY', 'DD/MM/YY', 'YY/DD/MM', 'Ask ');
|
DateTypeStr : Array[1..4] of String[8] = ('MM/DD/YY', 'DD/MM/YY', 'YY/DD/MM', 'Ask ');
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,7 @@ Begin
|
||||||
UserHostInfo := '';
|
UserHostInfo := '';
|
||||||
UserIPInfo := '';
|
UserIPInfo := '';
|
||||||
CheckTimeOut := True;
|
CheckTimeOut := True;
|
||||||
|
TimeOut := TimerSeconds;
|
||||||
TimeOffset := 0;
|
TimeOffset := 0;
|
||||||
TimeSaved := 0;
|
TimeSaved := 0;
|
||||||
TimerOn := False;
|
TimerOn := False;
|
||||||
|
|
|
@ -347,7 +347,7 @@ Begin
|
||||||
|
|
||||||
UpdatePosition;
|
UpdatePosition;
|
||||||
End Else Begin
|
End Else Begin
|
||||||
If CurY < TotalLine Then CurX := 1;
|
{If CurY < TotalLine Then} CurX := 1;
|
||||||
|
|
||||||
keyDownArrow;
|
keyDownArrow;
|
||||||
End;
|
End;
|
||||||
|
|
|
@ -48,7 +48,6 @@ Type
|
||||||
InLimit : Byte;
|
InLimit : Byte;
|
||||||
InSize : Byte;
|
InSize : Byte;
|
||||||
AllowAbort : Boolean;
|
AllowAbort : Boolean;
|
||||||
Aborted : Boolean;
|
|
||||||
NoFile : Boolean;
|
NoFile : Boolean;
|
||||||
Graphics : Byte;
|
Graphics : Byte;
|
||||||
PausePtr : Byte;
|
PausePtr : Byte;
|
||||||
|
@ -138,8 +137,6 @@ Begin
|
||||||
UseInSize := False;
|
UseInSize := False;
|
||||||
InLimit := 0;
|
InLimit := 0;
|
||||||
InSize := 0;
|
InSize := 0;
|
||||||
AllowAbort := False;
|
|
||||||
Aborted := False;
|
|
||||||
NoFile := False;
|
NoFile := False;
|
||||||
Graphics := 1;
|
Graphics := 1;
|
||||||
PausePtr := 1;
|
PausePtr := 1;
|
||||||
|
@ -191,13 +188,11 @@ Begin
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure TBBSIO.BufFlush;
|
Procedure TBBSIO.BufFlush;
|
||||||
Var
|
|
||||||
Res : LongInt;
|
|
||||||
Begin
|
Begin
|
||||||
{$IFDEF WINDOWS}
|
{$IFDEF WINDOWS}
|
||||||
If OutBufPos > 0 Then Begin
|
If OutBufPos > 0 Then Begin
|
||||||
If Not TBBSCore(Core).LocalMode Then
|
If Not TBBSCore(Core).LocalMode Then
|
||||||
Res := TBBSCore(Core).Client.WriteBuf(OutBuffer, OutBufPos);
|
TBBSCore(Core).Client.WriteBuf(OutBuffer, OutBufPos);
|
||||||
|
|
||||||
OutBufPos := 0;
|
OutBufPos := 0;
|
||||||
End;
|
End;
|
||||||
|
@ -462,6 +457,7 @@ Begin
|
||||||
End;
|
End;
|
||||||
'A' : Case Code[2] of
|
'A' : Case Code[2] of
|
||||||
'G' : LastMCIValue := strI2S(DaysAgo(TBBSCore(Core).User.ThisUser.Birthday) DIV 365);
|
'G' : LastMCIValue := strI2S(DaysAgo(TBBSCore(Core).User.ThisUser.Birthday) DIV 365);
|
||||||
|
'O' : AllowAbort := False;
|
||||||
'S' : LastMCIValue := OutON(TBBSCore(Core).User.ThisUser.SigUse);
|
'S' : LastMCIValue := OutON(TBBSCore(Core).User.ThisUser.SigUse);
|
||||||
'V' : LastMCIValue := OutYN(Chat.Available);
|
'V' : LastMCIValue := OutYN(Chat.Available);
|
||||||
End;
|
End;
|
||||||
|
@ -918,16 +914,17 @@ End;
|
||||||
|
|
||||||
Function TBBSIO.OutFile (FName: String; DoPause: Boolean; Speed: Byte) : Boolean;
|
Function TBBSIO.OutFile (FName: String; DoPause: Boolean; Speed: Byte) : Boolean;
|
||||||
Var
|
Var
|
||||||
Buffer : Array[1..4096] of Char;
|
Buffer : Array[1..4096] of Char;
|
||||||
BufPos : LongInt;
|
BufPos : LongInt;
|
||||||
BufSize : LongInt;
|
BufSize : LongInt;
|
||||||
dFile : File;
|
dFile : File;
|
||||||
Ext : String[4];
|
Ext : String[4];
|
||||||
Code : String[2];
|
Code : String[2];
|
||||||
Old : Boolean;
|
SavedPause : Boolean;
|
||||||
Str : String;
|
SavedAbort : Boolean;
|
||||||
Ch : Char;
|
Str : String;
|
||||||
Done : Boolean;
|
Ch : Char;
|
||||||
|
Done : Boolean;
|
||||||
|
|
||||||
Function CheckFileInPath (Path: String) : Boolean;
|
Function CheckFileInPath (Path: String) : Boolean;
|
||||||
Var
|
Var
|
||||||
|
@ -1009,8 +1006,10 @@ Begin
|
||||||
|
|
||||||
NoFile := False;
|
NoFile := False;
|
||||||
Result := True;
|
Result := True;
|
||||||
Old := AllowPause;
|
SavedPause := AllowPause;
|
||||||
|
SavedAbort := AllowAbort;
|
||||||
AllowPause := DoPause;
|
AllowPause := DoPause;
|
||||||
|
AllowAbort := True;
|
||||||
PausePtr := 1;
|
PausePtr := 1;
|
||||||
Done := False;
|
Done := False;
|
||||||
BufPos := 0;
|
BufPos := 0;
|
||||||
|
@ -1027,6 +1026,11 @@ Begin
|
||||||
If BufPos MOD BaudEmulator = 0 Then WaitMS(6);
|
If BufPos MOD BaudEmulator = 0 Then WaitMS(6);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
If AllowAbort And (InKey(0) = #32) Then Begin
|
||||||
|
AnsiColor(7);
|
||||||
|
Break;
|
||||||
|
End;
|
||||||
|
|
||||||
Case Ch of
|
Case Ch of
|
||||||
#10 : Begin
|
#10 : Begin
|
||||||
BufAddChar (#10);
|
BufAddChar (#10);
|
||||||
|
@ -1135,7 +1139,9 @@ Begin
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
AllowPause := Old;
|
AllowPause := SavedPause;
|
||||||
|
AllowAbort := SavedAbort;
|
||||||
|
|
||||||
Close (dFile);
|
Close (dFile);
|
||||||
|
|
||||||
BufFlush;
|
BufFlush;
|
||||||
|
|
|
@ -85,7 +85,7 @@ Begin
|
||||||
|
|
||||||
ReadLn (Menu, Junk.Description);
|
ReadLn (Menu, Junk.Description);
|
||||||
ReadLn (Menu, Junk.Access);
|
ReadLn (Menu, Junk.Access);
|
||||||
ReadLn (Menu, Junk.Password);
|
ReadLn (Menu, Junk.Fallback);
|
||||||
ReadLn (Menu, Flags);
|
ReadLn (Menu, Flags);
|
||||||
ReadLn (Menu, Str); // resv
|
ReadLn (Menu, Str); // resv
|
||||||
ReadLn (Menu, Junk.NodeStatus);
|
ReadLn (Menu, Junk.NodeStatus);
|
||||||
|
@ -180,7 +180,7 @@ Begin
|
||||||
|
|
||||||
WriteLn (Menu, Info.Description);
|
WriteLn (Menu, Info.Description);
|
||||||
WriteLn (Menu, Info.Access);
|
WriteLn (Menu, Info.Access);
|
||||||
WriteLn (Menu, Info.Password);
|
WriteLn (Menu, Info.Fallback);
|
||||||
WriteLn (Menu, Flags);
|
WriteLn (Menu, Flags);
|
||||||
WriteLn (Menu, ''); // resv
|
WriteLn (Menu, ''); // resv
|
||||||
WriteLn (Menu, Info.NodeStatus);
|
WriteLn (Menu, Info.NodeStatus);
|
||||||
|
|
|
@ -279,7 +279,8 @@ Begin
|
||||||
End;
|
End;
|
||||||
'O' : Case Cmd[2] of
|
'O' : Case Cmd[2] of
|
||||||
'S' : Session.Msgs.ToggleNewScan(True);
|
'S' : Session.Msgs.ToggleNewScan(True);
|
||||||
'D' : Session.Msgs.DownloadQWK(CmdData);
|
'D' : Session.Msgs.DownloadQWK(False, CmdData);
|
||||||
|
'E' : Session.Msgs.DownloadQWK(True, CmdData);
|
||||||
'U' : Session.Msgs.UploadREP;
|
'U' : Session.Msgs.UploadREP;
|
||||||
End;
|
End;
|
||||||
'Q' : Case Cmd[2] of
|
'Q' : Case Cmd[2] of
|
||||||
|
@ -594,9 +595,7 @@ Begin
|
||||||
Repeat
|
Repeat
|
||||||
Inc (Count);
|
Inc (Count);
|
||||||
|
|
||||||
If SpecialKey(Data.Item[Count]^.HotKey) Then Continue;
|
If SpecialKey(Data.Item[Count]^.HotKey) Or Not TBBSCore(Owner).User.Access(Data.Item[Count]^.Access) Then Continue;
|
||||||
|
|
||||||
// check command acs for validkey?
|
|
||||||
|
|
||||||
Found := Data.Item[Count]^.HotKey = Temp + UpCase(Ch);
|
Found := Data.Item[Count]^.HotKey = Temp + UpCase(Ch);
|
||||||
|
|
||||||
|
@ -837,6 +836,26 @@ Begin
|
||||||
If TBBSCore(Owner).io.IsArrow Then Begin
|
If TBBSCore(Owner).io.IsArrow Then Begin
|
||||||
Case Data.Info.MenuType of
|
Case Data.Info.MenuType of
|
||||||
1 : Case Ch of
|
1 : Case Ch of
|
||||||
|
#71 : Case ExecuteByHotKey('HOME', -1) of
|
||||||
|
0 : ;
|
||||||
|
1 : Break;
|
||||||
|
2 : Exit;
|
||||||
|
End;
|
||||||
|
#73 : Case ExecuteByHotKey('PAGEUP', -1) of
|
||||||
|
0 : ;
|
||||||
|
1 : Break;
|
||||||
|
2 : Exit;
|
||||||
|
End;
|
||||||
|
#79 : Case ExecuteByHotKey('END', -1) of
|
||||||
|
0 : ;
|
||||||
|
1 : Break;
|
||||||
|
2 : Exit;
|
||||||
|
End;
|
||||||
|
#81 : Case ExecuteByHotKey('PAGEDOWN', -1) of
|
||||||
|
0 : ;
|
||||||
|
1 : Break;
|
||||||
|
2 : Exit;
|
||||||
|
End;
|
||||||
#72,
|
#72,
|
||||||
#75 : Begin
|
#75 : Begin
|
||||||
TempPos := CursorPos;
|
TempPos := CursorPos;
|
||||||
|
@ -898,12 +917,18 @@ Begin
|
||||||
|
|
||||||
AddChar(#8);
|
AddChar(#8);
|
||||||
End;
|
End;
|
||||||
#09 : If Data.Info.MenuType = 2 Then
|
#09 : Begin
|
||||||
Case ExecuteGridCommand(Data.Item[CursorPos]^.JumpTab, 5) of
|
Case Data.Info.MenuType of
|
||||||
|
1 : Count := ExecuteByHotKey('TAB', -1);
|
||||||
|
2 : Count := ExecuteGridCommand(Data.Item[CursorPos]^.JumpEscape, 5);
|
||||||
|
End;
|
||||||
|
|
||||||
|
Case Count of
|
||||||
0 : ;
|
0 : ;
|
||||||
1 : Break;
|
1 : Break;
|
||||||
2 : Exit;
|
2 : Exit;
|
||||||
End;
|
End;
|
||||||
|
End;
|
||||||
#13 : Begin
|
#13 : Begin
|
||||||
TBBSCore(Owner).io.AnsiGotoXY(Data.Info.DoneX, Data.Info.DoneY);
|
TBBSCore(Owner).io.AnsiGotoXY(Data.Info.DoneX, Data.Info.DoneY);
|
||||||
|
|
||||||
|
@ -916,13 +941,18 @@ Begin
|
||||||
|
|
||||||
If Found Then Exit Else Break;
|
If Found Then Exit Else Break;
|
||||||
End;
|
End;
|
||||||
#27 : If Data.Info.MenuType = 2 Then begin
|
#27 : Begin
|
||||||
Case ExecuteGridCommand(Data.Item[CursorPos]^.JumpEscape, 6) of
|
Case Data.Info.MenuType of
|
||||||
|
1 : Count := ExecuteByHotKey('ESCAPE', -1);
|
||||||
|
2 : Count := ExecuteGridCommand(Data.Item[CursorPos]^.JumpEscape, 6);
|
||||||
|
End;
|
||||||
|
|
||||||
|
Case Count of
|
||||||
0 : ;
|
0 : ;
|
||||||
1 : Break;
|
1 : Break;
|
||||||
2 : Exit;
|
2 : Exit;
|
||||||
End;
|
End;
|
||||||
end;
|
End;
|
||||||
Else
|
Else
|
||||||
If Length(TempStr) < mysMaxMenuInput Then Begin
|
If Length(TempStr) < mysMaxMenuInput Then Begin
|
||||||
Found := False;
|
Found := False;
|
||||||
|
@ -932,13 +962,18 @@ Begin
|
||||||
Repeat
|
Repeat
|
||||||
Inc (Count);
|
Inc (Count);
|
||||||
|
|
||||||
If SpecialKey(Data.Item[Count]^.HotKey) Then Continue;
|
If SpecialKey(Data.Item[Count]^.HotKey) or Not TBBSCore(Owner).User.Access(Data.Item[Count]^.Access) Then Continue;
|
||||||
|
|
||||||
Found := Data.Item[Count]^.HotKey = TempStr + UpCase(Ch);
|
Found := Data.Item[Count]^.HotKey = TempStr + UpCase(Ch);
|
||||||
|
|
||||||
|
session.systemlog('comparing cmd: ' + data.item[count]^.hotkey + ' to ' + tempstr + upcase(ch));
|
||||||
|
|
||||||
If Not ValidKey Then
|
If Not ValidKey Then
|
||||||
ValidKey := TempStr + UpCase(Ch) = Copy(Data.Item[Count]^.HotKey, 1, Length(TempStr + Ch));
|
ValidKey := TempStr + UpCase(Ch) = Copy(Data.Item[Count]^.HotKey, 1, Length(TempStr + Ch));
|
||||||
|
|
||||||
|
session.systemlog('valid key is: ' + stri2s(ord(validkey)));
|
||||||
|
session.systemlog('found is: ' + stri2s(ord(found)));
|
||||||
|
|
||||||
Until Found or (Count >= Data.NumItems);
|
Until Found or (Count >= Data.NumItems);
|
||||||
|
|
||||||
If Found And (TBBSCore(Owner).User.Access(Data.Item[Count]^.Access)) Then Begin
|
If Found And (TBBSCore(Owner).User.Access(Data.Item[Count]^.Access)) Then Begin
|
||||||
|
@ -953,9 +988,9 @@ Begin
|
||||||
TBBSCore(Owner).io.AnsiGotoXY(Data.Info.DoneX, Data.Info.DoneY);
|
TBBSCore(Owner).io.AnsiGotoXY(Data.Info.DoneX, Data.Info.DoneY);
|
||||||
|
|
||||||
If Data.Info.MenuType = 1 Then
|
If Data.Info.MenuType = 1 Then
|
||||||
Found := ExecuteCommandList(CursorPos, -1) = 2
|
Found := ExecuteCommandList(Count, -1) = 2
|
||||||
Else
|
Else
|
||||||
Found := ExecuteCommandList(CursorPos, 0) = 2;
|
Found := ExecuteCommandList(Count, 0) = 2;
|
||||||
|
|
||||||
If Found Then Exit Else Break;
|
If Found Then Exit Else Break;
|
||||||
End Else
|
End Else
|
||||||
|
@ -1013,9 +1048,15 @@ Begin
|
||||||
If Not LoadMenu(Forced) Then Exit;
|
If Not LoadMenu(Forced) Then Exit;
|
||||||
|
|
||||||
If Not TBBSCore(Owner).User.Access(Data.Info.Access) Then Begin
|
If Not TBBSCore(Owner).User.Access(Data.Info.Access) Then Begin
|
||||||
|
If Data.Info.Fallback <> '' Then Begin
|
||||||
|
MenuName := Data.Info.Fallback;
|
||||||
|
Exit;
|
||||||
|
End;
|
||||||
|
|
||||||
MenuName := MenuOld;
|
MenuName := MenuOld;
|
||||||
|
|
||||||
TBBSCore(Owner).io.OutFull(TBBSCore(Owner).GetPrompt(149));
|
TBBSCore(Owner).io.OutFull(TBBSCore(Owner).GetPrompt(149));
|
||||||
|
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
252
mystic/mide.pas
252
mystic/mide.pas
|
@ -19,14 +19,18 @@
|
||||||
//
|
//
|
||||||
// ====================================================================
|
// ====================================================================
|
||||||
|
|
||||||
{$I M_OPS.PAS}
|
|
||||||
|
|
||||||
Program MIDE;
|
Program MIDE;
|
||||||
|
|
||||||
|
{$I M_OPS.PAS}
|
||||||
|
|
||||||
Uses
|
Uses
|
||||||
{$IFDEF DEBUG}
|
{$IFDEF DEBUG}
|
||||||
|
LineInfo,
|
||||||
HeapTrc,
|
HeapTrc,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
Unix,
|
||||||
|
{$ENDIF}
|
||||||
DOS,
|
DOS,
|
||||||
m_Types,
|
m_Types,
|
||||||
m_Input,
|
m_Input,
|
||||||
|
@ -37,19 +41,18 @@ Uses
|
||||||
m_QuickSort,
|
m_QuickSort,
|
||||||
m_Strings,
|
m_Strings,
|
||||||
m_FileIO,
|
m_FileIO,
|
||||||
|
m_IniReader,
|
||||||
MPL_Compile;
|
MPL_Compile;
|
||||||
|
|
||||||
{$I RECORDS.PAS}
|
|
||||||
|
|
||||||
Const
|
Const
|
||||||
mideVersion = '2.0.0';
|
mideVersion = '2.0.0';
|
||||||
mideMaxFileLines = 10000;
|
mideMaxFileLines = 10000;
|
||||||
mideMaxOpenFiles = 10;
|
mideMaxOpenFiles = 10;
|
||||||
mideMaxLineSize = 254;
|
mideMaxLineSize = 254;
|
||||||
mideTabSpaces = 2;
|
|
||||||
mideTopY : Byte = 1;
|
mideTopY : Byte = 1;
|
||||||
mideBotY : Byte = 24;
|
mideBotY : Byte = 24;
|
||||||
mideWinSize : Byte = 24;
|
mideWinSize : Byte = 24;
|
||||||
|
mideExecOpts : String[100] = '';
|
||||||
|
|
||||||
colTextString = 27; { 27 }
|
colTextString = 27; { 27 }
|
||||||
colTextKeyword = 31; { 31 }
|
colTextKeyword = 31; { 31 }
|
||||||
|
@ -61,6 +64,14 @@ Const
|
||||||
colEditStatus = 9 + 1 * 16;
|
colEditStatus = 9 + 1 * 16;
|
||||||
colEditPosBar = 9 + 1 * 16;
|
colEditPosBar = 9 + 1 * 16;
|
||||||
|
|
||||||
|
Var
|
||||||
|
cfg_TabSpaces : Byte;
|
||||||
|
cfg_Screen50 : Boolean;
|
||||||
|
cfg_AutoIndent : Boolean;
|
||||||
|
cfg_ExecPath : String[160];
|
||||||
|
cfg_ExecUser : String[35];
|
||||||
|
cfg_ExecPW : String[20];
|
||||||
|
|
||||||
Type
|
Type
|
||||||
PEditorWindow = ^TEditorWindow;
|
PEditorWindow = ^TEditorWindow;
|
||||||
TEditorWindow = Object
|
TEditorWindow = Object
|
||||||
|
@ -217,7 +228,7 @@ Begin
|
||||||
ReadLn (TF, Str);
|
ReadLn (TF, Str);
|
||||||
|
|
||||||
While Pos (#9, Str) > 0 Do Begin
|
While Pos (#9, Str) > 0 Do Begin
|
||||||
Insert (strRep(' ', mideTabSpaces), Str, Pos(#9, Str));
|
Insert (strRep(' ', cfg_TabSpaces), Str, Pos(#9, Str));
|
||||||
Delete (Str, Pos(#9, Str), 1);
|
Delete (Str, Pos(#9, Str), 1);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -254,7 +265,7 @@ Begin
|
||||||
Load := True;
|
Load := True;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure DrawLine (Y : Byte; S : String);
|
Procedure DrawLine (Y: Byte; S: String);
|
||||||
Var
|
Var
|
||||||
sPos : Byte;
|
sPos : Byte;
|
||||||
|
|
||||||
|
@ -271,7 +282,6 @@ Var
|
||||||
If Console.CursorX < 79 Then Console.WriteChar (Str[A]);
|
If Console.CursorX < 79 Then Console.WriteChar (Str[A]);
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
Console.WriteXY (2, Y, colTextNormal, strPadR(Copy(S, CurWin[CurWinNum]^.ScrlX + 1, 255), 77, ' '));
|
Console.WriteXY (2, Y, colTextNormal, strPadR(Copy(S, CurWin[CurWinNum]^.ScrlX + 1, 255), 77, ' '));
|
||||||
End;
|
End;
|
||||||
|
@ -434,6 +444,7 @@ Begin
|
||||||
FileList.HiChars := #77;
|
FileList.HiChars := #77;
|
||||||
FileList.HiAttr := ColorBar;
|
FileList.HiAttr := ColorBar;
|
||||||
FileList.LoAttr := ColorBox;
|
FileList.LoAttr := ColorBox;
|
||||||
|
|
||||||
DirList.NoWindow := True;
|
DirList.NoWindow := True;
|
||||||
DirList.NoInput := True;
|
DirList.NoInput := True;
|
||||||
DirList.HiAttr := ColorBox;
|
DirList.HiAttr := ColorBox;
|
||||||
|
@ -613,35 +624,41 @@ Begin
|
||||||
FillScreen;
|
FillScreen;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function Get_File_Name (Def: String) : String;
|
Function InBox (Header, Text, Def: String; Len, MaxLen: Byte) : String;
|
||||||
Var
|
Var
|
||||||
Box : TMenuBox;
|
Box : TMenuBox;
|
||||||
InKey : TMenuInput;
|
Input : TMenuInput;
|
||||||
Str : String;
|
Offset : Byte;
|
||||||
|
Str : String;
|
||||||
|
WinSize : Byte;
|
||||||
Begin
|
Begin
|
||||||
Box := TMenuBox.Create(Console);
|
If Len > Length(Text) Then
|
||||||
InKey := TMenuInput.Create(Console);
|
Offset := Len
|
||||||
|
|
||||||
InKey.LoChars := #13#27;
|
|
||||||
|
|
||||||
Box.Header := ' Save a file ';
|
|
||||||
Box.Open (10, 8, 70, 13);
|
|
||||||
|
|
||||||
Console.WriteXY (12, 10, 112, 'File name:');
|
|
||||||
|
|
||||||
Str := InKey.GetStr(12, 11, 57, 255, 1, Def);
|
|
||||||
|
|
||||||
If InKey.ExitCode = #27 Then
|
|
||||||
Str := ''
|
|
||||||
Else
|
Else
|
||||||
If Pos('.', Str) = 0 Then Str := Str + '.mps';
|
Offset := Length(Text);
|
||||||
|
|
||||||
|
WinSize := (80 - Offset + 2) DIV 2;
|
||||||
|
|
||||||
|
Box := TMenuBox.Create(Console);
|
||||||
|
Input := TMenuInput.Create(Console);
|
||||||
|
|
||||||
|
Box.Header := ' ' + Header + ' ';
|
||||||
|
Input.LoChars := #13#27;
|
||||||
|
|
||||||
|
Box.Open (WinSize, 10, WinSize + Offset + 3, 15);
|
||||||
|
|
||||||
|
Console.WriteXY (WinSize + 2, 12, 112, Text);
|
||||||
|
|
||||||
|
Str := Input.GetStr(WinSize + 2, 13, Len, MaxLen, 1, Def);
|
||||||
|
|
||||||
Box.Close;
|
Box.Close;
|
||||||
|
|
||||||
InKey.Free;
|
If Input.ExitCode = #27 Then Str := '';
|
||||||
|
|
||||||
|
Input.Free;
|
||||||
Box.Free;
|
Box.Free;
|
||||||
|
|
||||||
Get_File_Name := Str;
|
Result := Str;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function SaveFile (FNum: Byte; Check, AskReName: Boolean) : Boolean;
|
Function SaveFile (FNum: Byte; Check, AskReName: Boolean) : Boolean;
|
||||||
|
@ -667,7 +684,7 @@ Begin
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
If AskReName Then
|
If AskReName Then
|
||||||
S := Get_File_Name(CurWin[FNum]^.FileName)
|
S := InBox('File', 'File Name:', CurWin[FNum]^.FileName, 50, 255)
|
||||||
Else
|
Else
|
||||||
S := CurWin[FNum]^.FileName;
|
S := CurWin[FNum]^.FileName;
|
||||||
|
|
||||||
|
@ -737,11 +754,13 @@ Begin
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure Compile;
|
Function Compile : Boolean;
|
||||||
Var
|
Var
|
||||||
Box : TMenuBox;
|
Box : TMenuBox;
|
||||||
Compile : TParserEngine;
|
Compile : TParserEngine;
|
||||||
Begin
|
Begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
If CurWinNum = 0 Then Exit;
|
If CurWinNum = 0 Then Exit;
|
||||||
|
|
||||||
If Not SaveFile(CurWinNum, True, False) Then Exit;
|
If Not SaveFile(CurWinNum, True, False) Then Exit;
|
||||||
|
@ -755,16 +774,46 @@ Begin
|
||||||
Console.WriteXY (16, 11, 112, 'Message: Ok');
|
Console.WriteXY (16, 11, 112, 'Message: Ok');
|
||||||
Console.WriteXY (11, 13, 31, strPadC('Working...', 59, ' '));
|
Console.WriteXY (11, 13, 31, strPadC('Working...', 59, ' '));
|
||||||
|
|
||||||
Compile := TParserEngine.Create(@CompileStatusUpdate);
|
Compile := TParserEngine.Create(CompileStatusUpdate);
|
||||||
Compile.Compile(CurWin[CurWinNum]^.FileName);
|
Result := Compile.Compile(CurWin[CurWinNum]^.FileName);
|
||||||
Compile.Free;
|
|
||||||
|
|
||||||
|
Compile.Free;
|
||||||
Box.Close;
|
Box.Close;
|
||||||
Box.Free;
|
Box.Free;
|
||||||
|
|
||||||
CurWin[CurWinNum]^.ReDrawFull;
|
CurWin[CurWinNum]^.ReDrawFull;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Procedure RunProgram;
|
||||||
|
Var
|
||||||
|
Image : TConsoleImageRec;
|
||||||
|
CmdStr : String;
|
||||||
|
Begin
|
||||||
|
If Not Compile Then Exit;
|
||||||
|
|
||||||
|
Console.GetScreenImage(1, 1, 80, Console.ScreenSize, Image);
|
||||||
|
|
||||||
|
mideExecOpts := InBox('Execute', 'Enter optional data or blank for none:', mideExecOpts, 50, 100);
|
||||||
|
|
||||||
|
CmdStr := cfg_ExecPath + 'mystic' + ' -u' + cfg_ExecUser + ' -p' + cfg_ExecPW + ' -x' + JustFileName(CurWin[CurWinNum]^.FileName);
|
||||||
|
|
||||||
|
If mideExecOpts <> '' Then
|
||||||
|
CmdStr := CmdStr + '_' + strReplace(mideExecOpts, ' ', '_');
|
||||||
|
|
||||||
|
// save directory?
|
||||||
|
|
||||||
|
{$IFDEF UNIX}
|
||||||
|
Shell (CmdStr);
|
||||||
|
{$ELSE}
|
||||||
|
Exec (GetEnv('COMSPEC'), '/C' + CmdStr);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
// restore directory?
|
||||||
|
|
||||||
|
Console.PutScreenImage(Image);
|
||||||
|
End;
|
||||||
|
|
||||||
|
|
||||||
Procedure CloseFile;
|
Procedure CloseFile;
|
||||||
Var
|
Var
|
||||||
A : Byte;
|
A : Byte;
|
||||||
|
@ -960,44 +1009,20 @@ Begin
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure DownArrow;
|
Procedure DownArrow;
|
||||||
{Var
|
|
||||||
Count : Byte;}
|
|
||||||
Begin
|
Begin
|
||||||
If CurWinNum = 0 Then Exit;
|
If CurWinNum = 0 Then Exit;
|
||||||
|
|
||||||
(*
|
With CurWin[CurWinNum]^ Do Begin
|
||||||
If AnyShift Then Begin
|
If CurLine = TotalLines Then Exit;
|
||||||
Clips := 0;
|
Inc (CurLine);
|
||||||
ClipNow := True;
|
|
||||||
|
|
||||||
ClipMarkText;
|
If CurY < (mideWinSize - 2) Then
|
||||||
|
Inc (CurY)
|
||||||
|
Else
|
||||||
|
ScrollDown;
|
||||||
|
|
||||||
Repeat
|
Relocate(False);
|
||||||
If KeyPressed Then
|
End;
|
||||||
Case ReadKey of
|
|
||||||
#00 : Case ReadKey of
|
|
||||||
#72 : ClipDeleteText;
|
|
||||||
{ #73 : For Count := 1 to 21 Do ClipDeleteText;}
|
|
||||||
#80 : ClipMarkText;
|
|
||||||
{ #81 : For Count := 1 to 21 Do ClipMarkText;}
|
|
||||||
End;
|
|
||||||
End;
|
|
||||||
Until Not AnyShift;
|
|
||||||
|
|
||||||
ClipCopyText;
|
|
||||||
End Else
|
|
||||||
*)
|
|
||||||
With CurWin[CurWinNum]^ Do Begin
|
|
||||||
If CurLine = TotalLines Then Exit;
|
|
||||||
Inc (CurLine);
|
|
||||||
|
|
||||||
If CurY < (mideWinSize - 2) Then
|
|
||||||
Inc (CurY)
|
|
||||||
Else
|
|
||||||
ScrollDown;
|
|
||||||
|
|
||||||
Relocate(False);
|
|
||||||
End;
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure UpArrow;
|
Procedure UpArrow;
|
||||||
|
@ -1120,7 +1145,7 @@ Var
|
||||||
Begin
|
Begin
|
||||||
If CurWinNum = 0 Then Exit;
|
If CurWinNum = 0 Then Exit;
|
||||||
|
|
||||||
For A := 1 to mideTabSpaces Do
|
For A := 1 to cfg_TabSpaces Do
|
||||||
AddChar(' ');
|
AddChar(' ');
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -1140,9 +1165,9 @@ Begin
|
||||||
S1 := TextData[CurLine]^;
|
S1 := TextData[CurLine]^;
|
||||||
S2 := TextData[CurLine + 1]^;
|
S2 := TextData[CurLine + 1]^;
|
||||||
|
|
||||||
{If Config.AutoIndent Then}
|
If cfg_AutoIndent Then
|
||||||
If (S2 = '') Then
|
If (S2 = '') Then
|
||||||
While S1[Indent] = ' ' Do Inc(Indent);
|
While S1[Indent] = ' ' Do Inc(Indent);
|
||||||
|
|
||||||
S2 := strStripB(Copy(S1, CurX+ScrlX, 255) + S2, ' ');
|
S2 := strStripB(Copy(S1, CurX+ScrlX, 255) + S2, ' ');
|
||||||
Delete (S1, CurX+ScrlX, 255);
|
Delete (S1, CurX+ScrlX, 255);
|
||||||
|
@ -1331,7 +1356,7 @@ Begin
|
||||||
Break;
|
Break;
|
||||||
End;
|
End;
|
||||||
'N' : Begin
|
'N' : Begin
|
||||||
Str := Get_File_Name('new.mps');
|
Str := InBox('New MPL Program', 'File Name:', 'new.mps', 50, 255);
|
||||||
Make := True;
|
Make := True;
|
||||||
|
|
||||||
If Str <> '' Then Begin
|
If Str <> '' Then Begin
|
||||||
|
@ -1408,9 +1433,10 @@ Begin
|
||||||
End;
|
End;
|
||||||
3 : Begin
|
3 : Begin
|
||||||
CoolBoxOpen (26, 'Compile');
|
CoolBoxOpen (26, 'Compile');
|
||||||
BoxOpen (27, 4, 42, 6);
|
BoxOpen (27, 4, 42, 7);
|
||||||
|
|
||||||
Form.AddNone('C', ' Compile F9 ' , 28, 5, 14, 'Compile current file into Mystic executable');
|
Form.AddNone('R', ' Run F8 ' , 28, 5, 14, 'Compile and then execute MPL program');
|
||||||
|
Form.AddNone('C', ' Compile F9 ' , 28, 6, 14, 'Compile current file into Mystic executable');
|
||||||
|
|
||||||
Res := Form.Execute;
|
Res := Form.Execute;
|
||||||
|
|
||||||
|
@ -1432,16 +1458,22 @@ Begin
|
||||||
DrawStatus;
|
DrawStatus;
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
'R' : Begin
|
||||||
|
Console.PutScreenImage(Image);
|
||||||
|
Form.Free;
|
||||||
|
RunProgram;
|
||||||
|
DrawStatus;
|
||||||
|
Exit;
|
||||||
|
End;
|
||||||
Else
|
Else
|
||||||
MenuPtr := 0;
|
MenuPtr := 0;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
4 : Begin
|
4 : Begin
|
||||||
CoolBoxOpen (41, 'Options');
|
CoolBoxOpen (41, 'Options');
|
||||||
BoxOpen (42, 4, 61, 7);
|
BoxOpen (42, 4, 61, 6);
|
||||||
|
|
||||||
Form.AddNone('E', ' Editor Options ', 43, 5, 18, '');
|
Form.AddNone('E', ' Editor Options ', 43, 5, 18, '');
|
||||||
Form.AddNone('C', ' Color Options ' , 43, 6, 18, '');
|
|
||||||
|
|
||||||
Res := Form.Execute;
|
Res := Form.Execute;
|
||||||
|
|
||||||
|
@ -1456,7 +1488,13 @@ Begin
|
||||||
Else
|
Else
|
||||||
Case Res of
|
Case Res of
|
||||||
#27 : Break;
|
#27 : Break;
|
||||||
'C' : Begin
|
'E' : Begin
|
||||||
|
Console.PutScreenImage(Image);
|
||||||
|
Form.Free;
|
||||||
|
LoadAndOpen(StartDir + 'mide.ini');
|
||||||
|
ReDrawScreen;
|
||||||
|
DrawStatus;
|
||||||
|
Exit;
|
||||||
End;
|
End;
|
||||||
Else
|
Else
|
||||||
MenuPtr := 0;
|
MenuPtr := 0;
|
||||||
|
@ -1544,11 +1582,11 @@ Begin
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Var
|
Var
|
||||||
Ch : Char;
|
Ch : Char;
|
||||||
A : Byte;
|
A : Byte;
|
||||||
Str : String;
|
Str : String;
|
||||||
FN : String;
|
FN : String;
|
||||||
Mode50 : Boolean = False;
|
INI : TINIReader;
|
||||||
Begin
|
Begin
|
||||||
GetDir (0, StartDir);
|
GetDir (0, StartDir);
|
||||||
|
|
||||||
|
@ -1559,14 +1597,20 @@ Begin
|
||||||
|
|
||||||
Console.SetWindowTitle('MIDE');
|
Console.SetWindowTitle('MIDE');
|
||||||
|
|
||||||
For A := 1 to ParamCount Do Begin
|
INI := TINIReader.Create('mide.ini');
|
||||||
If Pos('-50', ParamStr(A)) > 0 Then
|
|
||||||
Mode50 := True
|
|
||||||
Else
|
|
||||||
Str := ParamStr(A);
|
|
||||||
End;
|
|
||||||
|
|
||||||
If Mode50 Then Begin
|
cfg_Screen50 := (INI.ReadInteger('General', 'screenmode', 25) = 50);
|
||||||
|
cfg_TabSpaces := INI.ReadInteger('General', 'tab_spaces', 2);
|
||||||
|
cfg_AutoIndent := strUpper(INI.ReadString('General', 'auto_indent', 'true')) = 'TRUE';
|
||||||
|
cfg_ExecPath := DirSlash(INI.ReadString('Execute', 'rootpath', ''));
|
||||||
|
cfg_ExecUser := INI.ReadString('Execute', 'username', 'Guest');
|
||||||
|
cfg_ExecPW := INI.ReadString('Execute', 'password', 'Guest');
|
||||||
|
|
||||||
|
INI.Free;
|
||||||
|
|
||||||
|
Str := ParamStr(1);
|
||||||
|
|
||||||
|
If cfg_Screen50 Then Begin
|
||||||
Console.SetScreenSize(50);
|
Console.SetScreenSize(50);
|
||||||
|
|
||||||
mideBotY := 49;
|
mideBotY := 49;
|
||||||
|
@ -1612,36 +1656,12 @@ Begin
|
||||||
|
|
||||||
Ch := Input.ReadKey;
|
Ch := Input.ReadKey;
|
||||||
|
|
||||||
{ alt+0..9 - change windows }
|
|
||||||
{ alt-x - quit }
|
|
||||||
//{ f1 - help on keyword }
|
|
||||||
{ f2 - save }
|
|
||||||
//{ f3 - open }
|
|
||||||
{ f9 - compile }
|
|
||||||
|
|
||||||
Case Ch of
|
Case Ch of
|
||||||
#00 : Begin
|
#00 : Begin
|
||||||
Ch := Input.ReadKey;
|
Ch := Input.ReadKey;
|
||||||
|
|
||||||
Case Ch of
|
Case Ch of
|
||||||
(*
|
|
||||||
#25 : If (Clips > 0) and (CurWinNum <> 0) Then Begin
|
|
||||||
For A := 0 to Clips - 1 Do Begin
|
|
||||||
InsertLine (CurWin[CurWinNum]^.CurLine + A);
|
|
||||||
CurWin[CurWinNum]^.TextData[CurWin[CurWinNum]^.CurLine + A]^ := ClipData[A + 1];
|
|
||||||
End;
|
|
||||||
DrawPage;
|
|
||||||
End;
|
|
||||||
*)
|
|
||||||
#45 : Break;
|
#45 : Break;
|
||||||
(*
|
|
||||||
#46 : Begin
|
|
||||||
Clips := 0;
|
|
||||||
StatusLineBot('');
|
|
||||||
End;
|
|
||||||
|
|
||||||
#59 : ShowHelp;
|
|
||||||
*)
|
|
||||||
#60 : If TotalWinNum > 0 Then SaveFile(CurWinNum, False, False);
|
#60 : If TotalWinNum > 0 Then SaveFile(CurWinNum, False, False);
|
||||||
#61 : If TotalWinNum < mideMaxOpenFiles Then Begin
|
#61 : If TotalWinNum < mideMaxOpenFiles Then Begin
|
||||||
Str := StartDir;
|
Str := StartDir;
|
||||||
|
@ -1654,7 +1674,7 @@ Begin
|
||||||
#62 : If TotalWinNum > 0 Then CloseFile;
|
#62 : If TotalWinNum > 0 Then CloseFile;
|
||||||
// #63 : SearchText(False);
|
// #63 : SearchText(False);
|
||||||
// #64 : SearchText(True);
|
// #64 : SearchText(True);
|
||||||
// #66 : Options;
|
#66 : RunProgram;
|
||||||
#67 : Compile;
|
#67 : Compile;
|
||||||
#71 : If CurWinNum > 0 Then Begin {home}
|
#71 : If CurWinNum > 0 Then Begin {home}
|
||||||
CurWin[CurWinNum]^.CurX := 1;
|
CurWin[CurWinNum]^.CurX := 1;
|
||||||
|
|
|
@ -70,7 +70,9 @@ Var
|
||||||
TopPage : Integer;
|
TopPage : Integer;
|
||||||
BarPos : Integer;
|
BarPos : Integer;
|
||||||
NodeData : TNodeData;
|
NodeData : TNodeData;
|
||||||
|
{$IFDEF UNIX}
|
||||||
DaemonMode : Boolean = False;
|
DaemonMode : Boolean = False;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{$I MIS_ANSIWFC.PAS}
|
{$I MIS_ANSIWFC.PAS}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,7 @@ Type
|
||||||
OutFile : File;
|
OutFile : File;
|
||||||
CurFile : Byte;
|
CurFile : Byte;
|
||||||
Ch : Char;
|
Ch : Char;
|
||||||
|
LastCharPos : LongInt;
|
||||||
IdentStr : String;
|
IdentStr : String;
|
||||||
AllowOutput : Boolean;
|
AllowOutput : Boolean;
|
||||||
UpdateProc : TParserUpdateProc;
|
UpdateProc : TParserUpdateProc;
|
||||||
|
@ -267,18 +268,20 @@ Begin
|
||||||
UpdateInfo.ErrorLine := 1;
|
UpdateInfo.ErrorLine := 1;
|
||||||
UpdateInfo.ErrorCol := 0;
|
UpdateInfo.ErrorCol := 0;
|
||||||
|
|
||||||
InFile[CurFile].DataFile.Seek(0);
|
If InFile[CurFile].DataFile.Opened Then Begin
|
||||||
|
InFile[CurFile].DataFile.Seek(0);
|
||||||
|
|
||||||
While Not InFile[CurFile].DataFile.EOF And (InFile[CurFile].DataFile.FilePos < InFile[CurFile].Position) Do Begin
|
While Not InFile[CurFile].DataFile.EOF And (InFile[CurFile].DataFile.FilePos < InFile[CurFile].Position) Do Begin
|
||||||
Case InFile[CurFile].DataFile.Read of
|
Case InFile[CurFile].DataFile.Read of
|
||||||
#10 : Begin
|
#10 : Begin
|
||||||
Inc (UpdateInfo.ErrorLine);
|
Inc (UpdateInfo.ErrorLine);
|
||||||
UpdateInfo.ErrorCol := 0;
|
UpdateInfo.ErrorCol := 0;
|
||||||
End;
|
End;
|
||||||
#09,
|
#09,
|
||||||
#13 : ;
|
#13 : ;
|
||||||
Else
|
Else
|
||||||
Inc (UpdateInfo.ErrorCol);
|
Inc (UpdateInfo.ErrorCol);
|
||||||
|
End;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
|
@ -469,6 +472,8 @@ Var
|
||||||
BlockStart : Char;
|
BlockStart : Char;
|
||||||
Str : String;
|
Str : String;
|
||||||
Begin
|
Begin
|
||||||
|
LastCharPos := InFile[CurFile].Position;
|
||||||
|
|
||||||
GetChar;
|
GetChar;
|
||||||
|
|
||||||
While Not UpdateInfo.ErrorType <> 0 Do Begin
|
While Not UpdateInfo.ErrorType <> 0 Do Begin
|
||||||
|
@ -608,9 +613,11 @@ End;
|
||||||
Function TParserEngine.GetStr (Str: String; Forced, CheckSpace: Boolean) : Boolean;
|
Function TParserEngine.GetStr (Str: String; Forced, CheckSpace: Boolean) : Boolean;
|
||||||
Var
|
Var
|
||||||
Count : Byte;
|
Count : Byte;
|
||||||
|
Saved : LongInt;
|
||||||
Begin
|
Begin
|
||||||
Result := False;
|
Result := False;
|
||||||
Count := 1;
|
Count := 1;
|
||||||
|
Saved := LastCharPos;
|
||||||
|
|
||||||
If Not Forced Then SavePosition;
|
If Not Forced Then SavePosition;
|
||||||
|
|
||||||
|
@ -618,9 +625,10 @@ Begin
|
||||||
NextChar;
|
NextChar;
|
||||||
|
|
||||||
If UpCase(Ch) <> UpCase(Str[Count]) Then
|
If UpCase(Ch) <> UpCase(Str[Count]) Then
|
||||||
If Forced Then
|
If Forced Then Begin
|
||||||
|
InFile[CurFile].Position := Saved;
|
||||||
Error(mpsExpected, Str)
|
Error(mpsExpected, Str)
|
||||||
Else Begin
|
End Else Begin
|
||||||
LoadPosition;
|
LoadPosition;
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
@ -2804,8 +2812,11 @@ Begin
|
||||||
|
|
||||||
If Not InFile[CurFile].DataFile.Open(FN) Then Begin
|
If Not InFile[CurFile].DataFile.Open(FN) Then Begin
|
||||||
InFile[CurFile].DataFile.Done;
|
InFile[CurFile].DataFile.Done;
|
||||||
|
|
||||||
Error (mpsFileNotFound, FN);
|
Error (mpsFileNotFound, FN);
|
||||||
|
|
||||||
If CurFile > 1 Then Dec (CurFile);
|
If CurFile > 1 Then Dec (CurFile);
|
||||||
|
|
||||||
Exit;
|
Exit;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
@ -2830,13 +2841,17 @@ Var
|
||||||
VerStr : String;
|
VerStr : String;
|
||||||
Count : Byte;
|
Count : Byte;
|
||||||
Begin
|
Begin
|
||||||
Result := False;
|
Result := False;
|
||||||
VerStr := mplVersion;
|
VerStr := mplVersion;
|
||||||
UsesUSER := False;
|
UsesUSER := False;
|
||||||
UsesCFG := False;
|
UsesCFG := False;
|
||||||
|
UsesMBASE := False;
|
||||||
|
UsesMGROUP := False;
|
||||||
|
UsesFBASE := False;
|
||||||
|
UsesFGROUP := False;
|
||||||
|
|
||||||
Assign (OutFile, JustFileName(FN) + mplExtExecute);
|
Assign (OutFile, JustFileName(FN) + mplExtExecute);
|
||||||
{$I-} ReWrite (OutFile, 1); {$I+}
|
ReWrite (OutFile, 1);
|
||||||
|
|
||||||
If IoResult <> 0 Then Begin
|
If IoResult <> 0 Then Begin
|
||||||
Error (mpsOutputFile, 'File could be in use');
|
Error (mpsOutputFile, 'File could be in use');
|
||||||
|
@ -2853,6 +2868,7 @@ Begin
|
||||||
For Count := 1 to CurFile Do Begin
|
For Count := 1 to CurFile Do Begin
|
||||||
InFile[Count].DataFile.Close;
|
InFile[Count].DataFile.Close;
|
||||||
InFile[Count].DataFile.Done;
|
InFile[Count].DataFile.Done;
|
||||||
|
|
||||||
If IoResult <> 0 Then ;
|
If IoResult <> 0 Then ;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ Function TInterpEngine.GetMBaseStats (Num: LongInt; Var Total, New, Yours: LongI
|
||||||
Var
|
Var
|
||||||
M : RecMessageBase;
|
M : RecMessageBase;
|
||||||
Begin
|
Begin
|
||||||
Result := Session.Msgs.GetRecord(Num, M);
|
Result := Session.Msgs.GetBaseByNum(Num, M);
|
||||||
|
|
||||||
If Result Then
|
If Result Then
|
||||||
Session.Msgs.GetMessageStats(M, Total, New, Yours);
|
Session.Msgs.GetMessageStats(M, Total, New, Yours);
|
||||||
|
@ -258,7 +258,7 @@ Function TInterpEngine.GetMBaseRecord (Num: LongInt) : Boolean;
|
||||||
Var
|
Var
|
||||||
M : RecMessageBase;
|
M : RecMessageBase;
|
||||||
Begin
|
Begin
|
||||||
Result := Session.Msgs.GetRecord(Num, M);
|
Result := Session.Msgs.GetBaseByNum(Num, M);
|
||||||
If Result Then GetMBaseVars(M);
|
If Result Then GetMBaseVars(M);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{$I M_OPS.PAS}
|
|
||||||
|
|
||||||
Unit MPL_FileIO;
|
Unit MPL_FileIO;
|
||||||
|
|
||||||
|
{$I M_OPS.PAS}
|
||||||
|
|
||||||
// all file io units should be compiled into one source file...
|
// all file io units should be compiled into one source file...
|
||||||
// also, make this ONLY allocate the size of the file if the file size is
|
// also, make this ONLY allocate the size of the file if the file size is
|
||||||
// less than the buffer.
|
// less than the buffer.
|
||||||
|
@ -25,6 +25,7 @@ Type
|
||||||
BufPos : LongInt;
|
BufPos : LongInt;
|
||||||
InFile : File;
|
InFile : File;
|
||||||
BufEOF : Boolean;
|
BufEOF : Boolean;
|
||||||
|
Opened : Boolean;
|
||||||
|
|
||||||
Constructor Init (BufferSize: LongInt);
|
Constructor Init (BufferSize: LongInt);
|
||||||
Destructor Done;
|
Destructor Done;
|
||||||
|
@ -70,6 +71,7 @@ Begin
|
||||||
BufEOF := False;
|
BufEOF := False;
|
||||||
BufRead := 0;
|
BufRead := 0;
|
||||||
Buffer := NIL;
|
Buffer := NIL;
|
||||||
|
Opened := False;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Destructor TCharFile.Done;
|
Destructor TCharFile.Done;
|
||||||
|
@ -83,6 +85,7 @@ End;
|
||||||
Function TCharFile.Open (FN : String) : Boolean;
|
Function TCharFile.Open (FN : String) : Boolean;
|
||||||
Begin
|
Begin
|
||||||
Open := False;
|
Open := False;
|
||||||
|
Opened := False;
|
||||||
FileMode := 66;
|
FileMode := 66;
|
||||||
|
|
||||||
Assign (InFile, FN);
|
Assign (InFile, FN);
|
||||||
|
@ -99,12 +102,15 @@ Begin
|
||||||
|
|
||||||
FillBuffer;
|
FillBuffer;
|
||||||
|
|
||||||
Open := True;
|
Open := True;
|
||||||
|
Opened := True;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure TCharFile.Close;
|
Procedure TCharFile.Close;
|
||||||
Begin
|
Begin
|
||||||
System.Close (InFile);
|
System.Close (InFile);
|
||||||
|
Opened := False;
|
||||||
|
|
||||||
Done;
|
Done;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ Begin
|
||||||
Session.UserHostInfo := Copy(Temp, 5, Length(Temp))
|
Session.UserHostInfo := Copy(Temp, 5, Length(Temp))
|
||||||
Else
|
Else
|
||||||
If Pos('-HOST', Temp) > 0 Then
|
If Pos('-HOST', Temp) > 0 Then
|
||||||
Session.UserHostInfo := Copy(Temp, 6, Length(Temp))
|
Session.UserHostInfo := Copy(ParamStr(Count), 6, Length(Temp))
|
||||||
Else
|
Else
|
||||||
If Pos('-U', Temp) > 0 Then
|
If Pos('-U', Temp) > 0 Then
|
||||||
UserName := strReplace(Copy(Temp, 3, Length(Temp)), '_', ' ')
|
UserName := strReplace(Copy(Temp, 3, Length(Temp)), '_', ' ')
|
||||||
|
@ -403,7 +403,7 @@ Begin
|
||||||
Password := Copy(Temp, 3, Length(Temp))
|
Password := Copy(Temp, 3, Length(Temp))
|
||||||
Else
|
Else
|
||||||
If Pos('-X', Temp) > 0 Then
|
If Pos('-X', Temp) > 0 Then
|
||||||
Script := strReplace(Copy(Temp, 3, Length(Temp)), '_', ' ')
|
Script := strReplace(Copy(ParamStr(Count), 3, Length(Temp)), '_', ' ')
|
||||||
Else
|
Else
|
||||||
If Temp = '-L' Then Session.LocalMode := True;
|
If Temp = '-L' Then Session.LocalMode := True;
|
||||||
End;
|
End;
|
||||||
|
|
|
@ -562,7 +562,7 @@ Type
|
||||||
Description : String[30];
|
Description : String[30];
|
||||||
Access : String[mysMaxAcsSize];
|
Access : String[mysMaxAcsSize];
|
||||||
DispFile : String[20];
|
DispFile : String[20];
|
||||||
Password : String[20];
|
Fallback : String[20];
|
||||||
NodeStatus : String[30];
|
NodeStatus : String[30];
|
||||||
Header : String[160];
|
Header : String[160];
|
||||||
Footer : String[160];
|
Footer : String[160];
|
||||||
|
|
Loading…
Reference in New Issue