-
Notifications
You must be signed in to change notification settings - Fork 0
/
UWorkGraphs.pas
executable file
·82 lines (68 loc) · 1.7 KB
/
UWorkGraphs.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
unit UWorkGraphs;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, tc;
type
TFWorkGraphs = class(TForm)
Button1: TButton;
Button2: TButton;
GBox: TComboBox;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure GBoxDropDown(Sender: TObject);
private
function GetMNumber: integer;
{ Private declarations }
public
Model : TModel;
procedure Load;
property MNumber : integer read GetMNumber;
end;
var
FWorkGraphs: TFWorkGraphs;
implementation
uses UGraph, UModel;
{$R *.DFM}
procedure TFWorkGraphs.Load;
var
i : integer;
begin
if not assigned(Model) then exit;
GBox.Clear;
with Model.Materials do
for i := Low(List) to high(List) do
GBox.Items.AddObject(List[i].Name, List[i]);
end;
procedure TFWorkGraphs.FormCreate(Sender: TObject);
begin
Model := nil;
end;
function TFWorkGraphs.GetMNumber: integer;
begin
with GBox do
if ItemIndex = -1 then result := -1
else
with Model.Materials do
result := FindByNumber((Items.Objects[ItemIndex] as TMaterial).Number);
end;
procedure TFWorkGraphs.Button2Click(Sender: TObject);
begin
if MNumber = -1 then exit;
if assigned(GraphReport) then GraphReport.free;
GraphReport := TGraphReport.Create(nil);
with GraphReport do
begin
GraphReport.Model := FWorkGraphs.Model;
Material := MNumber;
LoadFromModel;
Update;
Preview;
end;
end;
procedure TFWorkGraphs.GBoxDropDown(Sender: TObject);
begin
Load;
end;
end.