forked from cheat-engine/cheat-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommentsUnit.pas
87 lines (64 loc) · 2 KB
/
CommentsUnit.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
76
77
78
79
80
81
82
83
84
85
86
87
unit CommentsUnit;
{$MODE Delphi}
interface
uses
windows, LCLIntf, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, LResources, ComCtrls, LuaHandler;
type
{ TComments }
TComments = class(TForm)
Memo1: TMemo;
PageControl1: TPageControl;
Panel1: TPanel;
Button1: TButton;
tsComment: TTabSheet;
procedure btnExecuteScriptClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure mLuaScriptChange(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
procedure WMGetMinMaxInfo(var Message: TMessage); message WM_GETMINMAXINFO;
public
{ Public declarations }
end;
var
Comments: TComments;
implementation
uses MainUnit;
procedure TComments.WMGetMinMaxInfo(var Message: TMessage);
var MMInfo: ^MINMAXINFO;
begin //the constraint function of the form behaves weird when draging from the top or left side, so I have to do this myself.
MMInfo:=pointer(message.LParam);
MMInfo.ptMinTrackSize:=point(300,240);
end;
procedure TComments.Button1Click(Sender: TObject);
begin
close;
end;
procedure TComments.FormCreate(Sender: TObject);
begin
pagecontrol1.ActivePage:=tsComment;
end;
procedure TComments.mLuaScriptChange(Sender: TObject);
begin
end;
procedure TComments.btnExecuteScriptClick(Sender: TObject);
begin
end;
procedure TComments.Panel1Resize(Sender: TObject);
begin
button1.Left:=(panel1.ClientWidth div 2) - (button1.Width div 2);
end;
procedure TComments.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if (memo1.Lines.Count>0) then
mainform.Commentbutton.font.style:=mainform.Commentbutton.font.style+[fsBold]
else
mainform.Commentbutton.font.style:=mainform.Commentbutton.font.style-[fsBold]
end;
initialization
{$i CommentsUnit.lrs}
end.