-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.pas
95 lines (76 loc) · 2.29 KB
/
Main.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
88
89
90
91
92
93
94
95
unit Main;
interface
uses
System.SyncObjs,
fmeShakeSpeare,
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
uniGUIClasses, uniGUIRegClasses, uniGUIForm, uniGUIBaseClasses, uniBasicGrid,
uniDBGrid, uniButton, uniSyntaxEditorBase, uniSyntaxEditorEx, uniSplitter,
uniEdit, uniPanel, uniScreenMask, uniMemo, uniDBMemo, uniLabel, uniPageControl,
uniGUIFrame, uniToolBar, uniBitBtn, uniMenuButton, uniTrackBar,
uniImageList, uniSpeedButton, Vcl.Imaging.pngimage, uniImage, uniMultiItem,
uniListBox, uniTimer;
type
TMainForm = class(TUniForm)
UniPageControl1: TUniPageControl;
pnlLeft: TUniPanel;
pnlTop: TUniPanel;
UniPanel1: TUniPanel;
UniImageList1: TUniImageList;
UniTimer1: TUniTimer;
UniPanel2: TUniPanel;
UniListBox1: TUniListBox;
procedure UniFormCreate(Sender: TObject);
procedure UniTimer1Timer(Sender: TObject);
private
FShakeSpeares: TArray<TFrameShakespeare>;
public
end;
function MainForm: TMainForm;
implementation
{$R *.dfm}
uses
uniGUIVars, MainModule, ServerModule, uniGUIApplication;
function MainForm: TMainForm;
begin
Result := TMainForm(UniMainModule.GetFormInstance(TMainForm));
end;
procedure TMainForm.UniFormCreate(Sender: TObject);
var
newPage: TUniTabSheet;
i: Integer;
begin
for i := 1 to 15 do
begin
newPage := TUniTabSheet.Create(UniPageControl1);
newPage.PageControl := UniPageControl1;
newPage.Caption := 'Shakespeare ' + i.ToString;
FShakeSpeares := FShakeSpeares + [TFrameShakespeare.Create(newPage)];
with FShakeSpeares[High(FShakeSpeares)] do
begin
Parent := newPage;
Align := alClient;
end;
end;
end;
procedure TMainForm.UniTimer1Timer(Sender: TObject);
var
str: string;
begin
UniListBox1.BeginUpdate;
UniSession.AddJS('Ext.suspendLayouts()');
while UniMainModule.MsgQueue.PopItem(str)=wrSignaled do
begin
UniListBox1.Items.Insert(0, str);
end;
while UniListBox1.Items.Count>32 do
begin
UniListBox1.Items.Delete(UniListBox1.Items.Count-1);
end;
UniSession.AddJS('Ext.resumeLayouts(true)');
UniListBox1.EndUpdate;
end;
initialization
RegisterAppFormClass(TMainForm);
end.