?? copyrightmgr.pas
字號:
unit copyrightmgr;
interface
uses
SysUtils, Classes, MultiLang
{$IFDEF CLX}
, QControls, QForms, QDialogs, QStdCtrls
{$ELSE}
, Controls, Forms, Dialogs, StdCtrls
{$ENDIF}
;
type
TForm8 = class(TForm)
ListBox1: TListBox;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Label3: TLabel;
Edit2: TEdit;
Label4: TLabel;
Edit3: TEdit;
Label5: TLabel;
Edit4: TEdit;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Button1: TButton;
Memo2: TMemo;
Button2: TButton;
Button3: TButton;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Label9: TLabel;
Label10: TLabel;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure UpdateCPI(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private-Deklarationen }
public
CopyrightPath: String;
Filenames: TStrings;
end;
var
Form8: TForm8;
implementation
{$R *.dfm}
procedure TForm8.Button1Click(Sender: TObject);
begin
Close;
end;
procedure TForm8.FormCreate(Sender: TObject);
begin
// ml support
Button1.Caption:=ml.GetComponentString('copyrightmgr.Button1.Caption');
Button2.Caption:=ml.GetComponentString('copyrightmgr.Button2.Caption');
Button3.Caption:=ml.GetComponentString('copyrightmgr.Button3.Caption');
Button4.Caption:=ml.GetComponentString('copyrightmgr.Button4.Caption');
Form8.Caption:=ml.GetComponentString('copyrightmgr.Form8.Caption');
Label1.Caption:=ml.GetComponentString('copyrightmgr.Label1.Caption');
Label10.Caption:=ml.GetComponentString('copyrightmgr.Label10.Caption');
Label2.Caption:=ml.GetComponentString('copyrightmgr.Label2.Caption');
Label3.Caption:=ml.GetComponentString('copyrightmgr.Label3.Caption');
Label4.Caption:=ml.GetComponentString('copyrightmgr.Label4.Caption');
Label5.Caption:=ml.GetComponentString('copyrightmgr.Label5.Caption');
Label6.Caption:=ml.GetComponentString('copyrightmgr.Label6.Caption');
Label7.Caption:=ml.GetComponentString('copyrightmgr.Label7.Caption');
Label8.Caption:=ml.GetComponentString('copyrightmgr.Label8.Caption');
Label9.Caption:=ml.GetComponentString('copyrightmgr.Label9.Caption');
////////////////////////////////////////////////////////////////////////
Filenames:=TStringList.Create;
end;
procedure TForm8.FormDestroy(Sender: TObject);
begin
Filenames.Free;
end;
procedure TForm8.FormShow(Sender: TObject);
var
fsr: TSearchRec;
cpi: TextFile;
str: String;
line: String;
begin
Filenames.Clear;
ListBox1.Items.Clear;
if FindFirst(CopyRightPath+'*.cpi',faAnyFile,fsr)=0 then begin
if FileExists(CopyRightPath+fsr.Name) then begin
Filenames.Add(CopyRightPath+fsr.Name);
AssignFile(cpi,CopyRightPath+fsr.Name);
Reset(cpi);
Readln(cpi,line);
Readln(cpi,str);
line:=line+' '+str;
Readln(cpi,str);
line:=line+', '+str;
CloseFile(cpi);
ListBox1.Items.Add(line);
end;
while FindNext(fsr)=0 do begin
if FileExists(CopyRightPath+fsr.Name) then begin
Filenames.Add(CopyRightPath+fsr.Name);
AssignFile(cpi,CopyRightPath+fsr.Name);
Reset(cpi);
Readln(cpi,line);
Readln(cpi,str);
line:=line+' '+str;
Readln(cpi,str);
line:=line+', '+str;
CloseFile(cpi);
ListBox1.Items.Add(line);
end;
end;
end;
end;
procedure TForm8.ListBox1Click(Sender: TObject);
var
cpi: TextFile;
line: String;
begin
if ListBox1.ItemIndex>-1 then begin
AssignFile(cpi,FileNames.Strings[ListBox1.ItemIndex]);
Reset(cpi);
Readln(cpi,line);
Edit1.Text:=line;
Readln(cpi,line);
Edit2.Text:=line;
Readln(cpi,line);
Edit3.Text:=line;
Readln(cpi,line);
Edit4.Text:=line;
Readln(cpi,line);
Edit5.Text:=line;
Readln(cpi,line);
Edit6.Text:=line;
Readln(cpi,line);
Edit7.Text:=line;
Memo2.Lines.Clear;
while not(EOF(cpi)) do begin
ReadLn(cpi,line);
Memo2.Lines.Add(line);
end;
CloseFile(cpi);
end;
end;
procedure TForm8.Button2Click(Sender: TObject);
var
cpi: TextFile;
y,m,d,ho,mi,se,ms: Word;
Filename: String;
begin
DecodeDate(Date,y,m,d);
DecodeTime(Time,ho,mi,se,ms);
Filename:=Inttostr(y)+Inttostr(m)+Inttostr(d)+Inttostr(ho)+Inttostr(mi)+Inttostr(se)+Inttostr(ms);
Filename:=CopyrightPath+Filename+'.cpi';
AssignFile(cpi,Filename);
Rewrite(cpi);
CloseFile(cpi);
Filenames.Add(Filename);
ListBox1.Items.Add(ml.GetCodeString('copyrightmgr',1){'<new>'}); // code001
end;
procedure TForm8.Button3Click(Sender: TObject);
begin
if ListBox1.ItemIndex>-1 then begin
DeleteFile(Filenames.Strings[ListBox1.ItemIndex]);
Filenames.Delete(ListBox1.ItemIndex);
ListBox1.Items.Delete(ListBox1.ItemIndex);
ListBox1.ItemIndex:=-1;
end;
end;
procedure TForm8.UpdateCPI(Sender: TObject);
var
cpi: TextFile;
i: Integer;
begin
if ListBox1.ItemIndex>-1 then begin
AssignFile(cpi,Filenames.Strings[ListBox1.ItemIndex]);
Rewrite(cpi);
Writeln(cpi,Edit1.Text);
Writeln(cpi,Edit2.Text);
Writeln(cpi,Edit3.Text);
Writeln(cpi,Edit4.Text);
Writeln(cpi,Edit5.Text);
Writeln(cpi,Edit6.Text);
Writeln(cpi,Edit7.Text);
for i:=0 to Memo2.Lines.Count-1 do Writeln(cpi,Memo2.Lines.Strings[i]);
CloseFile(cpi);
if (Sender=Edit1) or (Sender=Edit2) or (Sender=Edit3) then ListBox1.Items.Strings[ListBox1.ItemIndex]:=Edit1.Text+' '+Edit2.Text+', '+Edit3.Text;
end;
end;
procedure TForm8.Button4Click(Sender: TObject);
begin
{$IFDEF CLX}
Application.HelpSystem.ShowContextHelp(820,Application.HelpFile);
{$ELSE}
Application.HelpContext(820);
{$ENDIF}
end;
end.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -