forked from fomonster/spritepacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logformunit.pas
76 lines (58 loc) · 1.14 KB
/
logformunit.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
unit logformUnit;
{$mode delphi}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls;
type
{ TLogForm }
TLogForm = class(TForm)
CloseButton: TButton;
LogMemo: TMemo;
Panel1: TPanel;
procedure CloseButtonClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
LogForm: TLogForm;
logStr:AnsiString;
procedure ClearLog;
procedure AddLog(s:AnsiString);
procedure ShowLog;
procedure ShowLog(s:AnsiString);
implementation
{$R *.lfm}
{ TLogForm }
procedure ClearLog;
begin
logStr := '';
end;
procedure AddLog(s:AnsiString);
begin
if ( logStr <> '' ) then logStr := logStr + #13+#10;
logStr := logStr + s;
end;
procedure ShowLog(s:AnsiString);
begin
LogForm.LogMemo.Clear;
if ( s = '' ) then begin
LogForm.LogMemo.Lines.Add(logStr);
end else begin
LogForm.LogMemo.Lines.Add(s);
end;
LogForm.ShowModal;
end;
procedure ShowLog;
begin
LogForm.LogMemo.Clear;
LogForm.LogMemo.Lines.Add(logStr);
LogForm.ShowModal;
end;
procedure TLogForm.CloseButtonClick(Sender: TObject);
begin
Close
end;
end.