Пишем программу для создания книг FB2 | страница 20



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.

// конец кода

* * *

EditStr.dfm

// начало кода

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

// конец кода

EditStr.pas

// начало кода

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);