forked from unxed/dn2l
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_gauge.pas
103 lines (84 loc) · 2.35 KB
/
_gauge.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
96
97
98
99
100
101
102
103
unit _Gauge;
(******
DN/2 Plugin Interface - object model
Copyright (C) 2002 Aleksej Kozlov (Cat)
2:5030/1326.13
******)
{&Delphi+}
{&Use32+}
interface
uses
_Defines, _Collect, _Views, _Dialogs
;
type
PPercentGauge = ^TPercentGauge;
TPercentGauge = object(TView)
MaxValue: LongInt;
CurValue: LongInt;
constructor Init(var Bounds: TRect; AMaxValue: LongInt);
{procedure Draw; virtual;}
procedure UpdateView(Progress: LongInt); virtual;
procedure AddProgress(Progress: LongInt);
{procedure HandleEvent(var Event: TEvent); virtual;}
function SolveForX(Y, Z: LongInt): Integer;
function SolveForY(X, Z: LongInt): Integer;
end;
PBarGauge = ^TBarGauge;
TBarGauge = object(TPercentGauge)
{procedure Draw; virtual;}
end;
PWhileView = ^TWhileView;
TWhileView = object(TGroup)
Lines: PCollection;
But: PButton;
QuitNormal: Boolean;
Top, Bottom: String;
constructor Init(Bounds: TRect);
procedure Write(N: Integer; S: String);
{function GetPalette: PPalette; virtual;}
{function Valid(C: Word): Boolean; virtual;}
{procedure SetState(AState: Word; Enable: Boolean); virtual;}
{procedure Draw; virtual;}
{procedure HandleEvent(var Event: TEvent); virtual;}
{destructor Done; virtual;}
procedure ClearInterior;
private
Side: (sdLeft, sdRight);
end;
implementation
uses
_DNFuncs
;
constructor TPercentGauge.Init(var Bounds: TRect; AMaxValue: LongInt);
begin
_TPercentGauge^.Init(Bounds, AMaxValue, nil, @Self);
end;
procedure TPercentGauge.UpdateView(Progress: LongInt);
assembler; {&Frame-}
asm
end;
procedure TPercentGauge.AddProgress(Progress: LongInt);
begin
_TPercentGauge^.AddProgress(Progress, @Self);
end;
function TPercentGauge.SolveForX(Y, Z: LongInt): Integer;
begin
Result := _TPercentGauge^.SolveForX(Y, Z, @Self);
end;
function TPercentGauge.SolveForY(X, Z: LongInt): Integer;
begin
Result := _TPercentGauge^.SolveForY(X, Z, @Self);
end;
constructor TWhileView.Init(Bounds: TRect);
begin
_TWhileView^.Init(Bounds, nil, @Self);
end;
procedure TWhileView.Write(N: Integer; S: String);
begin
_TWhileView^.Write(N, S, @Self);
end;
procedure TWhileView.ClearInterior;
begin
_TWhileView^.ClearInterior(@Self);
end;
end.