-
Notifications
You must be signed in to change notification settings - Fork 3
/
ufChkGroupEditPlot.pas
95 lines (80 loc) · 2.05 KB
/
ufChkGroupEditPlot.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 ufChkGroupEditPlot;
interface
uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, WEBLib.StdCtrls, Vcl.StdCtrls,
WEBLib.ExtCtrls;
{ 0 = legend visible
1 = Autoscale }
const LEGEND_VIS = 0; AUTO_SCALE = 1;
type
TfChkGroupEditPlot = class(TWebForm)
chkGrpEditPlot: TWebCheckGroup;
btnOkPlotEdit: TWebButton;
lblYAxisMin: TWebLabel;
lblYAxisMax: TWebLabel;
editYAxisMax: TWebEdit;
editYAxisMin: TWebEdit;
pnlYAxisMinMax: TWebPanel;
lblEditYAxis: TWebLabel;
btnChangePlotSp: TWebButton;
procedure btnOkPlotEditClick(Sender: TObject);
procedure btnChangePlotSpClick(Sender: TObject);
private
{ Private declarations }
public
procedure checkLegendVisible();
procedure uncheckLegendInvisible();
procedure checkAutoscale();
procedure uncheckAutoscale();
function getEditYMax(): double;
function getEditYMin(): double;
end;
var
fChkGroupEditPlot: TfChkGroupEditPlot;
implementation
{$R *.dfm}
procedure TfChkGroupEditPlot.btnChangePlotSpClick(Sender: TObject);
begin
// TODO?
end;
procedure TfChkGroupEditPlot.btnOkPlotEditClick(Sender: TObject);
var lForm: TWebForm;
begin
lForm := TWebForm((Sender as TWebButton).Parent);
lForm.Close;
lForm.Free;
end;
procedure TfChkGroupEditPlot.checkLegendVisible();
begin
self.chkGrpEditPlot.Checked[LEGEND_VIS] := true;
end;
procedure TfChkGroupEditPlot.uncheckLegendInvisible();
begin
self.chkGrpEditPlot.Checked[LEGEND_VIS] := false;
end;
procedure TfChkGroupEditPlot.checkAutoscale();
begin
self.chkGrpEditPlot.Checked[AUTO_SCALE] := true;
end;
procedure TfChkGroupEditPlot.uncheckAutoscale();
begin
self.chkGrpEditPlot.Checked[AUTO_SCALE] := false;
end;
function TfChkGroupEditPlot.getEditYMax(): double;
begin
try
Result := strtofloat(self.editYAxisMax.Text);
except
Result := 0.0;
end;
end;
function TfChkGroupEditPlot.getEditYMin(): double;
begin
try
Result := strtofloat(self.editYAxisMin.Text);
except
Result := 0.0;
end;
end;
end.