📄 count.pas
字号:
{************************************************}
{ }
{ Turbo Vision 2.0 Demo }
{ Copyright (c) 1992 by Borland International }
{ }
{************************************************}
{$X+,V-}
unit Count;
interface
uses Objects, Drivers, Views;
type
PCountView = ^TCountView;
TCountView = object(TView)
Current: Longint;
Count: Longint;
constructor Init(var Bounds: TRect);
constructor Load(var S: TStream);
procedure Draw; virtual;
function GetPalette: PPalette; virtual;
procedure SetCount(NewCount: Longint);
procedure IncCount;
procedure DecCount;
procedure SetCurrent(NewCurrent: Longint);
procedure IncCurrent;
procedure DecCurrent;
procedure Store(var S: TStream); virtual;
end;
procedure RegisterCount;
const
CCountView = #1#2#3#8#9;
RCountView: TStreamRec = (
ObjType: 992;
VmtLink: Ofs(TypeOf(TCountView)^);
Load: @TCountView.Load;
Store: @TCountView.Store
);
implementation
{ TCountView }
constructor TCountView.Init(var Bounds:TRect);
begin
inherited Init(Bounds);
SetCount(0);
SetCurrent(1);
end;
constructor TCountView.Load(var S: TStream);
begin
inherited Load(S);
S.Read(Current, SizeOf(Current));
S.Read(Count, SizeOf(Count));
end;
procedure TCountView.Draw;
var
B: TDrawBuffer;
C: Word;
Params: array[0..1] of Longint;
Start: Word;
First: String[10];
Display: String[20];
begin
C := GetColor(2); { Uses same color as frame }
MoveChar(B, '
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -