home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 October
/
Chip_2001-10_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d456
/
DCSLIB25.ZIP
/
DCCapEdit.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-01-20
|
2KB
|
83 lines
{
BUSINESS CONSULTING
s a i n t - p e t e r s b u r g
Components Library for Borland Delphi 4.x, 5.x
Copyright (c) 1998-2000 Alex'EM
}
unit DCCapEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, DCStdCtrls;
type
TStringEditDlg = class(TForm)
Memo: TMemo;
Bevel1: TBevel;
OKBtn: TButton;
CancelBtn: TButton;
procedure UpdateStatus(Sender: TObject);
procedure MemoKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
LineCount: TDCHeaderPanel;
public
constructor Create(AComponent: TComponent); override;
destructor Destroy; override;
end;
implementation
{$R *.DFM}
procedure TStringEditDlg.UpdateStatus(Sender: TObject);
var
Count: Integer;
begin
Count := Memo.Lines.Count;
if Count = 1 then
LineCount.Caption := Format('/ow{5}%d Line', [Count])
else
LineCount.Caption := Format('/ow{5}%d Lines', [Count]);
end;
procedure TStringEditDlg.MemoKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then CancelBtn.Click;
end;
constructor TStringEditDlg.Create(AComponent: TComponent);
begin
inherited;
LineCount := TDCHeaderPanel.Create(Self);
with LineCount do
begin
Parent := Self;
Left := 0;
Top := 0;
Width := 345;
Height := 19;
Alignment := taLeftJustify;
Caption := 'LineCount';
Color := clBtnFace;
TabOrder := 3;
VertCentered := True;
ButtonAllign := False;
CloseButtonExist := False;
end;
end;
destructor TStringEditDlg.Destroy;
begin
LineCount.Free;
inherited;
end;
end.