. . . Delphi Object Pascal, , . 1970 . Borland ( Turbo Pascal, Borland Pascal Object Pascal). , Delphi , Object Pascal , .
, Windows-. , . () , . :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Frms, Dialogs;
type
TFormI = class(TForm) private { Private declarations } public { Public declarations } end; |
var
Form1: TForm1; |
implementation
{SR *.DFM}
end.
Delphi . , (. . , ), - . , Delphi ,
unit Unit1;
implementation
{$R-*.DFM}
end.
.
(), , , ( ) , . . Enter. , Backspace ( - ). Backspace , Delete - . , , Ctrl , , Y. +: Ctrl+Y. , Ctrl+Z Edit | Undo. ) Code Explorer, , .
|
|
. . view Explorer. , . , .
6 - ode Diagram. . . , . , Shift, , Shift, . . , . .
Delphi : (. . Windows-) , . , - Delphi, - .
;, Delphi. , - . , , , , , , . Delphi- .
Windows- . , Delphi , Windows. , File | New | Application, . : () Delphi.
. . , . , , , - . , , my_delph, - . , pgm_1 - .
|
|
, , - Delphi. , . Tools | Environment options , preferences. Autosave | Options Editor Files Desktop ( Delphi ). Delphi , . , . , Show Compiler progress Compiling and Running. , - , , . , , , . Delphi Courier New, . Tools | Editor options Display Editor Font Courier New Cyr ( Display Tools | Environment Options).
. , , F9: Delphi- - , . Object Pascal , , .
F9, Save Unit1 As, Delphi Unit1. .
Delphi BIN. Delphi , (, MY_DELPHI).
Delphi Unit1.s, - . , my_ist_u, , , __ | , ). Save Uniti As Enter, Delphi . -, , , firstpgm - Delphi-.
, . , Delphi , , , , , , , , . , . , 8 - Delphi 1. Windows ., . Delphi 32 (. . 2- 6-), my_first_unit moy_pervij_modul, 32- , . , , - , Windows-: , , .
|
|
. , - . , ( , , , - ). Delphi pas, dfm : pas- , dfm , - - . dcu , .
, , . (. . - ) : Form1. , . Form1 Caption.
() . . F11 , Windows.
Form1 . , F9. , , Form1.
, : - . .
. ( ) , , .
Label (), . , Standard, ( Label ). , (. 1). , .
|
|
Label1, . : Caption : Delphi. , , , .
. Font . size () 24, Color () (, ), .
1. Label
. Delphi , .
, , , , . , . . ( ), , , , .
, [ Delphi , . .] Left (), (), width () Height (), , . . , . - . Delphi 4, 5 6 Left .
Object Pascal, . . . , . , .
: - - , .
standard . ( 2).
OnClick. ( ). , . , object pascal , .
2.
, , . Object Pascal - .
Delphi OnClick, . Delphi , :
procedure TFormI.ButtonlClick(Sender: TObject);
begin
end;
procedure - ( Delphi -; procedure () function (); ). TFormi.ButtonlClick. - : TForm1 Button1Click.
|
|
Delphi , . , () . . Delphi , Borland ( ). .
, , , . Delphi . , TFormi , TForm. , :
type
TFormi = class(TForm) Button1: TButton; Label1: TLabel; procedure ButtonlClick(Sender: TObject); |
private
{ Private declarations } public { Public declarations } end; |
varForm1: TForm1;
TForm1 = class(TForm)
Tform1, ( ) TForm.
Form1: Tform1; |
Formi. TForm Windows-, TFormI .
Button1: TButton; Label 1: TLabel; |
, Buttoni (!) TButton, Label 1 ( 1) - TLabel.
TFormi. Buttoniciick
Sender: TObject
( Sender TObject). , , . ( ) . Sender Delphi : Button1Click , OnClick.
procedureTFormI.Buttoniciick(Sender: TObject);
. ;. Object Pascal, . . -- . . - .
:
begin end; |
begin () , , end () - . - , : Delphi , , . - .
, Button1 , , begin end , . , : begin...end :
MessageBeep (_);
, . Button1 , . . , Windows .
Buttoni , : Buttoni, Delphi , , , . , . . ( caption Button1 ), Delphi . OnCreate ( ) .
OnCreate windows-, . , , Formi OnCreate Events ( oncreate). Delphi TForm1. FormCreate. :
procedure TFormi.FormCreate(Sender: TObject); begin Button1.Caption:= ''; end; |
Object Pascal. Buttoni. caption, - ' ', . : =, . := , , , . , .
Button1.Caption , : ( ), Caption; Button1 , . . Object Pascal . - ( ) .
, : , . . .