diff --git a/mystic/bbs_cfg_common.pas b/mystic/bbs_cfg_common.pas new file mode 100644 index 0000000..f39e41c --- /dev/null +++ b/mystic/bbs_cfg_common.pas @@ -0,0 +1,54 @@ +Unit bbs_cfg_Common; + +{$I M_OPS.PAS} + +Interface + +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.