[setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}
ShowLanguageDialog=auto
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
Name: eng; MessagesFile: compiler:Default.isl
[CustomMessages]
; Русский
rusButtonBack=< &Назад
rusButtonNext=&Далее >
rusButtonCancel=Отмена
rusSetupWindowTitle=Установка — %1
rusWelcomeLabel1=Вас приветствует Мастер установки %1
rusWelcomeLabel2=Программа установит %1, версия %2 на Ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
; English
engButtonBack=< &Back
engButtonNext=&Next >
engButtonCancel=Cancel
engSetupWindowTitle=Setup — %1
engWelcomeLabel1=Welcome to the %1 Setup Wizard
engWelcomeLabel2=This will install %1 version %2 on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup.
[Code]
var
lang: String;
langBtn: TButton;
procedure ChangeLang();
begin
WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack');
WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext');
WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel');
WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']);
end;
procedure LangBtnClick(Sender: TObject);
begin
if lang='rus' then begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end else begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end;
ChangeLang();
end;
procedure InitializeWizard;
begin
langBtn:= TButton.Create(WizardForm);
with langBtn do begin
SetBounds(10,WizardForm.CancelButton.Top,30,WizardForm.CancelButton.Height)
OnClick:= @LangBtnClick;
Parent:= WizardForm;
end;
if ActiveLanguage='rus' then begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end else begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end;
end;
Спасибо, обязательно попробую. Прошу пока не закрывать тему.Код:[setup] AppName=My Application AppVersion=1.5 DefaultDirName={pf} ShowLanguageDialog=auto [Languages] Name: rus; MessagesFile: compiler:Languages\Russian.isl Name: eng; MessagesFile: compiler:Default.isl [CustomMessages] ; Русский rusButtonBack=< &Назад rusButtonNext=&Далее > rusButtonCancel=Отмена rusSetupWindowTitle=Установка — %1 rusWelcomeLabel1=Вас приветствует Мастер установки %1 rusWelcomeLabel2=Программа установит %1, версия %2 на Ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки. ; English engButtonBack=< &Back engButtonNext=&Next > engButtonCancel=Cancel engSetupWindowTitle=Setup — %1 engWelcomeLabel1=Welcome to the %1 Setup Wizard engWelcomeLabel2=This will install %1 version %2 on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup. [Code] var lang: String; langBtn: TButton; procedure ChangeLang(); begin WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack'); WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext'); WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel'); WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']); WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']); WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']); end; procedure LangBtnClick(Sender: TObject); begin if lang='rus' then begin lang:= 'eng'; langBtn.Caption:= 'рус'; end else begin lang:= 'rus'; langBtn.Caption:= 'eng'; end; ChangeLang(); end; procedure InitializeWizard; begin langBtn:= TButton.Create(WizardForm); with langBtn do begin SetBounds(10,WizardForm.CancelButton.Top,30,WizardForm.CancelButton.Height) OnClick:= @LangBtnClick; Parent:= WizardForm; end; if ActiveLanguage='rus' then begin lang:= 'rus'; langBtn.Caption:= 'eng'; end else begin lang:= 'eng'; langBtn.Caption:= 'рус'; end; end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
Parent:=WizardForm;
AutoSize:=False;
Transparent:=True;
SetBounds(ScaleX(15), ScaleY(15), ScaleX(535), ScaleY(50));
Font.Size:= 10;
WordWrap:=True;
Caption:=ExpandConstant('{cm:Welcome1}');
OnMouseDown:=@FrameMouseDown;
end;
[setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}
ShowLanguageDialog=auto
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
Name: eng; MessagesFile: compiler:Default.isl
[CustomMessages]
; Русский
rusButtonBack=< &Назад
rusButtonNext=&Далее >
rusButtonCancel=Отмена
rusSetupWindowTitle=Установка — %1
rusWelcomeLabel1=Вас приветствует Мастер установки %1
rusWelcomeLabel2=Программа установит %1, версия %2 на Ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
; English
engButtonBack=< &Back
engButtonNext=&Next >
engButtonCancel=Cancel
engSetupWindowTitle=Setup — %1
engWelcomeLabel1=Welcome to the %1 Setup Wizard
engWelcomeLabel2=This will install %1 version %2 on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup.
[Code]
var
lang: String;
langBtn: TButton;
WelcomeLabel1:TLAbel;
procedure ChangeLang();
begin
WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack');
WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext');
WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel');
WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']);
WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
end;
procedure LangBtnClick(Sender: TObject);
begin
if lang='rus' then begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end else begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end;
ChangeLang();
end;
procedure InitializeWizard;
begin
langBtn:= TButton.Create(WizardForm);
with langBtn do begin
SetBounds(10,WizardForm.CancelButton.Top,30,WizardForm.CancelButton.Height)
OnClick:= @LangBtnClick;
Parent:= WizardForm;
end;
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
Parent:=WizardForm;
AutoSize:=False;
Transparent:=True;
SetBounds(ScaleX(45), ScaleY(330), ScaleX(535), ScaleY(50));
Font.Size:= 10;
WordWrap:=True;
Caption:= FmtMessage(CustomMessage(lang+'rusWelcomeLabel1'), ['{#SetupSetting('AppName')}']);
// OnMouseDown:=@FrameMouseDown;
end;
if ActiveLanguage='rus' then begin
lang:= 'rus';
langBtn.Caption:= 'eng';
end else begin
lang:= 'eng';
langBtn.Caption:= 'рус';
end;
end;
А можно такой же пример, но с кнопка смены языка текстурирована через botva2?Tjeyn,
Код:[setup] AppName=My Application AppVersion=1.5 DefaultDirName={pf} ShowLanguageDialog=auto [Languages] Name: rus; MessagesFile: compiler:Languages\Russian.isl Name: eng; MessagesFile: compiler:Default.isl [CustomMessages] ; Русский rusButtonBack=< &Назад rusButtonNext=&Далее > rusButtonCancel=Отмена rusSetupWindowTitle=Установка — %1 rusWelcomeLabel1=Вас приветствует Мастер установки %1 rusWelcomeLabel2=Программа установит %1, версия %2 на Ваш компьютер.%n%nРекомендуется закрыть все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки. ; English engButtonBack=< &Back engButtonNext=&Next > engButtonCancel=Cancel engSetupWindowTitle=Setup — %1 engWelcomeLabel1=Welcome to the %1 Setup Wizard engWelcomeLabel2=This will install %1 version %2 on your computer.%n%nIt is recommended that you close all other applications before continuing.%n%nClick Next to continue, or Cancel to exit Setup. [Code] var lang: String; langBtn: TButton; WelcomeLabel1:TLAbel; procedure ChangeLang(); begin WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack'); WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext'); WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel'); WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']); WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']); WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']); WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']); end; procedure LangBtnClick(Sender: TObject); begin if lang='rus' then begin lang:= 'eng'; langBtn.Caption:= 'рус'; end else begin lang:= 'rus'; langBtn.Caption:= 'eng'; end; ChangeLang(); end; procedure InitializeWizard; begin langBtn:= TButton.Create(WizardForm); with langBtn do begin SetBounds(10,WizardForm.CancelButton.Top,30,WizardForm.CancelButton.Height) OnClick:= @LangBtnClick; Parent:= WizardForm; end; WelcomeLabel1:= TLabel.Create(WizardForm); with WelcomeLabel1 do begin Parent:=WizardForm; AutoSize:=False; Transparent:=True; SetBounds(ScaleX(45), ScaleY(330), ScaleX(535), ScaleY(50)); Font.Size:= 10; WordWrap:=True; Caption:= FmtMessage(CustomMessage(lang+'rusWelcomeLabel1'), ['{#SetupSetting('AppName')}']); // OnMouseDown:=@FrameMouseDown; end; if ActiveLanguage='rus' then begin lang:= 'rus'; langBtn.Caption:= 'eng'; end else begin lang:= 'eng'; langBtn.Caption:= 'рус'; end; end;
ListBox.ItemCaption[0]:= ' ';
Кнопку то я могу создать и затекстурировать, но клик на смену caption'ов никак к ней не могу прикрепить!про кнопочку, ботва (там справочка, сам модуль).
Попробуем...про 2-ое:
0,1,2,3... нумерация строк с нуля.Код:ListBox.ItemCaption[0]:= ' ';
var
lang: String;
langBtn:HWND;
WelcomeLabel1:TLAbel;
procedure ChangeLang();
begin
WizardForm.BackButton.Caption:= CustomMessage(lang+'ButtonBack');
WizardForm.NextButton.Caption:= CustomMessage(lang+'ButtonNext');
WizardForm.CancelButton.Caption:= CustomMessage(lang+'ButtonCancel');
WizardForm.Caption:= FmtMessage(CustomMessage(lang+'SetupWindowTitle'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
WizardForm.WelcomeLabel2.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel2'), ['{#SetupSetting('AppName')}', '{#SetupSetting('AppVersion')}']);
WelcomeLabel1.Caption:= FmtMessage(CustomMessage(lang+'WelcomeLabel1'), ['{#SetupSetting('AppName')}']);
end;
procedure LangBtnClick(hBtn:HWND);
begin
if lang='rus' then begin
lang:= 'eng';
BtnSetText(langBtn,'рус');
end else begin
lang:= 'rus';
BtnSetText(langBtn,'eng');
end;
ChangeLang();
end;
ну я так не играю
WizardForm.TypesCombo.Visible:=False;
WizardForm.ComponentsList.Height := ScaleY(181) - WizardForm.TypesCombo.Top;
WizardForm.ComponentsList.Top := WizardForm.TypesCombo.Top;
WizardForm.ComponentsList.Width := ScaleX(417);
WizardForm.ComponentsList.ItemCaption[0]:=FmtMessage(CustomMessage(lang+'rusGameText'), ['{#SetupSetting('AppName')}']);
WizardForm.ComponentsList.ItemCaption[0]:=FmtMessage(CustomMessage(lang+'rusGameText'), ['{#SetupSetting('AppName')}']);
procedure ChangeLang();
begin
BtnSetText(hCancelBtn, CustomMessage(lang+'ButtonCancel'));
BtnSetText(hNextBtn, CustomMessage(lang+'ButtonNext'));
BtnSetText(hBackBtn, CustomMessage(lang+'ButtonBack'));
function NumToStr(Float: Extended): String;
begin
Result:= format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0')or(Result[Length(Result)] = '.'))and(Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
end;
function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' Мб' else ///////////// это
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' Гб' else ///////////// это
Result:= NumToStr(Float/(1024*1024))+' Тб'; ///////////// и это
end;
procedure ObjectFunc(Sender: TObject);
var
Drive: String;
begin
case Sender of
WizardForm.DirEdit: begin
Drive:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Drive, True, FreeMB, TotalMB);
InstallSpacelabel.Caption:=ExpandConstant('{cm:InstallSpace} ') +MbOrTb({#NeedInstallSize});
NeedSpaceLabel.Caption:=ExpandConstant('{cm:NeedSpace} ') +MbOrTb({#NeedSize});
WizardForm.NextButton.Enabled:=(FreeMB>{#NeedInstallSize})and(FreeMB>{#NeedSize});
if WizardForm.NextButton.Enabled then NeedSpaceLabel.Font.Color:=$FFFFFF else NeedSpaceLabel.Font.Color:=$0000FF;
end;
end;
end;
[CODE][SPOILER/]