Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Новый участник


Сообщения: 8
Благодарности: 0

Профиль | Отправить PM | Цитировать


Цитата diman_21Ru:
TAY50N,какие строчки ты именно добавил чтобы наводя на мод выходила картинка с боку ? »
читать дальше »
[code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
UNDEF_INDEX = -777;
ALPHA_BLEND_LEVEL = 255; // 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);
InfoPic.SetBounds(ScaleX(247), ScaleY(65), ScaleX(232), ScaleY(237));
InfoPic.Show;
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
'Удаляем видео заставку': UndefPic := '1.bmp';
'Часы в Ангаре': UndefPic := '2.bmp';
'от zayaz': UndefPic := '3.bmp';
'от ZCH_0933': UndefPic := '4.bmp';
else
begin
LastIndex := UNDEF_INDEX;
InfoPic.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
InfoPic.Hide;
LastIndex := -1;
end;


procedure InitInfo();
begin
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(63), ScaleX(240), ScaleY(240));
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;

with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(245), ScaleY(63), ScaleX(235), ScaleY(240));
Shape := bsFrame;
end;

InfoPic := TBitmapImage.Create(WizardForm)
with InfoPic do
begin
Parent := WizardForm.SelectComponentsPage;
AutoSize := True;
end;
end;

Отправлено: 14:59, 27-01-2014 | #1988