Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.ssau.ru/files/education/metod_1/zemlyanoy_prilozheniya_delphi.pdf
Дата изменения: Tue Dec 9 17:23:51 2014
Дата индексирования: Mon Apr 11 02:45:17 2016
Кодировка:

Поисковые слова: с р р р р р р п п р р р р р р с
..

Delphi

2003


..

Delphi



2003
: .., .. 681.3.06 Delphi : /Cp. . . -; .: .., .. , 2003, 20 . Delphi. « » . " ".







-



Cp . .. .

. .

1.
Delphi Windows. Delphi (.1): , , .


.1. Delphi Delphi Delphi, . Delphi TComponent. Windows ­ , , , . . . . , . , : " ". , . 2.

.2. : Standard . . , . Label1. Label1 Caption . 5. Font . 1. 2. 3. 4.


6. 7. 8. 9. 10. 11.

, . 3...5 Y. Edit Edit (Edit1, Edit2, Edit3). . , . Button1. . Form1 . (). Delphi
procedure TForm1.Button1Click(Sender: TObject);

12. ,
var x,y,z:real; begin x:=strtofloat(Edit1.text); y:=strtofloat(Edit2.text); z:=sqrt(sqr(x)+sqr(y)); Edit3.text:=floattostr(z); end; 13. Save Project As... File, .

:
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); var x,y,z:real; begin x:=strtofloat(Edit1.text); y:=strtofloat(Edit2.text); z:=sqrt(sqr(x)+sqr(y)); Edit3.text:=floattostr(z); end; end.

2. Standard
2.1.
Standard: 1. TCheckBox ­ ; 2. 3. TRadioButton ­ ; TRadioGroup ­ .


Checked: if CheckBox1.Checked then ... ­ , if not TradioButton1.Checked then ... ­ . TRadioButton , . TRadioButton Checked true, false. TRadioButton TradioGroup. , Items. ItemIndex ­1 ( ). ItemIndex 0, , 1, . . , : 1. . 2. Z . , . 3. 3. , , Z Z (Edit3) ' !'. 4. , , Z Z (Edit3) ' !'.

. 3. :
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls, ExtCtrls, math; type TForm1 = class(TForm) CheckBox1: TCheckBox; RadioGroup1: TRadioGroup; Label1: TLabel; Label2: TLabel; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject); var Form1: TForm1; implementation procedure TForm1.Button1Click(Sender: TObject); var x,y,z:currency; begin x:=strtocurr(Edit1.text); y:=strtocurr(Edit2.text); if CheckBox1.checked=true then begin if RadioGroup1.ItemIndex=0 then z:=x+y; if RadioGroup1.ItemIndex=1 then z:=power(x,y); Edit3.text:=currtostr(z); if RadioGroup1.ItemIndex<0 then Edit3.text:=' !'; end else Edit3.text:=' !'; end; end.

Forms,

Dialogs,


2.2.
TScrollBar Standard . : Max: integer; - ; Min: integer; - ; Position: integer; - . . RGB (Red, Green, Blue, , , ). RGB 0, 0, 0, -- 255, 255, 255. . RGB , , TScrollBar 0 255.

. 4. :
unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, StdCtrls, ExtCtrls; type TForm1 = class(TForm) ScrollBar1: TScrollBar; ScrollBar2: TScrollBar; ScrollBar3: TScrollBar; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure ScrollBar1Change(Sender: TObject); private { Private declarations }

Controls,

Forms,

Dialogs,

public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.ScrollBar1Change(Sender: TObject); begin Form1.Color:=RGB(ScrollBar1.Position,ScrollBar2.Position, ScrollBar3.Position); end; end. , ScrollBar1Change TscrollBar. Events OnChange ScrollBar1Change.

3. Additional Win95 (Win32)
3.1. RTF-
TRichEdit ( Win32 Win95 ) RTF-. RTF , . TTextAttributes. DefAttributes


­ SelAttributes. TParaAttributes. TSpeedButton ( Additional) . , . , , , . . 5.

