Chapter 01 - Project Frames1 |
Project Structure
| Frames1.dpr |
program Frames1;
uses
Forms,
Form in 'Form.pas' ,
Frame in 'Frame.pas' ;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
| Form.pas |
unit Form;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Frame;
type
TForm1 = class(TForm)
Frame11: TFrame1;
private
public
end;
var
Form1: TForm1;
implementation
end.
| Frame.pas |
unit Frame;
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TFrame1 = class(TFrame)
EditList: TEdit;
ListList: TListBox;
btnAdd: TButton;
btnDelete: TButton;
procedure btnAddClick(Sender: TObject);
procedure btnDeleteClick(Sender: TObject);
private
public
end;
implementation
procedure TFrame1.btnAddClick(Sender: TObject);
begin
if EditList.Text <> '' then
ListList.Items.Add (EditList.Text);
end;
procedure TFrame1.btnDeleteClick(Sender: TObject);
begin
if ListList.ItemIndex >= 0 then
ListList.Items.Delete (ListList.ItemIndex);
end;
end.
| Form.dfm |
object Form1: TForm1
Left = 434
Top = 123
Width = 320
Height = 284
Caption = 'Frames1'
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
inline Frame11: TFrame1
Left = 16
Top = 24
Width = 266
Height = 197
TabOrder = 0
end
end
| Frame.dfm |
object Frame1: TFrame1
Left = 0
Top = 0
Width = 266
Height = 197
TabOrder = 0
object EditList: TEdit
Left = 8
Top = 8
Width = 169
Height = 21
TabOrder = 0
end
object ListList: TListBox
Left = 8
Top = 32
Width = 169
Height = 161
ItemHeight = 13
TabOrder = 1
end
object btnAdd: TButton
Left = 184
Top = 56
Width = 75
Height = 25
Caption = '&Add'
TabOrder = 2
OnClick = btnAddClick
end
object btnDelete: TButton
Left = 184
Top = 88
Width = 75
Height = 25
Caption = '&Delete'
TabOrder = 3
OnClick = btnDeleteClick
end
end
|
|