Вопрос Как сделать кнопку в зависимости от языка?

zettend

Старожил
У меня есть кнопка(hInstall) и две текстуры(rus.Install.png и eng.Install.png)
Использую ботву.

Как сделать отображение разных текстур при разных языках?
 

vint56

Ветеран
Проверенный
Incorrect,
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

[Languages]
Name: "rus"; MessagesFile: "compiler:Default.isl"
Name: "eng"; MessagesFile: "compiler:Languages\English.isl"

[CustomMessages]
rus.Ru=Ru
eng.En=En

[Files]
Source: InstallFiles\*; Flags: dontcopy sortfilesbyextension

[Code ]
#ifdef UNICODE
#define A "W"
type
PChar = PAnsiChar;
#else
#define A "A"
#endif

#include "Modules\botva2.iss"
var
Ru,En: HWND;

function InitializeSetup(): Boolean;
begin
if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
Result := True;
end;

procedure InitializeWizard();
begin
if ActiveLanguage='rus' then
Ru := BtnCreate(WizardForm.Handle, ScaleX(38), ScaleY(320), ScaleX(200), ScaleY(38),ExpandConstant('{tmp}\Button.png'), 0, False);
BtnSetText(Ru, ExpandConstant('{cm:Ru}'));
BtnSetFontColor(Ru, clWhite, clWhite, clWhite, clWhite);
ImgApplyChanges(WizardForm.Handle);
if ActiveLanguage='eng' then
En := BtnCreate(WizardForm.Handle, ScaleX(38), ScaleY(320), ScaleX(200), ScaleY(38),ExpandConstant('{tmp}\Button.png'), 0, False);
BtnSetText(En, ExpandConstant('{cm:En}'));
BtnSetFontColor(En, clWhite, clWhite, clWhite, clWhite);
ImgApplyChanges(WizardForm.Handle);
end;
 
Сверху