Height = 25
Caption = 'Edit'
TabOrder = 4
OnClick = Button3Click
end
object Button4: TButton
Left = 208
Top = 136
Width = 75
Height = 25
Caption = 'Delete'
TabOrder = 5
OnClick = Button4Click
end
object BitBtn1: TBitBtn
Left = 96
Top = 224
Width = 75
Height = 25
TabOrder = 6
Kind = bkOK
end
object BitBtn2: TBitBtn
Left = 328
Top = 224
Width = 75
Height = 25
TabOrder = 7
Kind = bkCancel
end
end
// конец кода
authors.pas
// начало кода
unit authors;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TPerson = class
fName: string;
mName: string;
lName: string;
nick: string;
emaiclass="underline" string;
constructor Create;
end;
TForm2 = class(TForm)
GroupBox1: TGroupBox;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label8: TLabel;
first_name: TEdit;
last_name: TEdit;
nickname: TEdit;
maiclass="underline" TEdit;
mid_name: TEdit;
Au: TGroupBox;
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
constructor TPerson.Create;
begin
fName:= '';
mName:= '';
lName:= '';
nick:= '';
emaiclass="underline" = '';
end;
procedure TForm2.Button1Click(Sender: TObject);
begin // New
first_name.Text:= '';
mid_name.Text:= '';
last_name.Text:= '';
nickname.Text:= '';
mail.Text:= '';
end;
procedure TForm2.Button2Click(Sender: TObject);
var
Person: TPerson;
begin // Add
Person:= TPerson.Create;
with Person do
begin
fName:= first_name.Text;
mName:= mid_name.Text;
lName:= last_name.Text;
nick:= nickname.Text;
emaiclass="underline" = mail.Text;
ListBox1.Items.AddObject(lName+' '+fName,Person);
end;
end;
procedure TForm2.ListBox1Click(Sender: TObject);
var
Person: TPerson;
begin
with ListBox1 do
Person:= TPerson(Items.Objects[ItemIndex]);
with Person do
begin
first_name.Text:= fName;
mid_name.Text:= mName;
last_name.Text:= lName;
nickname.Text:= nick;
mail.Text:= email;
end;
end;
procedure TForm2.Button3Click(Sender: TObject);
var
Person: TPerson;
begin // Edit
with ListBox1 do
begin
if ItemIndex = – 1 then exit;
Person:= TPerson(Items.Objects[ItemIndex]);
end;
with Person do
begin
fName:= first_name.Text;
mName:= mid_name.Text;
lName:= last_name.Text;
nick:= nickname.Text;
emaiclass="underline" = mail.Text;
with ListBox1 do
Items[ItemIndex]:=lName+' '+fName;
end;
end;
procedure TForm2.Button4Click(Sender: TObject);
var
Person: TPerson;
begin // Delete
with ListBox1 do
begin
if ItemIndex = – 1 then exit;
Person:= TPerson(Items.Objects[ItemIndex]);
Person.Free;
Items.Delete(ItemIndex);
end;
end;
end.
// конец кода
dm.pas
Это просто текстовый файл, без формы.
// начало кода
unit dm;
interface
type
gr = array[1..2] of string;
const
maxg = 151;
gg: array[0..maxg] of gr = (// Список жанров
// Деловая литература
('banking', 'Банковское дело'),
('accounting', 'Бухучет, налогообложение, аудит'),
('global_economy', 'Внешнеэкономическая деятельность'),
('paper_work', 'Делопроизводство'),
('org_behavior', 'Корпоративная культура'),
('personal_finance', 'Личные финансы'),
('small_business', 'Малый бизнес'),
('marketing', 'Маркетинг, PR, реклама'),
('real_estate', 'Недвижимость'),
('popular_business', 'О бизнесе популярно'),
('industries', 'Отраслевые издания'),
('job_hunting', 'Поиск работы, карьера'),
('economics_ref', 'Справочники'),