Delphi 6 (. . 1):
. 1. Delphi 6
1 , ; , : Delphi 6 Project1;
2 , ;
3 , , ; Delphi;
4 Form1, Delphi;
5 , , Unit1.pas ;
6 (Object Inspector) , ;
7 (Object TreeView) , Delphi 6; , , , , , -.
() , , , , ..
, , ( ), , .
, . Delphi . , OnClick, OnDblClick, OnKeyDown, OnKeyUp .. - , , OnClick, , . Delphi . , .
: . .
, .
1. . , , , , .
|
|
2. , , .
3. , Properties . 2- : , . , . . , , , False True .. . +. . . Delphi 6 (expanded inline component references) , , . , (.. ). , PopupMenu, , . , , . , +. , +, . .
. - , . .
1. . , , , Events (. . 2).
. , , . , . , . , Events , . . , , , Events .
|
|
2. , , . . , , Delphi, . Delphi , On, :
procedure TForml.LabellClick(Sender: TObject);
TForm1 , Label1Click , Delphi , , Label1 () . Sender TObject , OnClick (.. Label1).
3. Events , Delphi, . , . , :
procedure TForm1.Label1Click(Sender: TObject);
begin
end;
begin...end, .
4. , , , , . , , . .
, Delphi . , , . , Delphi OnClick. , .
, Delphi. , . , . , , , .. , , Delphi.
Delphi
Delphi . , ( .dpr) ( .pas). Delphi. , Project Þ View Source. , , :
program Project1;
uses
Forms,
Unit1 program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
Begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
End.
( ) program, , . , Delphi ( .). uses : Forms Unit1. {$R *.res} , , , , . , , , .res.
|
|
begin...end. .
, . Delphi . , , View ÞToggle Form/Unit, F12, View
, . ( ) .
( ), Object Pascal. :
unit < >;
interface
implementation
initialization
finalization
end.
, Delphi:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure Label1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
end.
unit, . 1 uses .
: , , .
( interface) , , , . (, uses) , , Delphi , type.
implementation , , . {SR *.dfm}, , , .dfm, . dfm Delphi .
{$R.dfm} . , .
.
initialization begin... end. .
|
|
finalization , .
.
, Delphi, () . , . . , Delphi, , ( ) . , , , , .. , , , Delphi.
Delphi .dcu .
, pas- , Delphi, .dfm , dcu- . , Delphi, dcu- () -. .