Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΡΠ°Π±ΠΎΡΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°
Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Π΄Π΅ΡΠ΅Π²Π° ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΡΠΌ ΠΏΡΡΡΠΌ. ΠΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ Π΄ΠΎΡΠ΅ΡΠ½Π΅Π³ΠΎ ΡΠ·Π»Π° 'ΠΠΊΡΡΡΠ°ΡΠΈΡΡΠΎΠ»Ρ'}. TreeView1.Items.AddChild (TreeView1.Items.Item, 'ΠΠ»ΠΎΠΊΠ°Π΄Ρ ΡΠ΅ΡΠ΄ΡΠ°'); TreeView1.Items.AddChild (TreeView1.Items.Item, 'ΠΠΊΡΡΡΠ°ΡΠΈΡΡΠΎΠ»Ρ'); Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,. Π ΠΈΡ. 2.1. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΎΠΊΠ½Π° «ΠΠ³Π»Π°Π²Π»Π΅Π½ΠΈΠ΅». Procedure TForm1. TreeView1Change (Sender: TObject; Node… Π§ΠΈΡΠ°ΡΡ Π΅ΡΡ >
Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΡΠ°Π±ΠΎΡΠ΅Π³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ° (ΡΠ΅ΡΠ΅ΡΠ°Ρ, ΠΊΡΡΡΠΎΠ²Π°Ρ, Π΄ΠΈΠΏΠ»ΠΎΠΌ, ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½Π°Ρ)
Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ
ΠΠ»Ρ ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ ΡΡΠ΅Π΄Π° Π²ΠΈΠ·ΡΠ°Π»ΡΠ½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Delphi. ΠΡΠΎΠ΅ΠΊΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΡ 2 ΠΎΠΊΠ½Π°:
ΠΠΊΠ½ΠΎ «ΠΠ³Π»Π°Π²Π»Π΅Π½ΠΈΠ΅» — ΠΠ»Π°Π²Π½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ.
ΠΠΊΠ½ΠΎ «ΠΠΎΠΈΡΠΊ» — ΠΠΊΠ½ΠΎ ΠΏΠΎΠΈΡΠΊΠ°.
Form1.
object Form1: TForm1.
Left = 203.
Top = 108.
Width = 766.
Height = 593.
Caption = 'Form1'.
Color = clBtnFace.
Font.Charset = DEFAULT_CHARSET.
Font.Color = clWindowText.
Font.Height = -11.
Font.Name = 'MS Sans Serif'.
Font.Style = [].
OldCreateOrder = False.
PixelsPerInch = 96.
TextHeight = 13.
2- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ PageControl1: TPageControl.
object PageControl1: TPageControl.
Left = 0.
Top = 0.
Width = 758.
Height = 566.
ActivePage = TabSheet1.
Align = alClient.
TabIndex = 0.
TabOrder = 0.
Π ΠΈΡ. 2.1. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΎΠΊΠ½Π° «ΠΠ³Π»Π°Π²Π»Π΅Π½ΠΈΠ΅»
3- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ TabSheet1: TTabSheet.
object TabSheet1: TTabSheet.
Caption = #1054#1075#1083#1072#1074#1083#1077#1085#1080#1077.
ParentShowHint = False.
ShowHint = False.
4 — DBMemo3: TDBMemo.
object DBMemo3: TDBMemo.
Left = 328.
Top = 24.
Width = 673.
Height = 209.
DataField = 'About'.
DataSource = DataSource1.
ScrollBars = ssVertical.
TabOrder = 2.
End.
Π ΠΈΡ. 2.2. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° ΠΎΠΊΠ½Π° «ΠΠΎΠΈΡΠΊ»
5 — ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ TreeView1: TTreeView.
object TreeView1: TTreeView.
Left = 8.
Top = 16.
Width = 305.
Height = 633.
Images = ImageList1.
Indent = 19.
TabOrder = 0.
OnChange = TreeView1Change.
Items.Data = {.
End.
6- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ DBMemo4: TDBMemo.
object DBMemo4: TDBMemo.
Left = 320.
Top = 264.
Width = 681.
Height = 385.
DataField = 'Simtom'.
DataSource = DataSource1.
ScrollBars = ssVertical.
TabOrder = 1.
End.
7-ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ StaticText3: TStaticText.
object StaticText3: TStaticText.
Left = 400.
Top = 0.
Width = 81.
Height = 17.
Caption=#1054'.
TabOrder = 3.
End.
8- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡTabSheet2: TTabSheet.
object.
Caption = #1055#1086#1080#1089#1082.
ImageIndex = 1.
9- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ DBGrid1: TDBGrid.
object DBGrid1: TDBGrid.
Left = 0.
Top = 8.
Width = 625.
Height = 273.
DataSource = DataSource1.
TabOrder = 0.
TitleFont.Charset = DEFAULT_CHARSET.
TitleFont.Color = clWindowText.
TitleFont.Height = -11.
TitleFont.Name = 'MS Sans Serif'.
TitleFont.Style = [].
Columns = <
item.
Expanded = False.
FieldName = 'Name'.
Title.Caption=#1053#1072#1079#1074#1072#.
Width = 315.
Visible = True.
End.
item.
Expanded = False.
FieldName = 'Gruop'.
Title.Caption = #1043#1088#1091#1087#1087#1072.
Width = 270.
Visible = True.
End.
10- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ DBMemo1: TDBMemo.
object DBMemo1: TDBMemo.
Left = 632.
Top = 24.
Width = 377.
Height = 641.
DataField = 'Simtom'.
DataSource = DataSource1.
ScrollBars = ssVertical.
TabOrder = 1.
End.
11- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ DBMemo2: TDBMemo.
object DBMemo2: TDBMemo.
Left = 0.
Top = 312.
Width = 625.
Height = 129.
DataField = 'About'.
DataSource = DataSource1.
ScrollBars = ssVertical.
TabOrder = 2.
End.
12- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ StaticText1: TStaticText.
object StaticText1: TStaticText.
Left = 720.
Top = 0.
Width = 111.
Height = 17.
Caption = #1057#1080#.
TabOrder = 3.
End.
13-ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ StaticText2: TStaticText.
object StaticText2: TStaticText.
Left = 176.
Top = 288.
Width = 123.
Height = 17.
Caption = #1054#1087#1080#1089#1072#1085#.
TabOrder = 4.
End.
14- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ GroupBox1: TGroupBox.
object GroupBox1: TGroupBox.
Left = -8.
Top = 440.
Width = 633.
Height = 73.
Caption = #1055#1086#1080#1089#1082.
TabOrder = 5.
15- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Button1: TButton.
object Button1: TButton.
Left = 8.
Top = 24.
Width = 145.
Height = 25.
Caption = #1055#1086#1080#1089.
TabOrder = 0.
OnClick = Button1Click.
End.
16- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Edit1: TEdit.
object Edit1: TEdit.
Left = 208.
Top = 24.
Width = 209.
Height = 21.
TabOrder = 1.
End.
17- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ DBNavigator1: TDBNavigator.
object DBNavigator1: TDBNavigator.
Left = 144.
Top = 520.
Width = 240.
Height = 25.
DataSource = DataSource1.
TabOrder = 6.
End.
18- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ DataSource1: TDataSource.
object DataSource1: TDataSource.
DataSet = Table1.
Left = 92.
Top = 40.
End.
19- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Table1: TTable.
object Table1: TTable.
Active = True.
DatabaseName = 'D:programma'.
TableName = 'tab1.db'.
Left = 52.
Top = 112.
End.
20- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Timer1: TTimer.
object Timer1: TTimer.
Interval = 3000.
OnTimer = Timer1Timer.
Left = 224.
Top = 64.
End.
21- ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ ImageList1: TImageList.
object ImageList1: TImageList.
Left = 360.
Top = 56.
Bitmap = {.
End.
Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Π΄Π΅ΡΠ΅Π²Π° ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΡΠΌ ΠΏΡΡΡΠΌ.
unit Polic;
interface.
uses.
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,.
Dialogs, ComCtrls, StdCtrls, DB, DBTables, Grids, DBGrids, DBCtrls,.
ExtCtrls, jpeg;
type.
TForm1 = class (TForm).
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Table1: TTable;
DBMemo1: TDBMemo;
DBMemo2: TDBMemo;
StaticText1: TStaticText;
StaticText2: TStaticText;
GroupBox1: TGroupBox;
Button1: TButton;
Edit1: TEdit;
DBNavigator1: TDBNavigator;
TreeView1: TTreeView;
DBMemo4: TDBMemo;
DBMemo3: TDBMemo;
StaticText3: TStaticText;
StaticText4: TStaticText;
Timer1: TTimer;
procedure Button1Click (Sender: TObject);
procedure TreeView1Change (Sender: TObject; Node: TTreeNode);
procedure Timer1Timer (Sender: TObject);
procedure Tree (Sender: TObject; Node: TTreeNode);
private.
{ Private declarations }.
public.
{ Public declarations }.
end;
var.
Form1: TForm1;
implementation.
{$R *.dfm}.
procedure TForm1. Button1Click (Sender: TObject);
begin.
Table1.Locate ('Name', Edit1. Text, [loPartialKey, loCaseInsensitive]);
end;
procedure TForm1. TreeView1Change (Sender: TObject; Node: TTreeNode);
var.
T:string;
j:integer;
begin.
j:= TreeView1.Selected.StateIndex;
T:=TreeView1.Items.Item[j]. Text;
Table1.Locate ('Name', T, [loPartialKey, loCaseInsensitive]);
end;
procedure TForm1. Timer1Timer (Sender: TObject);
begin.
Image1.Free;
Panel1.Free;
Timer1.Free.
end;
procedure TForm1. Tree (Sender: TObject; Node: TTreeNode);
begin.
TreeView1.Items.Clear; // ΠΎΡΠΈΡΡΠΊΠ° ΡΠΏΠΈΡΠΊΠ°.
// Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΊΠΎΡΠ½Π΅Π²ΠΎΠ³ΠΎ ΡΠ·Π»Π° 'ΠΠ³Π»Π°Π²Π»Π΅Π½ΠΈΠ΅' (ΠΈΠ½Π΄Π΅ΠΊΡ 0).
TreeView1.Items.Add (nil, 'ΠΠ³Π»Π°Π²Π»Π΅Π½ΠΈΠ΅');
{Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ Π΄ΠΎΡΠ΅ΡΠ½Π΅Π³ΠΎ ΡΠ·Π»Π° 'ΠΠ°Π±ΠΎΠ»Π΅Π²Π°Π½ΠΈΡ ΠΎΡΠ³Π°Π½ΠΎΠ² Π΄ΡΡ Π°Π½ΠΈΡ' (ΠΈΠ½Π΄Π΅ΠΊΡ 1}.
TreeView1.Items.AddChild (TreeView1.Items.Item[1], 'ΠΠ°Π±ΠΎΠ»Π΅Π²Π°Π½ΠΈΡ ΠΎΡΠ³Π°Π½ΠΎΠ² Π΄ΡΡ Π°Π½ΠΈΡ');
TreeView1.Items.AddChild (TreeViewl.Items.Item[2], 'ΠΠ±ΡΡΠ΅ΡΡ Π»Π΅Π³ΠΊΠΎΠ³ΠΎ ΠΎΡΡΡΡΠΉ');
TreeView1.Items.AddChild (TreeView1.Items.Item[3], 'ΠΠ±ΡΡΠ΅ΡΡ Ρ ΡΠΎΠ½ΠΈΡΠ΅ΡΠΊΠΈΠΉ');
{Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΊΠΎΡΠ½Π΅Π²ΠΎΠ³ΠΎ ΡΠ·Π»Π° 'ΠΠ°Π±ΠΎΠ»Π΅Π²Π°Π½ΠΈΡ ΡΠ΅ΡΠ΄Π΅ΡΠ½ΠΎ-ΡΠΎΡΡΠ΄ΠΈΡΡΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠΌΡ' ΠΏΠΎΡΠ»Π΅ ΡΠ·Π»Π° 'ΠΠ°Π±ΠΎΠ»Π΅Π²Π°Π½ΠΈΡ ΠΎΡΠ³Π°Π½ΠΎΠ² Π΄ΡΡ Π°Π½ΠΈΡ' (ΠΈΠ½Π΄Π΅ΠΊΡ 14) }.
TreeView1.Items.Add (TreeView1.Items.Item[14], 'ΠΠ°Π±ΠΎΠ»Π΅Π²Π°Π½ΠΈΡ ΡΠ΅ΡΠ΄Π΅ΡΠ½ΠΎ-ΡΠΎΡΡΠ΄ΠΈΡΡΠΎΠΉ ΡΠΈΡΡΠ΅ΠΌΠΌΡ');
{Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ Π΄ΠΎΡΠ΅ΡΠ½Π΅Π³ΠΎ ΡΠ·Π»Π° 'Π‘ΠΈΠ½ΡΡΠΎΠ²Π°Ρ Π±ΡΠ°Π΄Π°ΡΠ°ΡΠ΄ΠΈΡ'}.
TreeView1.Items.AddChild (TreeView1.Items.Item[15], 'Π‘ΠΈΠ½ΡΡΠΎΠ²Π°Ρ Π±ΡΠ°Π΄Π°ΡΠ°ΡΠ΄ΠΈΡ');
{Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ Π΄ΠΎΡΠ΅ΡΠ½Π΅Π³ΠΎ ΡΠ·Π»Π° 'ΠΠΊΡΡΡΠ°ΡΠΈΡΡΠΎΠ»Ρ'}.
TreeView1.Items.AddChild (TreeView1.Items.Item[16], 'ΠΠΊΡΡΡΠ°ΡΠΈΡΡΠΎΠ»Ρ');
TreeView1.Items.AddChild (TreeView1.Items.Item[17], 'ΠΠ°ΡΠΎΠΊΡΠΈΠ·ΠΌΠ°Π»ΡΠ½Π°Ρ ΡΠ°Ρ ΠΈΠΊΠ°ΡΠ΄ΠΈΡ');
TreeView1.Items.AddChild (TreeView1.Items.Item[18], 'ΠΠ΅ΡΡΠ°Π½ΠΈΠ΅ ΠΈ ΡΡΠ΅ΠΏΠ΅ΡΠ°Π½ΠΈΠ΅ ΠΏΡΠ΅Π΄ΡΠ΅ΡΠ΄ΠΈΠΉ');
TreeView1.Items.AddChild (TreeView1.Items.Item[19], 'ΠΠ΅ΡΡΠ°Π½ΠΈΠ΅ ΠΈ ΡΡΠ΅ΠΏΠ΅ΡΠ°Π½ΠΈΠ΅ ΠΆΠ΅Π»ΡΠ΄ΠΎΡΠΊΠΎΠ²');
TreeView1.Items.AddChild (TreeView1.Items.Item[20], 'ΠΠ»ΠΎΠΊΠ°Π΄Ρ ΡΠ΅ΡΠ΄ΡΠ°');
TreeView1.Items.AddChild (TreeView1.Items.Item[21], 'ΠΠ°ΡΠΎΠΊΡΠΈΠ·ΠΌΠ°Π»ΡΠ½Π°Ρ ΡΠ°Ρ ΠΈΠΊΠ°ΡΠ΄ΠΈΡ');
end;
end.
Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Π΄Π΅ΡΠ΅Π²Π° ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² Π²ΠΈΠ·ΡΠ°Π»ΡΠ½ΠΎ Ρ ΠΏΠΎΠΌΠΎΡΡΡ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΠ° TreeView ΠΏΡΠΈΠ²Π΅Π΄Π΅Π½ΠΎ Π½Π° ΡΠΈΡΡΠ½ΠΊΠ΅ 2.3.
Π ΠΈΡ. 2.3. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° Π΄Π΅ΡΠ΅Π²Π° ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² Π²ΠΈΠ·ΡΠ°Π»ΡΠ½ΠΎ