Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/decoder/trunk/Quelltext/Warten.pas
Revision: 2
Committed: Thu Nov 8 11:09:30 2018 UTC (22 months, 2 weeks ago) by daniel-marschall
Content type: text/x-pascal
File size: 1891 byte(s)
Log Message:
Published revision 01 March 2007 to SVN.
Added disclaimer.
Changed the license to Apache2.

File Contents

# Content
1 unit Warten;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Forms, IniFiles, Controls, Classes,
7 ComCtrls, StdCtrls, DCConst, ExtCtrls,
8 dialogs;
9
10 type
11 TWartenForm = class(TForm)
12 pbr_progress: TProgressBar;
13 lbl_wait: TLabel;
14 lbl_info1: TLabel;
15 lbl_info2: TLabel;
16 btn_escape: TButton;
17 procedure btn_escapeClick(Sender: TObject);
18 procedure FormCreate(Sender: TObject);
19 private
20 LangArray: array of TLanguageEntry;
21 function GetLangEntry(name: string): string;
22 end;
23
24 var
25 WartenForm: TWartenForm;
26
27 implementation
28
29 uses Main;
30
31 {$R *.dfm}
32
33 function TWartenForm.GetLangEntry(name: string): string;
34 var
35 i: integer;
36 begin
37 for i := 0 to high(LangArray) do
38 begin
39 if LangArray[i].name = name then
40 begin
41 result := LangArray[i].text;
42 break;
43 end;
44 end;
45 end;
46
47 procedure TWartenForm.btn_escapeClick(Sender: TObject);
48 begin
49 mainform.close;
50 end;
51
52 procedure TWartenForm.FormCreate(Sender: TObject);
53 var
54 ini: TIniFile;
55 str: TStringList;
56 i: integer;
57 begin
58 // Sprachdatei auslesen
59
60 ini := TIniFile.Create(ExtractFilePath(Application.ExeName)+'Language.ini');
61 str := TStringList.Create();
62 try
63 ini.ReadSection(Name, str);
64 for i := 0 to str.count-1 do
65 begin
66 setlength(LangArray, length(LangArray)+1);
67 LangArray[length(LangArray)-1].name := str.strings[i];
68 LangArray[length(LangArray)-1].text := ini.ReadString(name, str.strings[i], '?');
69 LangArray[length(LangArray)-1].text := StringReplace(LangArray[length(LangArray)-1].text, '###', #13#10, [rfReplaceAll]);
70 end;
71 finally
72 ini.free;
73 str.Free;
74 end;
75
76 // Formular vorbereiten
77
78 lbl_wait.Caption := GetLangEntry('wait');
79 btn_escape.Caption := GetLangEntry('exit');
80
81 lbl_wait.Left := clientwidth div 2 - lbl_wait.Width div 2;
82 end;
83
84 end.