type
TExtendedTabSheet =
class(ComCtrls.TTabsheet)
constructor Create(AOwner: TComponent);
private
fSynEdit : TSynEdit;
public
published
property SynEdit : TSynEdit
read fSynEdit
write fSynEdit;
end;
{ ... }
var
SelectedSheet : TTabSheet;
{ ... }
constructor TExtendedTabSheet.Create(AOwner: TComponent);
begin
inherited;
fSynEdit := TSynEdit.Create(self);
with fSynEdit
do
begin
Parent := TWinControl(self);
Align := alClient;
end;
with fSynEdit
do
fSynEdit.Align := alClient;
fSynEdit.Show;
fSynEdit.Gutter.ShowLineNumbers:= true;
fSynEdit.Gutter.Font.
Name:= '
Times New Roman';
fSynEdit.Highlighter:= Form1.SynHTMLSyn1;
fSynEdit.lines.add ('
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">');
{ ... }
end;
procedure TForm1.AddNewTab(Caption :
string);
var
Sheet : TExtendedTabSheet;
begin
Sheet := TExtendedTabSheet.Create(Pages);
Sheet.PageControl := Pages;
Sheet.Caption := Caption;
Sheet.Show;
end;