Пользователь
Сообщения: 75
Благодарности: 5
|
Профиль
|
Отправить PM
| Цитировать
У меня проблема с кнопками. Кнопка "Назад" отображаеться в неполном размере, и при етом надписи почти невидно. (Пробовал изменять размеры,опять перемещять, но все тоже) (см.рис)
Скрипт на всякий случай
#define NeedSize "5000000000"
#define NeedMem 512
;#define Components
;#define SecondProgressBar
;#define records
#define precomp04
;#define precomp038
;#define unrar
#include "isdone.iss"
[Setup]
AppName=Dragon Age 2
AppVerName=Dragon Age 2
DefaultDirName={pf}\Dragon Age 2
DefaultGroupName=EA Games\Dragon Age 2
OutputBaseFilename=Setup
AppPublisher=BIOWARE
SetupIconFile=.\icon.ico
VersionInfoCopyright=1.0
SolidCompression=yes
WizardSmallImageFile=WizModernSmallImage.bmp
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
Finished1=Программа Dragon Age 2 [RePack] by Duktator22 установлена на Ваш компютер. Нажмите <Завершить>, чтобы выйти из программы установки.
Start1=Вас приветствует Мастер установки Dragon Age 2 [RePack] by Duktator22
start2=Програма установит Dragon Age 2 [RePack] by Duktator22 на ваш компютер. Рекомендуеться закрыть все прочие приложения перед тем как продолжить. Нажмите <Далее>, чтобы продолжить, или <Отмена>, чтобы выйти из программы установки.
[Icons]
Name: "{group}\Запустить игру"; Filename: "{app}\bin_ship\DragonAge2.exe"
Name: "{group}\{cm:UninstallProgram,Dragon Age 2}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Dragon Age 2"; Filename: "{app}\bin_ship\DragonAge2.exe";
Name: "{commondesktop}\Dragon Age 2 настройки"; Filename: "{app}\DragonAge2Launcher.exe";
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Dragon Age 2"; Filename: "{app}\DragonAge2Launcher.exe";
[Tasks]
Name: VCCheck; Description: Установить Microsoft Visual C++
Name: PhysXCheck; Description: Установить Nvidia PhysX
Name: DirectXCheck; Description: Обновить Microsoft DirectX
Name: FXCheck; Description: Обновить Microsoft NET Framework
[Files]
Source: button.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Logo.bmp; Flags: dontcopy
Source: PAPKA.bmp; Flags: dontcopy
Source: IMG1.bmp; Flags: dontcopy
Source: IMG2.bmp; Flags: dontcopy
[Run]
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++ 2005 Redist...; Flags: skipifdoesntexist; Tasks: VCCheck; Check: CheckError
Filename: {src}\Redist\PhysX.exe; Parameters: /qn; StatusMsg: Устанавливаем Nvidia PhysX...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError
Filename: {src}\Redist\DirectX\DXSETUP.exe; Parameters: /silent; StatusMsg: Устанавливаем Microsoft DirectX...; Flags: skipifdoesntexist; Tasks: DirectXCheck; Check: CheckError
Filename: {src}\Redist\dotNetFx35setup.exe; Parameters: /qn; StatusMsg: Устанавливаем Microsoft NET...; Flags: skipifdoesntexist; Tasks: PhysXCheck; Check: CheckError
Filename: {src}\setup-2.exe; WorkingDir: {src}; Parameters: "-o""{app}"" -y -aoa"; StatusMsg: Распаковка игровых архивов...; Flags: waituntilterminated;
Filename: {src}\setup-3.exe; WorkingDir: {src}; Parameters: "-o""{app}"" -y -aoa"; StatusMsg: Распаковка игровых архивов...; Flags: waituntilterminated;
[code]
const
Color = clblack;
ButtonWidth = 80; //Указываем размер кнопок
ButtonHeight = 23;
bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;
var
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;
PageNameLabel, PageDescriptionLabel: TLabel;
MainImage : TBitmapImage;
FinishedImage: TBitmapImage;
WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel: TLabel; //Надписи на на странице приветствия и на финишной странице
procedure ButtonLabelClick(Sender: TObject);
var
Button: TButton;
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
case TLabel(Sender).Tag of
bidBack: Button:=WizardForm.BackButton
bidNext: Button:=WizardForm.NextButton
bidCancel: Button:=WizardForm.CancelButton
bidDirBrowse: Button:=WizardForm.DirBrowseButton
bidGroupBrowse: Button:=WizardForm.GroupBrowseButton
else
Exit
end
Button.OnClick(Button)
end;
procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then
ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth
end;
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
end;
procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
Image: TBitmapImage;
Panel: TPanel;
Labl: TLabel;
begin
Panel:=TPanel.Create(WizardForm)
Panel.Left:=AButton.Left
Panel.Top:=AButton.Top
Panel.Width:=AButton.Width
Panel.Height:=AButton.Height
Panel.Tag:=AButtonIndex
Panel.Parent:=AButton.Parent
ButtonPanel[AButtonIndex]:=Panel
Image:=TBitmapImage.Create(WizardForm) //Рисунок который ложится на кнопку
Image.Width:=497 //Обязательно прописать оригинальный размер рисунка
Image.Height:=23
Image.Enabled:=False
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
Image.Parent:=Panel
ButtonImage[AButtonIndex]:=Image
with TLabel.Create(WizardForm) do begin
Tag:=AButtonIndex
Parent:=Panel
Width:=Panel.Width
Height:=Panel.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end
Labl:=TLabel.Create(WizardForm) //Текст кнопок
Labl.Left:=23 //Указываем положение текста
Labl.Top:=5
Labl.Autosize:=True
Labl.Alignment:=taCenter
Labl.Tag:=AButtonIndex
Labl.Transparent:=True
Labl.Font.Color:=clWhite //Цвет текста
Labl.Caption:=AButton.Caption
Labl.OnClick:=@ButtonLabelClick
Labl.OnDblClick:=@ButtonLabelClick
Labl.OnMouseDown:=@ButtonLabelMouseDown
Labl.OnMouseUp:=@ButtonLabelMouseUp
Labl.Parent:=Panel
ButtonLabel[AButtonIndex]:=Labl
end;
procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonLabel[AButtonIndex].Caption:=AButton.Caption
ButtonPanel[AButtonIndex].Visible:=AButton.Visible
ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled
end;
procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
ButtonLabel[bidNext].Enabled:=True
end;
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
ButtonLabel[bidNext].Enabled:=False
end;
procedure InitializeWizard();
var
BtnPanel: TPanel;
Logo: TBitmapImage;
begin
ExtractTemporaryFile('Logo.bmp')
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=0
Top:=415
Width:=497
Height:=35
Parent:=WizardForm
end
Logo:=TBitmapImage.Create(WizardForm)
with Logo do begin
AutoSize:=True;
Enabled:=False;
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Logo.bmp')
Parent:=BtnPanel
end
WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);
PageNameLabel:= TLabel.Create(WizardForm)
with WizardForm.PageNameLabel do
PageNameLabel.SetBounds(Left, Top, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clWhite; //цвет надписи
PageNameLabel.Parent:= WizardForm.MainPanel;
PageDescriptionLabel:= TLabel.Create(WizardForm)
with WizardForm.PageDescriptionLabel do
PageDescriptionLabel.SetBounds(Left, Top, Width, Height);
PageDescriptionLabel.Transparent:= True;
PageDescriptionLabel.Font:= WizardForm.PageDescriptionLabel.Font;
PageDescriptionLabel.Font.Color:= clWhite; //цвет надписи
PageDescriptionLabel.Parent:= WizardForm.MainPanel;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
// Папка
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=True;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=True;
//Инсталл черный
WizardForm.Font.Color:=clWhite;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.GroupEdit.Color:=Color;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.WelcomeLabel1.Font.Color:=clWhite;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageNameLabel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.FinishedLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=clwhite;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Color:=Color;
WizardForm.FinishedHeadingLabel.Font.Color:=cllime;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
WizardForm.PageNameLabel.Font.Color:=clWhite;
WizardForm.ReadyMemo.ScrollBars:= ssNone
WizardForm.Bevel.visible:=False;
WizardForm.BeveledLabel.visible:=False;
WizardForm.Bevel1.visible:=False;
WizardForm.NextButton.Left:=450;
WizardForm.NextButton.Top:=400;
WizardForm.NextButton.Width:=80;
WizardForm.NextButton.Height:=30;
WizardForm.CancelButton.Left:=540;
WizardForm.CancelButton.Top:=400;
WizardForm.CancelButton.Width:=80;
WizardForm.CancelButton.Height:=30;
WizardForm.BackButton.Left:=360
WizardForm.BackButton.Top:=400
WizardForm.BackButton.Width:=80
WizardForm.BackButton.Height:=300
//WizardForm.NextButton.Width:=ButtonWidth
//WizardForm.NextButton.Width:=ButtonWidth
WizardForm.NextButton.Width:=ButtonWidth
WizardForm.NextButton.Height:=ButtonHeight
WizardForm.CancelButton.Width:=ButtonWidth
WizardForm.CancelButton.Height:=ButtonHeight
WizardForm.BackButton.Width:=ButtonHeight
WizardForm.BackButton.Height:=ButtonHeight
WizardForm.DirBrowseButton.Left:=337
WizardForm.DirBrowseButton.Width:=ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight
WizardForm.GroupBrowseButton.Left:=337
WizardForm.GroupBrowseButton.Width:=ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight
WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick
WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick
ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.NextButton,bidNext)
LoadButtonImage(WizardForm.CancelButton,bidCancel)
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
LoadButtonImage(WizardForm.BackButton,bidBack)
with WizardForm do //Размер установщика
begin
AutoScroll := False;
ClientHeight := ScaleY(453);
ClientWidth := ScaleX(639);
end;
begin
ExtractTemporaryFile('img1.bmp');
MainImage := TBitmapImage.Create(WizardForm);
with MainImage do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Width := 453;
Height := 639;
Width:= ScaleX(639);
Bitmap.LoadFromFile(ExpandConstant('{tmp}\img1.bmp'));
end;
ExtractTemporaryFile('img2.bmp');
FinishedImage := TBitmapImage.Create(WizardForm);
with FinishedImage do
begin
Parent := WizardForm;
Left := 0;
Top := 0;
Width := 453;
Height := 639;
Width:= ScaleX(639);
Bitmap.LoadFromFile(ExpandConstant('{tmp}\img2.bmp'));
end;
//WelcomePage, создаем надписи на странице
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
Left:= ScaleX(175);
Top:= ScaleY(15);
Width:= ScaleX(312);
Height:= ScaleY(57);
AutoSize:= false;
Font.Style := [fsBold]
Transparent:= true;
WordWrap:= true;
Font.Size:= 13;
Font.Color:=ClWhite
Parent:= WizardForm;
Caption:=ExpandConstant('{cm:Start1}')
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Top:= ScaleY(90);
Left:= ScaleX(175);
Width:= ScaleX(295);
Height:= ScaleY(312);
AutoSize:= false;
WordWrap:= true;
Font.Color:=ClWhite
Font.Size:= 8;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Start2}')
end;
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Top:= ScaleY(15);
Left:= ScaleX(175);
Width:= ScaleX(312);
Height:= ScaleY(57);
AutoSize:= false;
WordWrap:= true;
Font.Size:= 13;
Font.Style := [fsBold]
Font.Color:=ClWhite
Transparent:= true;
Parent:= WizardForm;
Caption:= WizardForm.FinishedHeadingLabel.Caption;
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Left:= ScaleX(175);
Top:= ScaleY(90);
Width:= ScaleX(295);
Height:= ScaleY(312);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Font.Color:=ClWhite
Font.Size:= 8;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Finished1}')
end;
end;
end;
procedure HideComponents1;
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
end;
procedure ShowComponents1(CurPageID: Integer);
begin
case CurPageID of
wpWelcome:
begin
WelcomeLabel1.Show
WelcomeLabel2.Show
end;
wpFinished:
begin
FinishedHeadingLabel.Show;
FinishedLabel.Show;
end;
end;
end;
procedure CurPageChanged1(CurPageID: Integer);
begin
begin
HideComponents1;
ShowComponents1(CurPageID);
if CurPageID = wpWelcome then
begin
WizardForm.OuterNotebook.Hide;
FinishedImage.Hide;
end
else if CurPageID = wpFinished then
begin
WizardForm.OuterNotebook.Hide;
MainImage.Hide;
FinishedImage.Show;
end
else WizardForm.OuterNotebook.Show;
end;
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
UpdateButton(WizardForm.BackButton,bidBack)
UpdateButton(WizardForm.NextButton,bidNext)
UpdateButton(WizardForm.CancelButton,bidCancel)
ButtonLabel[bidBack].Left := (ButtonPanel[bidBack].Width / 30 - ButtonLabel[bidBack].Width / 30);
ButtonLabel[bidNext].Left := (ButtonPanel[bidNext].Width / 2 - ButtonLabel[bidNext].Width / 2);
ButtonLabel[bidCancel].Left := (ButtonPanel[bidCancel].Width / 2 - ButtonLabel[bidCancel].Width / 2);
ButtonLabel[bidDirBrowse].Left := (ButtonPanel[bidDirBrowse].Width / 2 - ButtonLabel[bidDirBrowse].Width / 2);
ButtonLabel[bidGroupBrowse].Left := (ButtonPanel[bidGroupBrowse].Width / 2 - ButtonLabel[bidGroupBrowse].Width / 2);
end;
|
Отправлено: 19:56, 08-04-2011
| #1282
|