private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.FormCreate(Sender: TObject);
var
i: integer;
begin
for i:= 0 to maxg do
ListBox2.Items.Add(gg[i][2]);
ListBox2.ItemIndex:= 0;
end;
procedure TForm3.Button1Click(Sender: TObject);
var
i: integer;
begin
for i:= 0 to ListBox1.Items.Count - 1 do
if ListBox2.Items[ListBox2.ItemIndex] = ListBox1.Items[i]
then exit;
ListBox1.Items.Add(ListBox2.Items[ListBox2.ItemIndex]);
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
if ListBox1.ItemIndex = -1 then exit;
ListBox1.Items.Delete(ListBox1.ItemIndex);
end;
procedure TForm3.ComboBox1Change(Sender: TObject);
begin
ListBox2.ItemIndex:= LI[ComboBox1.ItemIndex];
ListBox2.TopIndex:= ListBox2.ItemIndex;
end;
procedure TForm3.Button3Click(Sender: TObject);
var
k: integer;
begin
k:= ListBox1.ItemIndex;
if k > 0 then
begin
ListBox1.Items.Move(k,k-1);
ListBox1.ItemIndex:= k -1;
end;
end;
procedure TForm3.Button4Click(Sender: TObject);
var
k: integer;
begin
k:= ListBox1.ItemIndex;
if k < ListBox1.Items.Count - 1 then
begin
ListBox1.Items.Move(k,k+1);
ListBox1.ItemIndex:= k+1;
end;
end;
procedure TForm3.ListBox2DblClick(Sender: TObject);
begin
Button1Click(nil);
end;
end.
// конец кода
* * *
// начало кода
object EditSt: TEditSt
Left = 175
Top = 164
Width = 692
Height = 303
Caption = 'Edit'
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
object Panel1: TPanel
Left = 0
Top = 240
Width = 684
Height = 36
Align = alBottom
BevelOuter = bvNone
TabOrder = 0
object BitBtn1: TBitBtn
Left = 16
Top = 8
Width = 75
Height = 25
TabOrder = 0
Kind = bkOK
end
object BitBtn2: TBitBtn
Left = 592
Top = 8
Width = 75
Height = 25
TabOrder = 1
Kind = bkCancel
end
object BitBtn3: TBitBtn
Left = 592
Top = 8
Width = 75
Height = 25
TabOrder = 2
Kind = bkAbort
end
object Button1: TButton
Left = 112
Top = 8
Width = 75
Height = 25
Caption = 'Bold'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 3
OnClick = Button1Click
end
object Button2: TButton
Left = 200
Top = 8
Width = 75
Height = 25
Caption = 'Italic'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsItalic]
ParentFont = False
TabOrder = 4
OnClick = Button2Click
end
end
object Memo1: TMemo
Left = 0
Top = 0
Width = 684
Height = 240
Align = alClient
ScrollBars = ssVertical
TabOrder = 1
end
end
// конец кода
// начало кода
unit EditStr;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Buttons, ComCtrls;
type
TEditSt = class(TForm)
Panel1: TPanel;
Memo1: TMemo;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
EditSt: TEditSt;
implementation
{$R *.dfm}
procedure TEditSt.Button1Click(Sender: TObject);
begin
with Memo1 do
if SelLength > 0 then
Memo1.SelText:= ''+ SelText + ''
end;
procedure TEditSt.Button2Click(Sender: TObject);
begin
with Memo1 do
if SelLength > 0 then
Memo1.SelText:= ''+ SelText + ''
end;
end.
// конец кода
* * *
// начало кода
object Form2: TForm2
Left = 359
Top = 204
Width = 502
Height = 285
Caption = 'Person'
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
object GroupBox1: TGroupBox
Left = 296
Top = 8
Width = 185
Height = 193
Caption = 'Author'
TabOrder = 0
object Label2: TLabel
Left = 8
Top = 24
Width = 45
Height = 13
Caption = 'first-name'
end
object Label3: TLabel
Left = 8
Top = 88
Width = 45
Height = 13
Caption = 'last-name'
end
object Label4: TLabel
Left = 8
Top = 120
Width = 46
Height = 13
Caption = 'nickname'
end
object Label5: TLabel
Left = 8
Top = 152
Width = 24
Height = 13
Caption = 'email'
end
object Label8: TLabel
Left = 8
Top = 56
Width = 47
Height = 13
Caption = 'midl-name'
end
object first_name: TEdit
Left = 64
Top = 16
Width = 113
Height = 21
TabOrder = 0
end
object last_name: TEdit
Left = 64
Top = 80
Width = 113
Height = 21
TabOrder = 1
end
object nickname: TEdit
Left = 64
Top = 112
Width = 113
Height = 21
TabOrder = 2
end
object mail: TEdit
Left = 64
Top = 144
Width = 113
Height = 21
TabOrder = 3
end
object mid_name: TEdit
Left = 64
Top = 48
Width = 113
Height = 21
TabOrder = 4
end
end
object Au: TGroupBox
Left = 8
Top = 8
Width = 185
Height = 193
Caption = 'Authors'
TabOrder = 1
object ListBox1: TListBox
Left = 8
Top = 15
Width = 169
Height = 170
ItemHeight = 13
TabOrder = 0
OnClick = ListBox1Click
end
end
object Button1: TButton
Left = 208
Top = 16
Width = 75
Height = 25
Caption = 'new'
TabOrder = 2
OnClick = Button1Click
end
object Button2: TButton
Left = 208
Top = 56
Width = 75
Height = 25
Caption = 'Add'
TabOrder = 3
OnClick = Button2Click
end
object Button3: TButton
Left = 208
Top = 96
Width = 75
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
Читать дальше