. 5. TRichEdit ( Win95) ­ RTF. Align alBottom ­ . TSpeedButton c Additional. Caption , I, ­ U. Font Times 10 , . AllowAllUp True, .. . GroupIndex 1, 2, 3. , . . 6.

. 6. TSpeedButton OnClick . SpeedButton1 (B):
procedure TForm1.SpeedButton1Click(Sender: TObject); begin CurrText:=RichEdit1.SelAttributes; if SpeedButton1.Down then CurrText.Style := CurrText.Style + [fsBold]; else CurrText.Style := CurrText.Style - [fsBold]; end; SpeedButton2 (I) SpeedButton3 (U) [fsBold] [fsItalic] [fsUnderline] . CurrText, , private: CurrText: TTextAttributes; . TRichEdit

. : , . Word ­ TspeedButton ( )


. :
procedure TForm1.SelectionChange(Sender: TObject); begin SpeedButton1.Down:=fsBold in RichEdit1.SelAttributes.Style; SpeedButton2.Down:=fsItalic in RichEdit1.SelAttributes.Style; SpeedButton3.Down:=fsUnderline in RichEdit1.SelAttributes.Style; end; TForm1 ( private) OnSelectionChange RichEdit1 ( Events). SelectionChange . OnCreate: procedure TForm1.FormCreate(Sender: TObject); begin SelectionChange(Self); end;

.

4.
4.1. InterBase
1. IB-
ibserver.exe ibguard.exe, C:\Program Files\InterBaseCorp\InterBase\bin.



ib

d

2.

Windows ISQL \\InterBase. 2.2. InterBase Interactive SQL Create Database File (. 7)

(). 2.1. InterBase


. 7. InterBase 2.3. Location Info Local Engine, DataBase C:\(Zem)\Samples\MyIB\My.gdb. 2.4. Password masterkey OK. 2.5. , 230 My.gdb. My.gdb. Borland Delphi5 BDE Administrator. 3.1. BDE (. 8) Object\New\INTRBASE (. 9), INTRBASE1 , (. . 8). 3.2. INTRBASE1, MyIBAlias. 3.3. C:\(Zem)\Samples\MyIB\My.gdb SERVER NAME, . 3.4. Object\Apply .

3.

. 8. BDE


. 9.

4.2.
1. DBD ( ), \\Borland
Delphi5\Database Desktop.

2. Create Table File\New\Table (. 10).

. 10. 2.1. INTRBASE. 2.2. Create INTRBASE Table (. 11), Type, STUDENT_ID , Required field.

. 11.


2.3. Save As... 2.3.1. Alias Save Table As MyIBAlias (. 12).

. 12. 2.3.2. 2.3.3. 2.3.4. DBD Save Table As STUDENT . . (. 13), STUDENT.

. 13. DBD STUDENT

4.3.
SQL Explorer Database Desktop, , . Data Access Data Controls. STUDENT MyIBAlias. 1. Data Access, DBGrid DBNavigator Data Controls, . 14.

. 14. DBGrid DBNavigator


2. 3.

Object Inspector , , DB, DatabaseName Database1 Object Inspector :

Database1.AliasName:= MyIBAlias Database1.Connected:=True Table1.DatabaseName:=DB Table1.TableName:=STUDENT Table1.Active:=True DataSource1.DataSet:=Table1 DBGrid1.DataSource:= DataSource1 DBNavigator1. DataSource:= DataSource1

4.

() , .

4.4. TDBChart
File\New\Business\TeeChartWisard . Form2 . Form1 Button OnClick Form2.Show. , Database Login, . 15. Button1 , (. 16).

. 15.


. 16.

! , , .


DELPHI :

. . 0203 01 30.12. 96 . __.__.200 3 . 60 84 1/1 6 . . . . . ____ . .- . ____ .- . . ____ 100 . . -3( 5)/ 2003. .

. . . 4430 86 , , 34. 4430 01 , . , 151.