Пользователь
Сообщения: 66
Благодарности: 29
|
Профиль
|
Отправить PM
| Цитировать
p3rf3ct1c, procedure InitializeWizard должна выглядеть вот так:
читать дальше »
Код: 
procedure InitializeWizard();
var
WLabel1, WLabel2,
FLabel1, FLabel2: TLabel;
begin
ExtractTemporaryFile('1.bmp');
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.LicensePage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.SelectDirPage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.InstallingPage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.SetBounds(0, 0, 497, 360);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.FinishedPage;
BmpFile:= TBitmapImage.Create(WizardForm);
WizardForm.BorderStyle := bsDialog;
ProgressBar:= TNewProgressBar.Create(WizardForm);
ExtractFile:=TNewStaticText.Create(WizardForm);
lblExtractFileName:= TLabel.Create( WizardForm );
with WizardForm.ProgressGauge do
begin
// Create a label to show current FileName being extracted
lblExtractFileName.parent:=WizardForm.InstallingPage;
lblExtractFileName.autosize:=false;
lblExtractFileName.Width:= Width;
lblExtractFileName.top:=Top + ScaleY(35);
lblExtractFileName.Caption:= '';
// Create a label to show percentage
ExtractFile.parent:=WizardForm.InstallingPage;
ExtractFile.autosize:=false;
ExtractFile.Width:= Width;
ExtractFile.top:=lblExtractFileName.Top + ScaleY(16);
ExtractFile.caption:=cm('ArcTitle');
// Create a separate progress bar
ProgressBar.SetBounds(Left, ExtractFile.Top + ScaleY(16), Width, Height);
ProgressBar.Parent:= WizardForm.InstallingPage;
ProgressBar.max:= 1000;
ProgressBar.Position:= 0;
end;
// Create a 'Cancel unpacking' button and hide it for now.
btnCancelUnpacking:=TButton.create(WizardForm);
btnCancelUnpacking.Parent:= WizardForm;
btnCancelUnpacking.SetBounds(260, WizardForm.cancelbutton.top, 135, WizardForm.cancelbutton.Height);
btnCancelUnpacking.OnClick:= @btnCancelUnpackingOnClick;
btnCancelUnpacking.Caption:= cm('ArcCancel');
btnCancelUnpacking.Hide;
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
DiskSpaceLabel.Hide;
SelectDirBitmapImage.Hide;
SelectDirBrowseLabel.Hide;
SelectDirLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
MainPanel.Hide
FilenameLabel.Hide;
StatusLabel.Hide;
end;
with WizardForm do
begin
DirBrowseButton.Left:= DirBrowseButton.Left + ScaleX(40);
DirBrowseButton.Top:= DirBrowseButton.Top + ScaleY(72);
DirEdit.Left:= DirEdit.Left + ScaleX(40);
DirEdit.Top:= DirEdit.Top + ScaleY(72);
NextButton.BringToFront;
BackButton.BringToFront;
CancelButton.BringToFront;
Font.Style:=[];
Font.Name:= 'MS Sans Serif';
DirEdit.Color:=clBlack;
Font.Color:=clWhite;
ProgressGauge.Top:=ScaleY(120);
ProgressGauge.Left:=ScaleX(20);
end;
with WizardForm do
begin
InnerNotebook.Left := ScaleX(0);
InnerNotebook.Top := ScaleY(0);
InnerNotebook.Width := ScaleX(497);
InnerNotebook.Height := ScaleY(360);
OuterNotebook.Left := ScaleX(0);
OuterNotebook.Top := ScaleY(0);
OuterNotebook.Width := ScaleX(497);
OuterNotebook.Height := ScaleY(360);
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
Left:= ScaleX(176);
Top:= ScaleY(66);
Width:= ScaleX(301);
Height:= ScaleY(54);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Size:= 14;
Font.Color:=ClWhite
Font.Style := [fsBold]
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel1.Caption; //'Âàñ ïðèâåòñòâóåò Ìàñòåð' + #10 + 'óñòàíîâêè Prototype'
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Top:= ScaleY(136);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel2.Caption; //'Ïðîãðàììà óñòàíîâèò Prototype íà Âàø êîìïüþòåð.' + #10#13#10 + 'Ðåêîìåíäóåòñÿ çàêðûòü âñå ïðî÷èå ïðèëîæåíèÿ ïåðåä' + #10 + 'òåì, êàê ïðîäîëæèòü.' + #10#13#10 + 'Íàæìèòå «Äàëåå», ÷òîáû ïðîäîëæèòü èëè «Îòìåíà»,' + #10 + '÷òîáû âûéòè èç ïðîøðàììû óñòàíîâêè.';
end;
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Top:= ScaleY(66);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(53);
AutoSize:= false;
WordWrap:= true;
Font.Size:= 14;
Font.Color:=ClWhite
Font.Style := [fsBold]
Transparent:= true;
Parent:= WizardForm.FinishedPage;
Caption:= WizardForm.FinishedHeadingLabel.Caption; //'Çàâåðøåíèå Ìàñòåðà óñòàíîâêè' + #10 + 'Prototype'
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Left:= ScaleX(176);
Top:= ScaleY(136);
Width:= ScaleX(301);
Height:= ScaleY(54);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Parent:= WizardForm.FinishedPage;
Caption:= 'Èãðà Prototype óñòàíîâëåíà íà Âàø êîìïüþòåð.' + #10#13#10 + 'Íàæìèòå «Çàâåðøèòü», ÷òîáû âûéòè èç ïðîãðàììû' + #10 + 'óñòàíîâêè.'
end;
// ñîçäà¸ì lblSelectDir
lblSelectDir:= TLabel.Create(WizardForm);
with lblSelectDir do
begin
Caption:= WizardForm.SelectDirLabel.Caption;
Left:= ScaleX(40);
Top:= WizardForm.SelectDirLabel.Top + ScaleY(62);
Width:= WizardForm.SelectDirLabel.Width;
Height:= WizardForm.SelectDirLabel.Height;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
end;
// ñîçäà¸ì lblSelectDirBrowse
lblSelectDirBrowse:= TLabel.Create(WizardForm);
with lblSelectDirBrowse do
begin
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Left:= ScaleX(40);
Top:= WizardForm.SelectDirBrowseLabel.Top + ScaleY(62);
Width:= WizardForm.SelectDirBrowseLabel.Width;
Height:= WizardForm.SelectDirBrowseLabel.Height;
WordWrap:= True;
Transparent:= True;
Parent:= WizardForm.SelectDirPage;
end;
NeedSpaceLabel:= TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= ScaleY(262);
Width:= ScaleX(209);
Height:= ScaleY(13);
Transparent:= True;
end;
FreeSpaceLabel:= TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= ScaleY(280);
Width:= ScaleX(209);
Height:= ScaleY(13);
Transparent:= True;
end;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
PageNameLabel:= TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left:= WizardForm.PageNameLabel.Left;
Top:= WizardForm.PageNameLabel.Top;
Width:= ScaleX(300);
Height:= ScaleY(14);
AutoSize:= False;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
end;
PageNameLabel1:= TLabel.Create(WizardForm);
with PageNameLabel1 do
begin
Left:= WizardForm.PageNameLabel.Left;
Top:= WizardForm.PageNameLabel.Top;
Width:= ScaleX(300);
Height:= ScaleY(14);
AutoSize:= False;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= WizardForm.PageDescriptionLabel.Left;
Top:= WizardForm.PageDescriptionLabel.top;
Width:= WizardForm.PageDescriptionLabel.Width;
Height:= WizardForm.PageDescriptionLabel.Height;
AutoSize:= False;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
end;
PageDescriptionLabel1:= TLabel.Create(WizardForm);
with PageDescriptionLabel1 do
begin
Left:= WizardForm.PageDescriptionLabel.Left;
Top:= WizardForm.PageDescriptionLabel.top;
Width:= WizardForm.PageDescriptionLabel.Width;
Height:= WizardForm.PageDescriptionLabel.Height;
AutoSize:= False;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;
StatusLabel:= TLabel.Create(WizardForm);
with StatusLabel do
begin
Left:= ScaleX(20);
Top:= ScaleY(100);
Width:= WizardForm.StatusLabel.Width;
Height:= WizardForm.StatusLabel.Height;
AutoSize:= False;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;
begin
DesktopIcon := TCheckBox.Create(WizardForm);
with DesktopIcon do
begin
Parent := WizardForm.SelectDirPage;
Caption := 'Äîáàâèòü ÿðëûê íà ðàáî÷èé ñòîë';
Left := ScaleX(0);
Top := WizardForm.DirEdit.Top+35;
Width := ScaleX(400);
Height := ScaleY(15);
TabOrder := 0;
Checked := True;
end;
// óìåíüøèë ðàçìåð CheckBox'à, ïî äðóãîìó íèêàê
DirectX:= TCheckBox.Create(WizardForm);
with DirectX do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left + 200;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 0;
Checked:= False;
end;
// ñîçäà¸ì íàäïèñü äëÿ CheckBox'à
lblDirectX:= TLabel.Create(WizardForm);
with lblDirectX do
begin
Caption:= ExpandConstant('{cm:DRT}');
Left:= WizardForm.DirEdit.Left + 220;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @lblDirectXOnClick;
end;
Redist:= TCheckBox.Create(WizardForm);
with Redist do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left + 200;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 1;
Checked:= False;
end;
lblRedist:= TLabel.Create(WizardForm);
with lblRedist do
begin
Caption:='Óñòàíîâèòü MS Visual C++ 2005';
Left:= WizardForm.DirEdit.Left + 220;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @RedistOnClick;
end;
Icons:= TCheckBox.Create(WizardForm);
with Icons do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 2;
Checked:= False;
end;
lblIcons:= TLabel.Create(WizardForm);
with lblIcons do
begin
Caption:='Ñîçäàòü ÿðëûê íà ðàáî÷åì ñòîëå';
Left:= WizardForm.DirEdit.Left + 20;
Top:= WizardForm.DirEdit.Top + 35;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @IconsOnClick;
end;
Group:= TCheckBox.Create(WizardForm);
with Group do
begin
Parent:= WizardForm.SelectDirPage;
Left:= WizardForm.DirEdit.Left;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 3;
Checked:= False;
end;
lblGroup:= TLabel.Create(WizardForm);
with lblGroup do
begin
Caption:='Ñîçäàòü ÿðëûêè â ìåíþ "Ïóñê"';
Left:= WizardForm.DirEdit.Left + 20;
Top:= WizardForm.DirEdit.Top + 70;
Width:= ScaleX(150);
Height:= ScaleY(13);
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @GroupOnClick;
end;
NeedSize := 3220;
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(202);
Width := ScaleX(209);
Height := ScaleY(13);
end;
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
PageNameLabel := TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left := ScaleX(10);
Top := ScaleY(10);
Width := ScaleX(300);
Height := ScaleY(14);
AutoSize := False;
WordWrap := True;
Font.Color := clWhite;
Font.Style := [fsBold];
Transparent := True;
Parent := WizardForm.MainPanel;
end;
PageDescriptionLabel := TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left := ScaleX(15);
Top := ScaleY(25);
Width := ScaleX(475);
Height := ScaleY(30);
AutoSize := False;
WordWrap := True;
Font.Color := clWhite;
Transparent := True;
Parent := WizardForm.MainPanel;
end;
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with MainPanel do
begin
with WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(0);
Width := Mainpanel.Width;
Height := MainPanel.Height;
end;
end;
end;
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.WizardBitmapImage.Width := WizardForm.Width;
WizardForm.WizardBitmapImage.Height := WizardForm.Height;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage.Height := 313;
WizardForm.WizardSmallBitmapImage.Width:=497;
WizardForm.WizardSmallBitmapImage.Height:=58;
WizardForm.WizardBitmapImage2.Width := WizardForm.Width;
WizardForm.WizardBitmapImage2.Height := WizardForm.Height;
end;
end;
end;
|
Отправлено: 22:51, 10-07-2009
| #1107
|