unit TabSheetfrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ExtCtrls, Grids, StdCtrls;
type
TfrmTabSheet =
class(TForm)
pnlTabSheet: TPanel;
PageControl: TPageControl;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
LblEdit: TLabeledEdit;
top,left,height,length,counterSheets,counterlblEdit: integer;
Sheet: TTabSheet;
Grid: TStringGrid;
public
{ Public-Deklarationen }
ListeTabSheet: TList;
ListelblEdit: TList;
pnllbledit: TPanel;
pnlgrid: TPanel;
excecbtn: TButton;
procedure TabSheeterstellung(anzahl: Integer);
procedure pnlerstellunglbledit;
procedure lblEditerstellung;
procedure Sheeterstellung(AktuSpzahl: integer);
procedure pnlerstellungGrid;
procedure Griderstellung;
procedure Excecutebtnerstellung;
end;
var
frmTabSheet: TfrmTabSheet;
implementation
uses Memofrm, SPViewerMainfrm;
{$R *.dfm}
{ TfrmTabSheet }
procedure TfrmTabSheet.TabSheeterstellung(anzahl: Integer);
var
i: integer;
begin
top:= 20;
left:= 20;
height:= 25;
length:= 0;
counterSheets:= 0;
for i:= 0
to anzahl-1
do
begin
counterlblEdit:= 0;
frmMain.ADOQry.SQL.Text:= '
Select * FROM qsys2.sysparms WHERE SPECIFIC_SCHEMA=''
KOSYFAREV''
AND SPECIFIC_NAME=''
' + frmMain.ProcedureNamen[i] + '
''
';
frmMain.ADOQry.Open;
frmMain.ADOQry.First;
while not frmMain.ADOQry.Eof
do
begin
if length < Canvas.TextWidth(frmMain.ADOQry.Fields[4].AsString)
then
length:= Canvas.TextWidth(frmMain.ADOQry.Fields[4].AsString);
frmMain.ADOQry.Next;
end;
frmMain.ADOQry.First;
if frmMain.ADOQry.RecordCount<> 0
then
begin
Sheeterstellung(i);
pnlerstellunglbledit;
pnlerstellungGrid;
while not frmMain.ADOQry.Eof
do
lblEditerstellung;
Griderstellung;
counterSheets:= counterSheets + 1;
Excecutebtnerstellung;
frmMemo.lblEditerstellt(counterlblEdit);
end;
length:= 0;
height:= 25;
top:= 20;
left:= 20;
end;
frmMemo.insgesammtsheet(counterSheets);
end;
procedure TfrmTabSheet.FormShow(Sender: TObject);
begin
PageControl.SetFocus;
end;
procedure TfrmTabSheet.FormCreate(Sender: TObject);
begin
ListelblEdit:= TList.Create();
end;
procedure TfrmTabSheet.lblEditerstellung;
begin
LblEdit:= TLabeledEdit.Create(self);
LblEdit.Parent:= pnllbledit;
LblEdit.EditLabel.Caption:= frmMain.ADOQry.Fields[4].AsString;
LblEdit.LabelPosition:= lpLeft;
LblEdit.Text:= '
';
LblEdit.Top:= top;
LblEdit.Left:= left + length;
LblEdit.Height:= height;
top:= top + 20;
counterlblEdit:= counterlblEdit + 1;
frmMain.ADOQry.next;
end;
procedure TfrmTabSheet.Sheeterstellung(AktuSpzahl: integer);
begin
Sheet:= TTabSheet.Create(PageControl);
Sheet.Parent:= PageControl;
Sheet.Caption:= frmMain.ProcedureNamen[AktuSpzahl];
frmMemo.Tabsheeterstellt(Sheet.Caption);
Sheet.PageControl:= PageControl;
end;
procedure TfrmTabSheet.Griderstellung;
begin
grid:= TStringgrid.create(self);
grid.Parent:= pnlgrid;
grid.Left:= 0;
grid.RowCount:= 2;
grid.DefaultRowHeight:=15;
grid.ColCount:= 2;
grid.DefaultColWidth:= 60;
grid.ColWidths[0]:= 15;
grid.Align:= alClient;
end;
procedure TfrmTabSheet.pnlerstellunglbledit;
begin
pnllbledit:= TPanel.Create(self);
pnllbledit.Parent:= Sheet;
pnllbledit.Left:= 0;
pnllbledit.Width:= 350;
pnllbledit.Align:= alLeft;
end;
procedure TfrmTabSheet.pnlerstellungGrid;
begin
pnlgrid:= TPanel.Create(self);
pnlgrid.Parent:= Sheet;
pnlgrid.Left:= 350;
pnlgrid.Align:= alClient;
end;
procedure TfrmTabSheet.Excecutebtnerstellung;
begin
excecbtn:= TButton.Create(self);
excecbtn.Parent:= pnllbledit;
excecbtn.Caption:= '
Excecute SP';
excecbtn.Top:= top + 30;
excecbtn.Left:= length+left;
end;
end.