.


:




:

































 

 

 

 


-




 

- , (record).

:

<>=

bjt<> ;

;

;

;

end;

 

, , ,

- , . :

 

procedure <>(<1>, <2>:integer),

 

,

. . , . :

 

procedure <.>

(<1>, <2>: integer);

begin

nd;{}

 

. . , , , , . , , , .

:

 

procedure <> (<1>, <2>: integer): virtual;

 

, 6.0 : .

- , , , constructor. , , . .

- , . destructor.

- , ;

- , ;

- , , .

( ).

. () , Y. :

 

Pozition = record

X, Y: integer;

end;

 

( ). :

 

procedure Init(CoordX, CoordY: integer);

begin

X: = CoordX;

Y: = CoordY;

end;

 

. :

 

function GetX: integer;

begin

GetX: = X;

end;

function GetY: integer;

begin

GetY: = Y;

end;

 

Init GetX GetY Pozition.

, , :

Pozition = object

X, Y: integer;

procedure Init(CoordX, CoordY: integer);

function GetX: integer;

function GetY: integer;

end;

Init GetX GetY Pozition.

Pozition , :

var

FirstPozition: Pozition;

FirstPozition.Init(10,15);

 

, : ( Interface ); , -, . ( ) . , , . ,

procedure Pozition. Init(CoordX, CoordY: integer);

begin

X: = CoordX:

Y: = CoordY;

end;

 

, .

, . private (). . :

type

ObjectName=object

;

;

;

;

private

;

;

;

;

end;

 

. Y. , , . :

Point=object

X,Y: integer; "

procedure Init(CoordX, CoordY: integer);

function GetX: integer;

function GetY. integer;

Visible: Boolean;

Color: Word;

procedure Init(CoordX, CoordY: integer; InitCoIor: Word);

function Is Visible: Boolean;

procedure Show;{ }

procedure Blind; { }

procedure Jump(NextX, NextY: integer);{nepeMeiuaer }

end;

 

, , X.Y GetX, GetY Pozition.

- . Point Pozition, :

 

Point=object(Pozition)

Visible: Boolean;

Color: Word;

procedure Init(CoordX, CoordY: integer; InitColor: Word);

function Is Visible. Boolean;

procedure Show;

procedure Blind:

procedure Jump(NextX, NextY: integer);

end;

 

Point Pozition. X,Y Point, Point , ..

 

Point.X:=17;

 

- .

. , . , Point, , . . , , . - , . , , () , , . virtual. , constructor Init

destructorDone.

. ), , , - destructor.

 

TURBO-VISION

 

- , . , , .

Turbo-Vision - - 6.0, 7.0.

- Turbo-Vision

;

/

;

;

;

, , , ;

.

, Turbo-Vision, , - .

, , , , .

. . <Enter> . .

, . Turbo-Vision . , . , . .

- - ( Tab <>). , , .

Turbo-Vision :

;

() ();

, ;

;

;

;

. TApplication. TApplication - . . TApplication TApplication. . , HELLO.PAS, Turbo-Vision HELLO, WORLD! THelloApp:

 

PHelloApp = ^HelloApp;

THelloApp = object(TApplication)

procedure GreetingBox;

procedure HadleEvent(var Event: TEvent); virtual;

procedure InitMenuBar; virtual;

procedure InitStatusLine; virtual;

end;

 

, , . , , .

THelloApp , ; . THelloApp , TApplication. , , TApplication.

, THelloApp, :

1) HadleEvent , ( ) ; HadleEvent, TApplication, , , , ;

2) InitMenuBar (TApplication , );

3) InitStatusLine ; , ;

4) GreetingBox Greeting; GreetingBox HadleEvent , Greeting; , .

Turbo-Vision Hello :

 

var

HelloWorld: THelloApp;

begin

HelloWorld.Init;

HelloWorld Run;

HelloWorld.Done;

end;

 

.

Init - . , , ( ) . Turbo-Vision Init. , .

HelloWorld.Init . , , . , , .

Turbo-Vision Run. Run , Run TApplication.

, , repeat...until, ;

 

repeat

< >;

< >;

until Quit;

 

, Run. Turbo-Vision : ( - , , -) . .

Done : - , - Turbo-Vision. Done , Init, TApplication.Done, .

- Turbo-Vision .

- Turbo-Vision -, C++. - Windows. - Visual Basic, Delphi - , .

 





:


: 2016-11-12; !; : 269 |


:

:

.
==> ...

1491 - | 1328 -


© 2015-2024 lektsii.org - -

: 0.185 .