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
88
89
90
|
program memotest;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes,
typinfo,
fpg_base,
fpg_main,
fpg_form,
fpg_button,
fpg_memo;
type
TMainForm = class(TfpgForm)
private
{@VFD_HEAD_BEGIN: MainForm}
memo: TfpgMemo;
btnQuit: TfpgButton;
{@VFD_HEAD_END: MainForm}
procedure btnQuitClicked(Sender: TObject);
public
procedure AfterCreate; override;
end;
{ TMainForm }
procedure TMainForm.btnQuitClicked(Sender: TObject);
begin
Close;
end;
procedure TMainForm.AfterCreate;
begin
{@VFD_BODY_BEGIN: MainForm}
Name := 'MainForm';
SetPosition(329, 251, 300, 201);
WindowTitle := 'Memo Test';
WindowPosition := wpOneThirdDown;
memo := TfpgMemo.Create(self);
with memo do
begin
Name := 'memo';
SetPosition(10, 40, 280, 150);
Anchors := [anLeft,anRight,anTop,anBottom];
Lines.Add('Memo Test0');
Lines.Add('Memo Test1');
Lines.Add('Memo Test2');
Lines.Add('Memo Test3');
Lines.Add('Memo Test4');
FontDesc := '#Edit1';
TabOrder := 0;
Lines.Insert(1, '0 Before 1 after');
end;
btnQuit := TfpgButton.Create(self);
with btnQuit do
begin
Name := 'btnQuit';
SetPosition(208, 8, 80, 24);
Anchors := [anRight,anTop];
Text := 'Quit';
FontDesc := '#Label1';
Hint := '';
ImageName := 'stdimg.quit';
TabOrder := 1;
OnClick := @btnQuitClicked;
end;
{@VFD_BODY_END: MainForm}
end;
procedure MainProc;
var
frm: TMainForm;
begin
fpgApplication.Initialize;
frm := TMainForm.Create(nil);
frm.Show;
fpgApplication.Run;
frm.Free;
end;
begin
MainProc;
end.
|