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



end;


procedure TForm1.ListBox1DblClick(Sender: TObject);

var

S: string;

CurStyle: TmyStyle;

i, st: integer;

begin


st:= ListBox1.itemIndex;

S:= GetStyle(ListBox1.Items[st], CurStyle);

with EditSt do

begin

Memo1.WordWrap:= true;

Memo1.Clear;

Memo1.Lines.Add(S);

ShowModal;


if ModalResult = mrOK then

begin

ListBox1.Items.Delete(st);

Memo1.WordWrap:= false;

for i:= Memo1.Lines.Count - 1 downto 0 do

ListBox1.Items.Insert(st, SetStyle1(CurStyle)+Memo1.Lines[i]);

end;


end;

end;


procedure TForm1.ListBox1Click(Sender: TObject);

begin

ShowHeadStyle(ListBox1.itemIndex);

end;


procedure TForm1.Button2Click(Sender: TObject);

begin

ChangeStyle(TmyStyle(Button2.Tag));

end;


procedure TForm1.Button5Click(Sender: TObject);

var

LStyle: TmyStyle;

begin

LStyle:= TmyStyle(Button2.Tag);

if LStyle < H5 then ChangeStyle(Succ(LStyle));

end;


procedure TForm1.Button1Click(Sender: TObject);

var

LStyle: TmyStyle;

begin

LStyle:= TmyStyle(Button2.Tag);

if LStyle > H1 then ChangeStyle(Pred(LStyle));

end;


end.

// конец кода

* * *

genres.dfm

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

object Form3: TForm3

Left = 214

Top = 121

BorderIcons = [biSystemMenu, biMinimize]

BorderStyle = bsSingle

Caption = 'Genre'

ClientHeight = 294

ClientWidth = 603

Color = clBtnFace

Font.Charset = DEFAULT_CHARSET

Font.Color = clWindowText

Font.Height = -11

Font.Name = 'MS Sans Serif'

Font.Style = []

OldCreateOrder = False

OnCreate = FormCreate

PixelsPerInch = 96

TextHeight = 13

object ListBox1: TListBox

Left = 8

Top = 8

Width = 241

Height = 209

ItemHeight = 13

TabOrder = 0

end

object Button1: TButton

Left = 272

Top = 32

Width = 75

Height = 25

Caption = 'Add'

TabOrder = 1

OnClick = Button1Click

end

object Button2: TButton

Left = 272

Top = 64

Width = 75

Height = 25

Caption = 'Delete'

TabOrder = 2

OnClick = Button2Click

end

object BitBtn1: TBitBtn

Left = 80

Top = 248

Width = 75

Height = 25

TabOrder = 3

Kind = bkOK

end

object BitBtn2: TBitBtn

Left = 448

Top = 240

Width = 75

Height = 25

TabOrder = 4

Kind = bkCancel

end

object Button3: TButton

Left = 272

Top = 112

Width = 75

Height = 25

Caption = 'Up'

TabOrder = 5

OnClick = Button3Click

end

object Button4: TButton

Left = 272

Top = 152

Width = 75

Height = 25

Caption = 'Down'

TabOrder = 6

OnClick = Button4Click

end

object ListBox2: TListBox

Left = 368

Top = 32

Width = 225

Height = 185

ItemHeight = 13

TabOrder = 7

OnDblClick = ListBox2DblClick

end

object ComboBox1: TComboBox

Left = 368

Top = 8

Width = 225

Height = 21

ItemHeight = 13

ItemIndex = 0

TabOrder = 8

Text = #1044#1077#1083#1086#1074#1072#1103' '#1083#1080#1090#1077#1088#1072#1090#1091#1088#1072