Новый участник
Сообщения: 14
Благодарности: 10
|
Профиль
|
Отправить PM
| Цитировать
vint56,
читать дальше »
Код: 
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[__code]
var
BrowseDialogTitle,BrowseDialogTitle1,BrowseDialogLabel:Tlabel;
Edit: TNewEdit;
i:Integer;
DirTreeView : TFolderTreeView;
Browse, OK, NO, back, new,DirBrowseSetting: TButton;
MainPanelBigBevel: TBevel;
DirPanel,MainPanelBig1,MainPanelBig2: TPanel;
procedure Okclick(Sender: TObject);
begin
WizardForm.DirEdit.Text:=AddBackslash(Edit.Text);
if DirPanel.Visible then DirPanel.hide;
end;
procedure BackClick(Sender: TObject);
begin
Edit.Text:=AddBackslash(ExpandConstant('{pf}\')+'My Application');
DirTreeView.ChangeDirectory(AddBackslash(ExpandConstant('{pf}\')), True);
end;
procedure NOclick(Sender: TObject);
begin
DirTreeView.ChangeDirectory(AddBackslash(WizardForm.dirEdit.Text), true);
Edit.Text:=(DirTreeView.Directory);
if DirPanel.Visible then DirPanel.hide;
end;
procedure DirFolderChange(Sender: TObject);
Begin
Edit.Text:=AddBackslash(DirTreeView.Directory) + 'My Application';
end;
procedure DirBrowseSettingOnClick(Sender: TObject);
begin
if not DirPanel.Visible then DirPanel.show;
end;
procedure InitializeWizard();
begin
WizardForm.ClientWidth:=ScaleX(580);
WizardForm.ClientHeight:=ScaleY(410);
WizardForm.Center;
WizardForm.OuterNotebook.Hide;
WizardForm.InnerNotebook.Hide;
WizardForm.Bevel.hide;
WizardForm.Bevel1.hide;
WizardForm.Color := clMenu;
WizardForm.NextButton.SetBounds(ScaleX(460),ScaleY(374),ScaleX(110),ScaleY(30));
WizardForm.CancelButton.SetBounds(ScaleX(487),ScaleY(500),ScaleX(110),ScaleY(30));
WizardForm.BackButton.SetBounds(ScaleX(340),ScaleY(374),ScaleX(110),ScaleY(30));
WizardForm.DirEdit.Parent:=WizardForm;
WizardForm.DirEdit.SetBounds(ScaleX(20),ScaleY(200),ScaleX(350),ScaleY(30));
DirBrowseSetting := TButton.Create(WizardForm);
with DirBrowseSetting do begin
Parent := WizardForm;
SetBounds(ScaleX(340),ScaleY(374),ScaleX(110),ScaleY(30));
Caption := 'Настройки';
OnClick:= @DirBrowseSettingOnClick;
end;
DirPanel:= Tpanel.Create(WizardForm);
with DirPanel do begin
Parent:=WizardForm;
BevelOuter:= bvNone;
Align:=alClient;
hide;
end;
for i:=0 to 3 do
begin
with TBevel.Create(WizardForm) do
begin
BringToFront;
Shape:=bsTopLine;
Case i of
0:
begin
Parent:=WizardForm;
SetBounds(ScaleX(0),ScaleY(365),ScaleX(580),ScaleY(2));
end;
1:
begin
Parent:=DirPanel;
SetBounds(ScaleX(0),ScaleY(365),ScaleX(580),ScaleY(2));
end;
2:
begin
Parent:=WizardForm;
SetBounds(ScaleX(0),ScaleY(47),ScaleX(580),ScaleY(2));
end;
3:
begin
Parent:=DirPanel;
SetBounds(ScaleX(0),ScaleY(47),ScaleX(580),ScaleY(2));
end;
end;
end;
end;
Back:=tbutton.create(DirPanel)
with back do begin
SetBounds(ScaleX(250),ScaleY(375),ScaleX(100),ScaleY(30));
parent:=DirPanel;
Caption:='Сброс';
onclick:=@BackClick;
end;
Ok:=tbutton.create(DirPanel)
with ok do begin
SetBounds(ScaleX(360),ScaleY(375),ScaleX(100),ScaleY(30));
parent:=DirPanel;
Caption:='OK';
onclick:=@OKclick;
end;
No:=tbutton.create(DirPanel)
with no do begin
SetBounds(ScaleX(470),ScaleY(375),ScaleX(100),ScaleY(30));
parent:=DirPanel;
Caption:='Отмена';
onclick:=@NOclick;
end;
BrowseDialogTitle := TLabel.Create(DirPanel);
BrowseDialogTitle.SetBounds(ScaleX(19),ScaleY(5),ScaleX(135),ScaleY(16));
BrowseDialogTitle.Font.Style:=[fsBold];
BrowseDialogTitle.Font.Size:= 10;
BrowseDialogTitle.Transparent := True;
BrowseDialogTitle.Parent := DirPanel;
BrowseDialogTitle.Caption := 'Обзор папок';
BrowseDialogTitle.Font.Name := 'Tahoma';
BrowseDialogTitle.Font.Height := -13;
BrowseDialogTitle1 := TLabel.Create(DirPanel);
BrowseDialogTitle1.SetBounds(ScaleX(30),ScaleY(25),ScaleX(365),ScaleY(13));
BrowseDialogTitle1.Transparent := True;
BrowseDialogTitle1.Parent := DirPanel;
BrowseDialogTitle1.Caption := 'В какую папку Вы хотите установить игру?';
MainPanelBig1 := TPanel.Create(DirPanel);
MainPanelBig1.Parent := DirPanel;
MainPanelBig1.SetBounds(ScaleX(20),ScaleY(69),ScaleX(541),ScaleY(261));
MainPanelBig1.Caption := '';
MainPanelBig2 := TPanel.Create(DirPanel);
MainPanelBig2.Parent := MainPanelBig1;
MainPanelBig2.SetBounds(ScaleX(10),ScaleY(11),ScaleX(520),ScaleY(239));
MainPanelBig2.BevelOuter := bvLowered;
MainPanelBig2.Caption := '';
MainPanelBigBevel := TBevel.Create(DirPanel);
MainPanelBigBevel.Style := bsRaised;
MainPanelBigBevel.Parent := MainPanelBig2;
MainPanelBigBevel.SetBounds(ScaleX(9),ScaleY(10),ScaleX(500),ScaleY(220));
Edit:= TNewEdit.Create(DirPanel);
Edit.SetBounds(ScaleX(20),ScaleY(20),ScaleX(480),ScaleY(21));
Edit.Text:=WizardForm.DirEdit.text;
Edit.Parent:= MainPanelBig2;
Edit.Font.Color:=clBlack;
DirTreeView:= TFolderTreeView.Create(DirPanel);
DirTreeView.SetBounds(ScaleX(20),ScaleY(50),ScaleX(480),ScaleY(170));
DirTreeView.OnChange:=@DirFolderChange;
DirTreeView.Parent:=MainPanelBig2;
DirTreeView.ChangeDirectory(AddBackslash(WizardForm.dirEdit.Text), true);
Edit.Text:=(DirTreeView.Directory);
BrowseDialogLabel := TLabel.Create(DirPanel);
BrowseDialogLabel.SetBounds(ScaleX(30),ScaleY(340),ScaleX(365),ScaleY(13));
BrowseDialogLabel.Transparent := True;
BrowseDialogLabel.Parent := DirPanel;
BrowseDialogLabel.Caption := 'Выберите папку из списка и нажмите «OK».';
end;
|