Added Copy/Paste functions

This commit is contained in:
mysticbbs 2012-02-24 11:47:28 -05:00
parent c47d3e6caf
commit d78b82e9e2
2 changed files with 39 additions and 13 deletions

View File

@ -51,12 +51,13 @@ End;
Procedure Configuration_ArchiveEditor; Procedure Configuration_ArchiveEditor;
Var Var
Box : TAnsiMenuBox; Box : TAnsiMenuBox;
List : TAnsiMenuList; List : TAnsiMenuList;
F : TBufFile; F : TBufFile;
Arc : RecArchive; Arc : RecArchive;
Copied : RecArchive;
HasCopy : Boolean = False;
// SORT THIS LIST BY NON CASE SENSITIVE ARCHIVE EXTENSION
Procedure MakeList; Procedure MakeList;
Var Var
OS : String; OS : String;
@ -105,8 +106,7 @@ Begin
List.Close; List.Close;
Case List.ExitCode of Case List.ExitCode of
'/' : Case GetCommandOption(11, 'I-Insert|D-Delete|') of '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
#27 : ;
'I' : Begin 'I' : Begin
F.RecordInsert (List.Picked); F.RecordInsert (List.Picked);
@ -124,6 +124,18 @@ Begin
End; End;
'D' : If ShowMsgBox(1, 'Delete this entry?') Then Begin 'D' : If ShowMsgBox(1, 'Delete this entry?') Then Begin
F.RecordDelete (List.Picked); 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; MakeList;
End; End;
End; End;

View File

@ -49,10 +49,12 @@ End;
Procedure Configuration_ProtocolEditor; Procedure Configuration_ProtocolEditor;
Var Var
Box : TAnsiMenuBox; Box : TAnsiMenuBox;
List : TAnsiMenuList; List : TAnsiMenuList;
F : TBufFile; F : TBufFile;
Prot : RecProtocol; Prot : RecProtocol;
Copied : RecProtocol;
HasCopy : Boolean = False;
Procedure MakeList; Procedure MakeList;
Var Var
@ -105,8 +107,7 @@ Begin
List.Close; List.Close;
Case List.ExitCode of Case List.ExitCode of
'/' : Case GetCommandOption(11, 'I-Insert|D-Delete|') of '/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
#27 : ;
'I' : Begin 'I' : Begin
F.RecordInsert (List.Picked); F.RecordInsert (List.Picked);
@ -127,6 +128,19 @@ Begin
F.RecordDelete (List.Picked); F.RecordDelete (List.Picked);
MakeList; MakeList;
End; 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; End;
#13 : If List.Picked <> List.ListMax Then Begin #13 : If List.Picked <> List.ListMax Then Begin
F.Seek (List.Picked - 1); F.Seek (List.Picked - 1);