[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа
[Languages]
Name: "RU"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
RU.CompSubtitlesLng=Язык субтитров
RU.CompVoiceLng=Язык озвучки
RU.CompRussian=Русский
RU.CompEnglish=Английский
[Code]
var
ComponentsPage: TWizardPage;
SelectComponentsLabel: TNewStaticText;
ComponentsList: TNewCheckListBox;
procedure RedesignWizardForm;
begin
ComponentsPage := CreateCustomPage(wpWelcome, SetupMessage(msgWizardSelectComponents), SetupMessage(msgSelectComponentsDesc));
{ SelectComponentsLabel }
SelectComponentsLabel := TNewStaticText.Create(WizardForm);
with SelectComponentsLabel do
begin
Parent := ComponentsPage.Surface;
SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(42));
AutoSize := False;
WordWrap := True;
Caption := SetupMessage(msgSelectComponentsLabel2);
end;
{ ComponentsList }
ComponentsList := TNewCheckListBox.Create(WizardForm);
with ComponentsList do
begin
Parent := ComponentsPage.Surface;
SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169));
AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, False, False, True, nil);
AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);
AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);
AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, False, False, True, nil);
AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);
AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);
end;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
end;
[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа
[Languages]
Name: "RU"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
RU.CompSubtitlesLng=Язык субтитров
RU.CompVoiceLng=Язык озвучки
RU.CompRussian=Русский
RU.CompEnglish=Английский
[Files]
Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "TextRussian.isl"; Check: IsComponent(1)
Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "TextEnglish.isl"; Check: IsComponent(2)
Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "VoiceRussian.isl"; Check: IsComponent(4)
Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "VoiceEnglish.isl"; Check: IsComponent(5)
[Code]
var
ComponentsPage: TWizardPage;
SelectComponentsLabel: TNewStaticText;
ComponentsList: TNewCheckListBox;
procedure RedesignWizardForm;
begin
ComponentsPage := CreateCustomPage(wpWelcome, SetupMessage(msgWizardSelectComponents), SetupMessage(msgSelectComponentsDesc));
{ SelectComponentsLabel }
SelectComponentsLabel := TNewStaticText.Create(WizardForm);
with SelectComponentsLabel do
begin
Parent := ComponentsPage.Surface;
SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(42));
AutoSize := False;
WordWrap := True;
Caption := SetupMessage(msgSelectComponentsLabel2);
end;
{ ComponentsList }
ComponentsList := TNewCheckListBox.Create(WizardForm);
with ComponentsList do
begin
Parent := ComponentsPage.Surface;
SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169));
AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, False, False, True, nil);
AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);
AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);
AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, False, False, True, nil);
AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil);
AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil);
end;
end;
function IsComponent(CompIndex: Integer): Boolean;
var
i: Integer;
begin
Result := False;
for i := 0 to ComponentsList.ItemCount - 1 do
begin
if CompIndex <= (ComponentsList.ItemCount - 1) then
Result := ComponentsList.Checked[CompIndex];
end;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
end;
Конечно можноа можно к Вашему примеру ещё добавить отображение картинок-описания из FAQ?
но ничего не выходитКонечно можно
1. Отсутствие файлов локализации.Привет. Смотрите, в игре смена языка в меню (субтитры), а так же есть строчка в реестре, где можно изменить язык. По дефолту в реестре прописано eng, но если к примеру поменять на fra или deu то в меню игры вместо букв написан бред. Если ставить обратно на eng - все нормально. В чем может быть проблема?
А можно ли к этому примеру добавить прозрачность для компонент листа через bmp картинку?Хамик, ну самый простой вариант проверка по индексу. Нумерация начинается с нуля
Код:[Setup] AppName=Моя программа AppVersion=1.5 DefaultDirName={pf}\Моя программа [Languages] Name: "RU"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] RU.CompSubtitlesLng=Язык субтитров RU.CompVoiceLng=Язык озвучки RU.CompRussian=Русский RU.CompEnglish=Английский [Files] Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "TextRussian.isl"; Check: IsComponent(1) Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "TextEnglish.isl"; Check: IsComponent(2) Source: "compiler:Languages\Russian.isl"; DestDir: "{app}"; DestName: "VoiceRussian.isl"; Check: IsComponent(4) Source: "compiler:Default.isl"; DestDir: "{app}"; DestName: "VoiceEnglish.isl"; Check: IsComponent(5) [Code] var ComponentsPage: TWizardPage; SelectComponentsLabel: TNewStaticText; ComponentsList: TNewCheckListBox; procedure RedesignWizardForm; begin ComponentsPage := CreateCustomPage(wpWelcome, SetupMessage(msgWizardSelectComponents), SetupMessage(msgSelectComponentsDesc)); { SelectComponentsLabel } SelectComponentsLabel := TNewStaticText.Create(WizardForm); with SelectComponentsLabel do begin Parent := ComponentsPage.Surface; SetBounds(ScaleX(0), ScaleY(0), ScaleX(417), ScaleY(42)); AutoSize := False; WordWrap := True; Caption := SetupMessage(msgSelectComponentsLabel2); end; { ComponentsList } ComponentsList := TNewCheckListBox.Create(WizardForm); with ComponentsList do begin Parent := ComponentsPage.Surface; SetBounds(ScaleX(0), ScaleY(61), ScaleX(417), ScaleY(169)); AddCheckBox(CustomMessage('CompSubtitlesLng'), '', 0, True, False, False, True, nil); AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil); AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil); AddCheckBox(CustomMessage('CompVoiceLng'), '', 0, True, False, False, True, nil); AddRadioButton(CustomMessage('CompRussian'), '', 1, True, True, nil); AddRadioButton(CustomMessage('CompEnglish'), '', 1, False, True, nil); end; end; function IsComponent(CompIndex: Integer): Boolean; var i: Integer; begin Result := False; for i := 0 to ComponentsList.ItemCount - 1 do begin if CompIndex <= (ComponentsList.ItemCount - 1) then Result := ComponentsList.Checked[CompIndex]; end; end; procedure InitializeWizard(); begin RedesignWizardForm; end;
Прозрачность???не смеши. мне влом. готового примера под рукой нету. (LoadBGBmpFromBitmap).
А можно ли к этому примеру добавить прозрачность для компонент листа через bmp картинку?
const
WM_MOUSEWHEEL = $020A;
WM_HSCROLL = $0114;
WM_VSCROLL = $0115;
SB_LINEUP = 0;
SB_LINELEFT = 0;
SB_LINEDOWN = 1;
SB_LINERIGHT = 1;
SB_PAGEUP = 2;
SB_PAGELEFT = 2;
SB_PAGEDOWN = 3;
SB_PAGERIGHT = 3;
SB_THUMBPOSITION = 4;
SB_THUMBTRACK = 5;
SB_TOP = 6;
SB_LEFT = 6;
SB_BOTTOM = 7;
SB_RIGHT = 7;
SB_ENDSCROLL = 8;
GWL_WNDPROC = -4;
type
TCallbackProc = function(h:hWnd;Msg,wParam,lParam:Longint):Longint;
#define A defined(UNICODE) ? "W" : "A"
function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function WndProcCallBack(P:TCallbackProc;ParamCount:integer):LongWord; external 'wrapcallback@files:innocallback.dll stdcall';
function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProc{#A}@user32.dll stdcall';
var
ComponentsListFon,TasksListFon: Longint;
function ComponentsListFons(h: HWND; Msg, wParam, lParam: longint): Longint;
begin
if Msg=WM_MOUSEWHEEL then begin
if wParam > 0 then
SendMessage(h, WM_VSCROLL, SB_LINEUP, 0);
if (wParam < 0) then
SendMessage(h, WM_VSCROLL, SB_LINEDOWN, 0);
Result:= 0;
end else
Result:= CallWindowProc(ComponentsListFon, h, Msg, wParam, lParam);
end;
function TasksListFons(h: HWND; Msg, wParam, lParam: longint): Longint;
begin
if Msg=WM_MOUSEWHEEL then begin
if wParam > 0 then
SendMessage(h, WM_VSCROLL, SB_LINEUP, 0);
if (wParam < 0) then
SendMessage(h, WM_VSCROLL, SB_LINEDOWN, 0);
Result:= 0;
end else
Result:= CallWindowProc(TasksListFon, h, Msg, wParam, lParam);
end;
procedure FonComponentsTasksList; //InitializeWizard
begin
ComponentsListFon:= SetWindowLong(WizardForm.ComponentsList.Handle, GWL_WNDPROC, WndProcCallBack(@ComponentsListFons, 4));
ExtractTemporaryFile('подложка для компонентов.bmp');
WizardForm.ComponentsList.LoadBGBmpFromFile(ExpandConstant('{tmp}\подложка для компонентов.bmp'), 0, 0);
//===============================================================================================================\\
TasksListFon:= SetWindowLong(WizardForm.TasksList.Handle, GWL_WNDPROC, WndProcCallBack(@TasksListFons, 4));
ExtractTemporaryFile('подложка для таска.bmp');
WizardForm.TasksList.LoadBGBmpFromFile(ExpandConstant('{tmp}\подложка для таска.bmp'), 0, 0);
end;
procedure FonComponentsTasksListDeinitialize; //DeinitializeSetup
begin
SetWindowlong(WizardForm.ComponentsList.Handle, GWL_WNDPROC, ComponentsListFon);
SetWindowlong(WizardForm.TasksList.Handle, GWL_WNDPROC, TasksListFon);
end;
[/SPOILER]
У меня пример то есть но никак не могу реализовать это, там случайно botva2 не нужна?готового примера под рукой нету. (LoadBGBmpFromBitmap).
Хамик,через bmp никак.
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
UNDEF_INDEX = -777;
ALPHA_BLEND_LEVEL = 128; // max=Byte=255
WS_EX_LAYERED = $80000;
WS_EX_TRANSPARENT = $100;
LWA_COLORKEY = 1;
LWA_ALPHA = 2;
GWL_EXSTYLE = (20);
var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
PicForm: TForm;
type
COLORREF = DWORD;
function GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLong{#A}@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLong{#A}@user32.dll stdcall';
function SetFocus(hWnd: HWND): HWND; external 'SetFocus@user32.dll stdcall';
procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
try
with PicForm do
begin
SetBounds(ScaleX(0), ScaleY(0), InfoPic.Width, InfoPic.Height);
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
Show;
end;
finally
SetFocus(WizardForm.Handle);
end;
end;
procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
UndefPic: String;
begin
if Index = -1 then Exit;
if Index = LastIndex then Exit;
try
case TNewCheckListBox(Sender).ItemCaption[Index] of
'Half-Life 2': UndefPic := '23.bmp';
'Half-Life 2 Episode One': UndefPic := 'Background.bmp';
'Half-Life 2 Episode Two': UndefPic := 'Background2.bmp';
'Portal': UndefPic := '24.bmp';
else
begin
LastIndex := UNDEF_INDEX;
PicForm.Hide;
Exit;
end;
end;
if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
ShowPicHint(TempPath + UndefPic);
finally
LastIndex := Index;
end;
end;
procedure CompOnMouseLeave(Sender: TObject);
begin
PicForm.Hide;
end;
procedure InitInfo();
begin
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
PicForm := TForm.Create(WizardForm)
with PicForm do
begin
BorderStyle := bsNone;
FormStyle := fsStayOnTop;
InfoPic := TBitmapImage.Create(PicForm)
with InfoPic do
begin
Parent := PicForm;
AutoSize := True;
end;
end;
end;
procedure InitializeWizard();
begin
InitInfo();
end;