mysticbbs/mystic/bbs_cfg_common.pas

58 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2012-02-15 21:26:33 -08:00
Unit bbs_cfg_Common;
{$I M_OPS.PAS}
Interface
2012-02-26 03:51:59 -08:00
Const
cfgCommandList = 'Press / for command list';
2012-02-15 21:26:33 -08:00
Function GetCommandOption (StartY: Byte; CmdStr: String) : Char;
Implementation
Uses
bbs_ansi_MenuBox,
bbs_ansi_MenuForm;
Function GetCommandOption (StartY: Byte; CmdStr: String) : Char;
Var
Box : TAnsiMenuBox;
Form : TAnsiMenuForm;
Count : Byte;
Cmds : Byte;
CmdData : Array[1..10] of Record
Key : Char;
Desc : String[18];
End;
Begin
Cmds := 0;
While Pos('|', CmdStr) > 0 Do Begin
Inc (Cmds);
CmdData[Cmds].Key := CmdStr[1];
CmdData[Cmds].Desc := Copy(CmdStr, 3, Pos('|', CmdStr) - 3);
Delete (CmdStr, 1, Pos('|', Cmdstr));
End;
Box := TAnsiMenuBox.Create;
Form := TAnsiMenuForm.Create;
Form.HelpSize := 0;
Box.Open (30, StartY, 51, StartY + Cmds + 1);
For Count := 1 to Cmds Do
Form.AddNone (CmdData[Count].Key, ' ' + CmdData[Count].Key + ' ' + CmdData[Count].Desc, 31, StartY + Count, 20, '');
Result := Form.Execute;
Form.Free;
Box.Close;
Box.Free;
End;
End.