Ветеран
Сообщения: 649
Благодарности: 444
Профиль
|
Отправить PM
| Цитировать
CkauNui ,
Цитата CkauNui :
возможностью добавления картинок к пунктам »
так сойдёт: ?
читать дальше »
Код:
[Setup]
AppName =My Program
AppVerName =My Program v.1.2
DefaultDirName ={pf} \My Program
Compression =none
AppId =TheBestAppId
DisableWelcomePage =yes
DisableFinishedPage =yes
DisableDirPage =yes
DisableReadyPage =yes
[Components]
Name : hl2; Description : Half-Life 2; Flags : disablenouninstallwarning
Name : hl2\ru; Description : Russian; Flags : disablenouninstallwarning exclusive
Name : hl2\en; Description : English; Flags : disablenouninstallwarning exclusive
Name : ep1; Description : Half-Life 2 Episode One; Flags : disablenouninstallwarning
Name : ep1\ru; Description : Russian; Flags : disablenouninstallwarning exclusive
Name : ep1\en; Description : English; Flags : disablenouninstallwarning exclusive
Name : ep2; Description : Half-Life 2 Episode Two; Flags : disablenouninstallwarning
Name : ep2\ru; Description : Russian; Flags : disablenouninstallwarning exclusive
Name : ep2\en; Description : English; Flags : disablenouninstallwarning exclusive
Name : portal; Description : Portal; Flags : disablenouninstallwarning
Name : portal\ru; Description : Russian; Flags : disablenouninstallwarning exclusive
Name : portal\en; Description : English; Flags : disablenouninstallwarning exclusive
[Files]
Source : Wasteland_Scanner_con.bmp; Flags : dontcopy nocompression
Source : Strider_early2.bmp; Flags : dontcopy nocompression
Source : Cremator_poster.bmp; Flags : dontcopy nocompression
Source : Portal.bmp; Flags : dontcopy nocompression
[code ]
#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 = $20;
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(pt.x + 16), ScaleY(pt.y + 7), InfoPic.Width, InfoPic.Height);
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 := 'Wasteland_Scanner_con.bmp';
'Half-Life 2 Episode One': UndefPic := 'Strider_early2.bmp';
'Half-Life 2 Episode Two': UndefPic := 'Cremator_poster.bmp';
'Portal': UndefPic := 'Portal.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;
LastIndex := -1;
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 ;
SetWindowLong(PicForm.Handle, GWL_EXSTYLE, GetWindowLong(PicForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED);
SetLayeredWindowAttributes(PicForm.Handle, 0, ALPHA_BLEND_LEVEL, LWA_ALPHA);
end ;
procedure InitializeWizard ();
begin
InitInfo();
end ;
скрин:
наглядный пример:
http://sendfile.su/905839
Цитата CkauNui :
и как сделать чтобы не выскакивало окошко о уже установленных компонентах ? »
секция компонентов, флаг disablenouninstallwarning. Пример выше ^
Цитата CkauNui :
и возможно ли поменять цвет у fixed элементов ? »
Редактируй скин
Цитата CkauNui :
или они устанавливаются так, как я прописал в [Files] ? »
да, и никак иначе. Меняй порядок, если надо
UPD: Немного улучшил код "картинки-подсказки". Демо перезалито!
Последний раз редактировалось Johny777, 05-12-2013 в 23:26 .
Это сообщение посчитали полезным следующие участники:
Отправлено : 19:44, 17-06-2013
| #662