-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.pas
74 lines (63 loc) · 1.67 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
unit main;
interface
uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Electron, WEBLib.Dialogs, WEBLib.ExtCtrls, WEBLib.StdCtrls;
type
TMainForm = class(TElectronForm)
pnDisplay: TWebPanel;
WebPanel1: TWebPanel;
btnOperation: TWebButton;
WebButton2: TWebButton;
WebButton3: TWebButton;
WebButton4: TWebButton;
WebButton5: TWebButton;
WebPanel2: TWebPanel;
WebButton6: TWebButton;
WebButton7: TWebButton;
WebButton8: TWebButton;
WebButton9: TWebButton;
WebButton10: TWebButton;
WebPanel3: TWebPanel;
WebButton11: TWebButton;
WebButton12: TWebButton;
WebButton13: TWebButton;
WebButton14: TWebButton;
WebButton15: TWebButton;
WebPanel4: TWebPanel;
WebButton16: TWebButton;
btnResult: TWebButton;
lbDisplay: TWebLabel;
procedure btnOperationClick(Sender: TObject);
procedure btnResultClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
procedure TMainForm.btnResultClick(Sender: TObject);
var
operation: string;
operationresult: string;
begin
operation := lbDisplay.Caption;
asm
operationresult = eval(operation);
end;
lbDisplay.Caption := Trim(operationresult+' ');
end;
procedure TMainForm.btnOperationClick(Sender: TObject);
begin
if (lbDisplay.Caption='0') then
begin
lbDisplay.Caption:='';
end;
lbDisplay.Caption := lbDisplay.Caption + (Sender as TWebButton).Caption;
end;
initialization
RegisterClass(TMainForm);
end.