From d78b82e9e26d914313ac9ae58aed6ac72a94e1e8 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Fri, 24 Feb 2012 11:47:28 -0500 Subject: [PATCH] Added Copy/Paste functions --- mystic/bbs_cfg_archive.pas | 26 +++++++++++++++++++------- mystic/bbs_cfg_protocol.pas | 26 ++++++++++++++++++++------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/mystic/bbs_cfg_archive.pas b/mystic/bbs_cfg_archive.pas index 793fc83..83d4033 100644 --- a/mystic/bbs_cfg_archive.pas +++ b/mystic/bbs_cfg_archive.pas @@ -51,12 +51,13 @@ End; Procedure Configuration_ArchiveEditor; Var - Box : TAnsiMenuBox; - List : TAnsiMenuList; - F : TBufFile; - Arc : RecArchive; + Box : TAnsiMenuBox; + List : TAnsiMenuList; + F : TBufFile; + Arc : RecArchive; + Copied : RecArchive; + HasCopy : Boolean = False; - // SORT THIS LIST BY NON CASE SENSITIVE ARCHIVE EXTENSION Procedure MakeList; Var OS : String; @@ -105,8 +106,7 @@ Begin List.Close; Case List.ExitCode of - '/' : Case GetCommandOption(11, 'I-Insert|D-Delete|') of - #27 : ; + '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of 'I' : Begin F.RecordInsert (List.Picked); @@ -124,6 +124,18 @@ Begin End; 'D' : If ShowMsgBox(1, 'Delete this entry?') Then Begin F.RecordDelete (List.Picked); + MakeList; + End; + 'C' : If List.Picked <> List.ListMax Then Begin + F.Seek (List.Picked - 1); + F.Read (Copied); + + HasCopy := True; + End; + 'P' : If HasCopy Then Begin + F.RecordInsert (List.Picked); + F.Write (Copied); + MakeList; End; End; diff --git a/mystic/bbs_cfg_protocol.pas b/mystic/bbs_cfg_protocol.pas index 8944779..83ba061 100644 --- a/mystic/bbs_cfg_protocol.pas +++ b/mystic/bbs_cfg_protocol.pas @@ -49,10 +49,12 @@ End; Procedure Configuration_ProtocolEditor; Var - Box : TAnsiMenuBox; - List : TAnsiMenuList; - F : TBufFile; - Prot : RecProtocol; + Box : TAnsiMenuBox; + List : TAnsiMenuList; + F : TBufFile; + Prot : RecProtocol; + Copied : RecProtocol; + HasCopy : Boolean = False; Procedure MakeList; Var @@ -105,8 +107,7 @@ Begin List.Close; Case List.ExitCode of - '/' : Case GetCommandOption(11, 'I-Insert|D-Delete|') of - #27 : ; + '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of 'I' : Begin F.RecordInsert (List.Picked); @@ -127,6 +128,19 @@ Begin F.RecordDelete (List.Picked); MakeList; End; + 'C' : If List.Picked <> List.ListMax Then Begin + F.Seek (List.Picked - 1); + F.Read (Copied); + + HasCopy := True; + End; + 'P' : If HasCopy Then Begin + F.RecordInsert (List.Picked); + F.Write (Copied); + + MakeList; + End; + End; #13 : If List.Picked <> List.ListMax Then Begin F.Seek (List.Picked - 1);