-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTEXTAPP.PAS
68 lines (58 loc) · 1.26 KB
/
TEXTAPP.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
{$I COMPILER.INC}
unit TextApp;
interface
uses
AplObj,
AplTypes,
AplConst,
Lists,
AplApps,
KeyDrv,
AplUtils,
TextType,
TextDrv,
TextIni;
type
PTextApplication = ^TTextApplication;
TTextApplication = object(TApplication)
private
FDriver: TTextDrivers;
FMode: TTextModes;
public
constructor Create(ADriver: TTextDrivers; AMode: TTextModes);
procedure SetMode(AMode: TTextModes); virtual;
procedure Init; virtual;
procedure InitText(ADriver: TTextDrivers);
end;
implementation
constructor TTextApplication.Create(ADriver: TTextDrivers; AMode: TTextModes);
begin
inherited Create;
FDriver := ADriver;
FMode := AMode;
end;
procedure TTextApplication.InitText(ADriver: TTextDrivers);
begin
TextIni.InitTextDriver(ADriver);
if NilPtr(Text, ecNotEnoughMemory) then
exit;
CheckReRaise(Text);
end;
procedure TTextApplication.SetMode(AMode: TTextModes);
var
mode: PTextMode;
begin
mode := Text^.Modes.GetModeById(AMode);
if NilPtr(mode, ecTextModeNotFound) then
exit;
Text^.SetMode(mode);
if CheckReRaise(Text) then
exit;
end;
procedure TTextApplication.Init;
begin
inherited Init;
FDriver := tdDirect;
FMode := tmColor80x25;
end;
end.