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

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

Аватара для El Sanchez

Ветеран


Contributor


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

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


Цитата TheLeon:
1.Можно ли сделать шапку, похожую на данную, также текст, слева иконка(любого формата), а справа иконка "Вопроса", при наведении на которую, вылезает подсказка? (см.скрин 1) »
TheLeon, пример
Скрытый текст

Код: Выделить весь код
[Setup]
AppName=test
AppVerName=test
DefaultDirName={tmp}
Uninstallable=no
CreateUninstallRegKey=no
LicenseFile=compiler:license.txt

[Languages]
Name: ru; MessagesFile: compiler:Languages\russian.isl

[Messages]
ru.WizardLicense=Сканирование...

[Code]
//////////////////////////
procedure ChangeMainPanel;
var
  HelpBitmap: TBitmapImage;
begin
  WizardForm.PageDescriptionLabel.Hide;

  with WizardForm.WizardSmallBitmapImage do
  begin
    Left := ScaleX(10);
    Top := (Parent.Height - Height) div 2;
  end;

  HelpBitmap := TBitmapImage.Create(WizardForm.MainPanel);
  with HelpBitmap do
  begin
    Parent := WizardForm.MainPanel;
    Bitmap.LoadFromFile('{#CompilerPath }\WizModernSmallImage-IS.bmp');
    AutoSize := True;
    Left := Parent.Width - Width - ScaleX(10);
    Top := (Parent.Height - Height) div 2;
    ShowHint := True;
    Hint := 'Sample text';
  end;

  with WizardForm.PageNameLabel do
  begin
    Font.Color := clGray;
    Font.Size := 14;
    Font.Style := [];
    AdjustHeight;
    Left := WizardForm.WizardSmallBitmapImage.Left + WizardForm.WizardSmallBitmapImage.Width + ScaleX(10);
    Top := (Parent.Height - Height) div 2;
    Width := HelpBitmap.Left - Left - ScaleX(10);
  end;
end;

///////////////////////////
procedure InitializeWizard;
begin
  ChangeMainPanel;
end;

Цитата TheLeon:
2.Можно ли сделать анимированный баннер(или слайд-шоу)? (см.скрин 2) »
TheLeon, пример
Скрытый текст

Код: Выделить весь код
[Setup]
AppName=test
AppVerName=test
DefaultDirName={tmp}
Uninstallable=no
CreateUninstallRegKey=no

[Languages]
Name: ru; MessagesFile: compiler:Languages\russian.isl

[Code]
#define A = (Defined UNICODE) ? "W" : "A"
const
  WS_CHILD = $40000000;
  WS_VISIBLE = $10000000;
  WS_DISABLED = $08000000;

// ATL Functions
function AtlAxWinInit: BOOL; external 'AtlAxWinInit@atl.dll stdcall';
function AtlAxCreateControl(lpszName: string; hWnd: HWND; pStream, ppUnkContainer: Longint): HResult; external 'AtlAxCreateControl@atl.dll stdcall';

// Window Functions
function GetSysColor(nIndex: Integer): DWORD; external 'GetSysColor@user32.dll stdcall';
function CreateWindowEx(dwExStyle: DWORD; lpClassName, lpWindowName: string; dwStyle: DWORD; x, y, nWidth, nHeight: Integer; hWndParent: HWND; hMenu: HMENU; hInstance, lpParam: Longint): HWND; external 'CreateWindowEx{#A}@user32.dll stdcall';
function DestroyWindow(hWnd: HWND): BOOL; external 'DestroyWindow@user32.dll stdcall';

var
  GIFWndHandle: HWND;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function ShowAnimatedGIF(AWndParent: HWND; ALeft, ATop, AWidth, AHeight: Integer; AUrl: string; AColor: TColor): HWND;
(*
Parameters:
  AWndParent...: A handle to the parent window
  ALeft........: The initial horizontal position of the window
  ATop.........: The initial vertical position of the window
  AWidth.......: The width of the window
  AHeight......: The height of the window
  AUrl.........: The URL or full path of the GIF file
  AColor.......: Color background
Return value:
  A handle to ActiveX control host window
*)
var
  HTMLStr: string;
  ResultCode: HResult;
begin
  if not AtlAxWinInit then Exit;
  Result := CreateWindowEx(0, 'AtlAxWin', '', WS_CHILD or WS_VISIBLE or WS_DISABLED, ALeft, ATop, AWidth, AHeight, AWndParent, 0, 0, 0);
  if Result = 0 then
    RaiseException(SysErrorMessage(DLLGetLastError));

  if AColor < 0 then
    AColor := GetSysColor(AColor and $0000FF);
  HTMLStr := Format('about:<html><body leftmargin="0" topmargin="0" scroll="no" bgcolor="#%.2x%.2x%.2x"><p align="center"><img src="%s" height="100%%"></img></p></body></html>', [AColor and $0000FF, AColor and $00FF00 shr 8, AColor and $FF0000 shr 16, AUrl]);

  ResultCode := AtlAxCreateControl(HTMLStr, Result, 0, 0);
  if ResultCode <> 0 then
    RaiseException(SysErrorMessage(ResultCode));
end;

///////////////////////////
procedure InitializeWizard;
begin
  GIFWndHandle := ShowAnimatedGIF(WizardForm.SelectDirPage.Handle,
    0, WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ScaleY(5), WizardForm.SelectDirPage.Width, WizardForm.DiskSpaceLabel.Top - WizardForm.DirEdit.Top - WizardForm.DirEdit.Height - ScaleY(5),
    'https://media.giphy.com/media/9y0qXExCElAgU/giphy.gif', WizardForm.SelectDirPage.Color);
end;

////////////////////////////
procedure DeinitializeSetup;
begin
  if GIFWndHandle <> 0 then
    DestroyWindow(GIFWndHandle);
end;

Цитата TheLeon:
3.Можно ли при наведении, именно на первый пункт, показывало в превью изображения "Наведите курсор..."? (см.скрин 3) »
TheLeon, в ShowCompDescription после CompDescImg.Show; дописываете:
Скрытый текст

Код: Выделить весь код
if Index = 0 then
  CompDescText.Caption := 'Наведите курсор...'
else
  CompDescText.Caption := '';

Цитата TheLeon:
4.Можно ли сделать подобный стиль для кнопок(не меня размеры, просто стиль)? (см.скрин 4) »
TheLeon, ISSkin, ISSkinEx, vcl-styles-plugins, SkinSharp.
Это сообщение посчитали полезным следующие участники:

Отправлено: 18:12, 11-04-2018 | #19