var
CustomPage: TWizardPage;
CustomListBox: TNewCheckListBox;
Procedure CreateNewPage(PreviousPageId: Integer);
begin
CustomPage := CreateCustomPage(PreviousPageId, '<<блабла>>');
CustomListBox := TNewCheckListBox.Create(CustomPage);
CustomListBox.Parent := CustomPage.Surface;
CustomListBox.Left:=ScaleX(0);
CustomListBox.Top:=ScaleY(50);
CustomListBox.Width:=CustomPage.SurfaceWidth;
CustomListBox.Height:=ScaleY(144);
CustomListBox.Cursor:=crHand;
CustomListBox.BorderStyle:=bsSingle;
CustomListBox.Color:=clblack;
CustomListBox.DragCursor:=crHand;
CustomListBox.DragMode:=dmAutomatic;
CustomListBox.Flat:=True;
CustomListBox.Font.Color:=clLime;
CustomListBox.ParentFont:=False;
CustomListBox.ShowLines:=True;
CustomListBox.ItemHeightFixed:=True;
//**************************************************************************//
CustomListBox.AddCheckBox('блабла1', '', 1, False, True, True, True, nil); //0
CustomListBox.AddCheckBox('блабла2', '', 1, False, True, True, True, nil); //1
CustomListBox.AddCheckBox('блабла3', '', 1, False, True, True, True, nil); //2
end;
//**************************************************************************//
Function CheckBoxChecked(Idx: Integer): Boolean;
begin
case Idx of
0:
Result := CustomListBox.Checked[0];
1:
Result := CustomListBox.Checked[1];
2:
Result := CustomListBox.Checked[2];
end;
end;
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
'компонетлистстандарт1': UndefPic := '1.bmp';
'компонетлистстандарт2': UndefPic := '2.bmp';
'кастомлист1': UndefPic := 'к1.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;
CustomPage.OnItemMouseMove := @CompOnItemMouseMove;
CustomPage.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;