Jump to content
Korean Random
EvilAlex

Создание инсталляторов для модпаков на базе Inno Setup

Recommended Posts

Посту выше посвящается... 

 

https://vk.com/video271056884_170803032?t=2m25s

Function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
case CurPageID of
wpSelectDir:
  begin
   if not FileExists(ExpandConstant('{app}\WorldOfTanks.exe')) then begin
    MsgBoxEx(0, 'Установка модов невозможна, так как по выбранному пути отсутствует клиент игры World of Tanks. Выберите правильный путь и продолжайте установку!','Внимание!!',MB_OK or MB_ICONERROR, 0, 0);
    Result := False;
   end;
end;
   wpReady:
    begin
    if IsAppRunning() then
    begin
     MsgBox('Клиент игры World of Tanks в настоящее время запущен!' + #13 + 'Необходимо закрыть его перед продолжением установки!', mbError, MB_OK);
     Result:=False;
    end;
   end;
end;
end;
Edited by sergy2010
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

sergy2010 Спасибо большое!!! и в том что в личке помог тоже)))  теперь осталось решить вопрос с картинками )))  надеюсь помогут ))))

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites
Function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
case CurPageID of
wpSelectDir:
  begin
   if not FileExists(ExpandConstant('{app}\WorldOfTanks.exe')) then begin
    MsgBoxEx(0, 'Установка модов невозможна, так как по выбранному пути отсутствует клиент игры World of Tanks. Выберите правильный путь и продолжайте установку!','Внимание!!',MB_OK or MB_ICONERROR, 0, 0);
    Result := False;
   end;
end;
   wpReady:
    begin
    if IsAppRunning() then
    begin
     MsgBox('Клиент игры World of Tanks в настоящее время запущен!' + #13 + 'Необходимо закрыть его перед продолжением установки!', mbError, MB_OK);
     Result:=False;
    end;
   end;
 end;
end;

привет, помоги с картинками  для трех страниц 

Share this post


Link to post

Short link
Share on other sites

sergy2010 Спасибо большое!!! и в том что в личке помог тоже)))  теперь осталось решить вопрос с картинками )))  надеюсь помогут ))))

да и не я помог а весь форум по их знаниям немного помог

Edited by sergy2010
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

помоги с картинками  для трех страниц

 

теперь осталось решить вопрос с картинками

 

Не надо наглеть. Вот вам коды. Думайте сами.

"Картинка и описание"

[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application
[CustomMessages]
CompName1=Компонент 1
CompName2=Компонент 2
ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание.
ComponentsImgInfo=Наведите курсор мыши на компонент, чтобы посмотреть его превью.
CompDesc1=Описание первого компонента
CompDesc2=Описание второго компонента
[Files]
Source: "compiler:WizModernImage.bmp"; DestName: "CompDescImg1.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage-IS.bmp"; DestName: "CompDescImg2.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage.bmp"; DestName: "MainPic.bmp"; Flags: dontcopy
[Components]
Name: comp1; Description: "{cm:CompName1}";
Name: comp2; Description: "{cm:CompName2}";
Name: comp3; Description: "{cm:CompName1}";
Name: comp4; Description: "{cm:CompName2}";
Name: comp5; Description: "{cm:CompName1}";
Name: comp6; Description: "{cm:CompName2}";
[_Code_]
type
TComponentDesc = record
Description: String;
ImageName: String;
Index: Integer;
end;
var
CompDescs: array of TComponentDesc;
CompDescPanel, CompDescImgPanel: TPanel;
CompDescText: TLabel;
CompIndex, LastIndex: Integer;
CompDescImg: TBitmapImage;
procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
i: Integer;
begin
if Index = LastIndex then Exit;
CompIndex := -1;
for i := 0 to GetArrayLength(CompDescs) -1 do
begin
if (CompDescs[i].Index = Index) then
begin
CompIndex := i;
Break;
end;
end;
if (CompIndex >= 0) and (Area = iaItem) then
begin
if not FileExists(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName) then
ExtractTemporaryFile(CompDescs[CompIndex].ImageName);
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName);
CompDescImg.Show;
CompDescText.Caption := CompDescs[CompIndex].Description;
CompDescText.Enabled := True;
end else
begin
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
CompDescText.Caption := CustomMessage('ComponentsInfo');
CompDescText.Enabled := False;
end;
LastIndex := Index;
end;
procedure CompListMouseLeave(Sender: TObject);
begin
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
CompDescText.Caption := CustomMessage('ComponentsInfo');
CompDescText.Enabled := False;
LastIndex := -1;
end;
procedure AddCompDescription(AIndex: Integer; ADescription: String; AImageName: String);
var
i: Integer;
begin
i := GetArrayLength(CompDescs);
SetArrayLength(CompDescs, i + 1);
CompDescs[i].Description := ADescription;
CompDescs[i].ImageName := AImageName;
CompDescs[i].Index := AIndex - 1
end;
function GetComponentIndex(Name: String): Integer;
var
  i: Integer;
begin
  Result:= -1;
  for i:= 0 to WizardForm.ComponentsList.ItemCount-1 do begin
    if (WizardForm.ComponentsList.ItemCaption[i] = Name) then begin
      Result:= i + 1;
      Break;
    end;
  end;
end;
procedure InitializeWizard();
begin
ExtractTemporaryFile('MainPic.bmp');
WizardForm.SelectComponentsLabel.Hide;
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205));
WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;
CompDescImgPanel := TPanel.Create(WizardForm);
with CompDescImgPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(0), ScaleX(225), ScaleY(120));
BevelInner := bvLowered;
end;
CompDescImg := TBitmapImage.Create(WizardForm);
with CompDescImg do
begin
Parent := CompDescImgPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
Stretch := True;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
end;
CompDescPanel := TPanel.Create(WizardForm);
with CompDescPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80));
BevelInner := bvLowered;
end;
CompDescText := TLabel.Create(WizardForm);
with CompDescText do
begin
Parent := CompDescPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10));
AutoSize := False;
WordWrap := True;
Enabled := False;
Caption := CustomMessage('ComponentsInfo');
end;
AddCompDescription(GetComponentIndex(CustomMessage('CompName1')), CustomMessage('CompDesc1'), 'CompDescImg1.bmp');
AddCompDescription(GetComponentIndex(CustomMessage('CompName2')), CustomMessage('CompDesc2'), 'CompDescImg2.bmp');
end; 

"Только картинка"

[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа
[CustomMessages]
CompName1=Компонент 1
CompName2=Компонент 2
ComponentsImgInfo=Наведите курсор мыши на компонент, чтобы посмотреть его превью.
CompDesc1=Описание первого компонента
CompDesc2=Описание второго компонента
[Files]
Source: "compiler:WizModernImage.bmp"; DestName: "CompDescImg1.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage-IS.bmp"; DestName: "CompDescImg2.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage.bmp"; DestName: "MainPic.bmp"; Flags: dontcopy
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Components]
Name: comp1; Description: "{cm:CompName1}"; Types: full
Name: comp2; Description: "{cm:CompName2}"; Types: full
Name: comp3; Description: "{cm:CompName1}"; Types: full
Name: comp4; Description: "{cm:CompName2}"; Types: full
Name: comp5; Description: "{cm:CompName1}"; Types: full
Name: comp6; Description: "{cm:CompName2}"; Types: full
Name: comp7; Description: "{cm:CompName1}"; Types: full
Name: comp8; Description: "{cm:CompName2}"; Types: full
[_Code_]
type
  TComponentDesc = record
    ImageName: String;
    Index: Integer;
  end;
var
  CompDescs: array of TComponentDesc;
  CompDescImgPanel: TPanel;
  CompIndex, LastIndex: Integer;
  CompDescImg: TBitmapImage;
procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
  i: Integer;
begin
  if Index = LastIndex then Exit;
  CompIndex := -1;
  for i := 0 to GetArrayLength(CompDescs) -1 do
  begin
    if (CompDescs[i].Index = Index) then
    begin
      CompIndex := i;
      Break;
    end;
  end;
  if (CompIndex >= 0) and (Area = iaItem) then
  begin
    if not FileExists(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName) then
      ExtractTemporaryFile(CompDescs[CompIndex].ImageName);
    CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName);
   CompDescImg.Show;
end else
begin
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
end;
LastIndex := Index;
end;
procedure CompListMouseLeave(Sender: TObject);
begin
  LastIndex := -1;
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
end;
procedure AddCompDescription(AIndex: Integer; AImageName: String);
var
  i: Integer;
begin
  i := GetArrayLength(CompDescs);
  SetArrayLength(CompDescs, i + 1);
  CompDescs[i].ImageName := AImageName;
  CompDescs[i].Index := AIndex - 1
end;
function GetComponentIndex(Name: String): Integer;
var
  i: Integer;
begin
  Result:= -1;
  for i:= 0 to WizardForm.ComponentsList.ItemCount-1 do begin
    if (WizardForm.ComponentsList.ItemCaption[i] = Name) then begin
      Result:= i + 1;
      Break;
    end;
  end;
end;
procedure InitializeWizard();
begin
  ExtractTemporaryFile('MainPic.bmp');
  WizardForm.SelectComponentsLabel.Hide;
  WizardForm.TypesCombo.Hide;
  WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(200));
  WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
  WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;
  CompDescImgPanel := TPanel.Create(WizardForm);
  with CompDescImgPanel do
  begin
    Parent := WizardForm.SelectComponentsPage;
    SetBounds(ScaleX(192), ScaleY(0), ScaleX(225), ScaleY(120));
    BevelInner := bvLowered;
  end;
  CompDescImg := TBitmapImage.Create(WizardForm);
  with CompDescImg do
  begin
    Parent := CompDescImgPanel;
    SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
    Stretch := True;
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\MainPic.bmp'));
  end;
  AddCompDescription(GetComponentIndex(CustomMessage('CompName1')), 'CompDescImg1.bmp');  //по названию компонента
  AddCompDescription(GetComponentIndex(CustomMessage('CompName2')), 'CompDescImg2.bmp');  //по названию компонента
end; 

"Только описание"

[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа
[CustomMessages]
CompName1=Компонент 1
CompName2=Компонент 2
CompName3=Компонент 3
CompName4=Компонент 4
CompName5=Компонент 5
CompName6=Компонент 6
ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание.
CompDesc1=Описание первого компонента
CompDesc2=Описание второго компонента
CompDesc3=Описание третьего компонента
CompDesc4=Описание четвертого компонента
[Components]
Name: comp1; Description: "{cm:CompName1}";
Name: comp2; Description: "{cm:CompName2}";
Name: comp3; Description: "{cm:CompName3}";
Name: comp4; Description: "{cm:CompName4}";
Name: comp5; Description: "{cm:CompName5}";
Name: comp6; Description: "{cm:CompName6}";
[_Code_]
type
TComponentDesc = record
Description: String;
ImageName: String;
Index: Integer;
end;
var
CompDescs: array of TComponentDesc;
CompDescPanel: TPanel;
CompDescText: TLabel;
CompIndex, LastIndex: Integer;
procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
i: Integer;
begin
if Index = LastIndex then Exit;
CompIndex := -1;
for i := 0 to GetArrayLength(CompDescs) -1 do
begin
if (CompDescs[i].Index = Index) then
begin
CompIndex := i;
Break;
end;
end;
if (CompIndex >= 0) and (Area = iaItem) then
begin
CompDescText.Caption := CompDescs[CompIndex].Description;
CompDescText.Enabled := True;
end else
begin
CompDescText.Caption := CustomMessage('ComponentsInfo');
CompDescText.Enabled := False;
end;
LastIndex := Index;
end;
procedure CompListMouseLeave(Sender: TObject);
begin
CompDescText.Caption := CustomMessage('ComponentsInfo');
CompDescText.Enabled := False;
LastIndex := -1;
end;
procedure AddCompDescription(AIndex: Integer; ADescription: String);
var
i: Integer;
begin
i := GetArrayLength(CompDescs);
SetArrayLength(CompDescs, i + 1);
CompDescs[i].Description := ADescription;
CompDescs[i].Index := AIndex - 1
end;
function GetComponentIndex(Name: String): Integer;
var
  i: Integer;
begin
  Result:= -1;
  for i:= 0 to WizardForm.ComponentsList.ItemCount-1 do begin
    if (WizardForm.ComponentsList.ItemCaption[i] = Name) then begin
      Result:= i + 1;
      Break;
    end;
  end;
end;
procedure InitializeWizard();
begin
WizardForm.SelectComponentsLabel.Hide;
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205));
WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;
CompDescPanel := TPanel.Create(WizardForm);
with CompDescPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80));
BevelInner := bvLowered;
end;
CompDescText := TLabel.Create(WizardForm);
with CompDescText do
begin
Parent := CompDescPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10));
AutoSize := False;
WordWrap := True;
Enabled := False;
Caption := CustomMessage('ComponentsInfo');
end;
AddCompDescription(GetComponentIndex(CustomMessage('CompName1')), CustomMessage('CompDesc1'));
AddCompDescription(GetComponentIndex(CustomMessage('CompName2')), CustomMessage('CompDesc2'));
AddCompDescription(GetComponentIndex(CustomMessage('CompName3')), CustomMessage('CompDesc3'));
AddCompDescription(GetComponentIndex(CustomMessage('CompName4')), CustomMessage('CompDesc4'));
end; 

Edited by Gad575
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
16 часов назад, Gad575 сказал:

Не надо наглеть. Вот вам коды. Думайте сами.

 

Дело в том что у меня совсем по другому)) я хочу ко второй странице сделать картинки  используя тот код что у меня уже есть

 

Скрытый текст

#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 '[email protected] stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] 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 '[email protected] 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

            '. Анимированная лампочка 10сек.': UndefPic := 'анимированная лампочка.bmp';
             '. Белые трупы танков и белые гусеницы': UndefPic := 'белые трупы.bmp';
             '. небо звездное': UndefPic := 'звездное небо.bmp';
             '. Новый интерфейс ангара': UndefPic := 'кр.bmp';
             '. Мод тень от Polar Fox (модель танка)': UndefPic := 'Мод Тень.bmp';
             '. Панель счета c HP команд + лог урона': UndefPic := 'панель ХП.bmp';
             '. прицел - Jimbo': UndefPic := 'прицел джимбо.bmp';
             '. Круги сведения с пробитием (31 вариант)-(копируется на рабочий стол)': UndefPic := 'сведения.bmp';
            '. статистика за сессию SeVeRRR': UndefPic := 'статистика SeVeRRR.bmp';
            'ОЛЕНЬ': UndefPic := 'ХВМ.bmp';
            '. цветные пробития': UndefPic := 'цветные пробития.bmp';
            '. прицел - Желтый': UndefPic := 'прицел желтый.bmp';
            '. панель повреждений с таймером ремонта от Andre_V \ GambitER': UndefPic := 'панель GambitER.bmp';

            '. Менеджер аккаунтов': UndefPic := 'Менеджер аккаунтов.bmp';
            '. P-MoD = сервер + лампа 10 сек + ком.камера + зум60х': UndefPic := 'п мод.bmp';
            '. Отображения установленного оборудования на танках': UndefPic := 'показ оборудования.bmp';
            '. мод тылы, разноцветный индикатор ближайших врагов': UndefPic := 'тылы мод.bmp';
            '. прицел L - MS': UndefPic := 'прицел L - MS.bmp';
            '. прицел от Andr': UndefPic := 'прицел от Andr.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;

 

 

конечно если это вообще возможно сделать используя этот код )))

 

 

Edited by ЛОМ
  • Downvote 1

Share this post


Link to post

Short link
Share on other sites
4 часа назад, sergy2010 сказал:

ужасная стала корейка

ну  я тебе в личке написал. про странице с картинками

Share this post


Link to post

Short link
Share on other sites

Это опять я ))) 

procedure InitInfo();
begin
    WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
    WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;

//================СДЕЛАЛ ТАК...НА ТАСКСЕ КАРТИНКИ ВСПЛЫВАЮТ КАК ПОЛОЖЕНО... =============

    WizardForm.TasksList.OnItemMouseMove := @CompOnItemMouseMove;
    WizardForm.TasksList.OnMouseLeave := @CompOnMouseLeave;


//============ПОДСКАЖИТЕ КАК ТУТ ПРОПИСАТЬ ЧТОБЫ КАРТИНКИ И НА ВТОРОЙ СТРАНИЦЕ ВСПЛЫВАЛИ ? ==========================

    WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
    WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;

//==============================================================================================================

я и ComponentsForm2 писал и ComponentsPage2 и ComponentsList2 и SelectComponentsLabel2 и паспортные данные писал и просил и угрожал, но ни в какую не хочет заводится! 

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites
14 часа назад, Darksoul сказал:

А что именно не так?

да интерфейс не привычен и поисковик как то не так работает хотя всё ищет

сполера не могу найти при написании стекста

при отправке сообщения приходится страничку обновлять  

да это дело времени привыкну

Edited by sergy2010

Share this post


Link to post

Short link
Share on other sites

подскажите как в этом месте такое же всплывающее окошко с подсказками сделать? конечно если это не секрет))) 

 

NEolXkAdTJegn2sdWqIGcg.png

  • Downvote 1

Share this post


Link to post

Short link
Share on other sites

@ЛОМ, вероятно, это простое изображение. Как это делается, здесь, думаю, всем известно.
Но можно и заморочиться - сделать полнофункциональную панельку. Делается по аналогии с изображением.

Share this post


Link to post

Short link
Share on other sites
1 час назад, Kotyarko_O сказал:

@ЛОМ, вероятно, это простое изображение. Как это делается, здесь, думаю, всем известно.
Но можно и заморочиться - сделать полнофункциональную панельку. Делается по аналогии с изображением.

я так понял  это сделано вот этим кодом  да? 

 

 

#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 = (0);


var
    InfoPic: TBitmapImage;
    LastIndex: Integer;
    TempPath: String;
    PicForm: TForm;


type
    COLORREF = DWORD;


function GetCursorPos(var lpPoint: TPoint): BOOL; external '[email protected] stdcall';
function SetLayeredWindowAttributes(Hwnd: THandle; crKey: COLORREF; bAlpha: Byte; dwFlags: DWORD): Boolean; external '[email protected] 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 '[email protected] 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 + 66), ScaleY(pt.y - 270), 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


            '. Тактические позиции на миникарте (автор DontWorry)': UndefPic := 'Тактические позиции на миникарте.bmp';
            '. Боевые раны (POLIROID)': UndefPic := 'Боевые раны.bmp';
            '. Камуфляжи команд Wargaming.net League ( Navi и т.д. )': UndefPic := 'Камуфляжи команд Wargaming.bmp';
            '. панель повреждений - Legacy от Andre_V': UndefPic := 'Панель повреждений - Legacy.bmp';

            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.bmp';
            '. НАЗВАНИЕ МОДА': UndefPic := 'НАЗВАНИЕ КАРТИНКИ.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;

 

не подскажете что и куда вписать нужно чтобы именно на этой странице вывести картинку ? 

 

NEolXkAdTJegn2sdWqIGcg.png

Edited by ЛОМ

Share this post


Link to post

Short link
Share on other sites

это вроде можно сделать и с этим кодом чтобы при наведении картинка выводилась. вот с Tasks у меня всё получается. дописал просто в код то что ниже...

 

procedure InitInfo();
begin
    WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
    WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;

    WizardForm.TasksList.OnItemMouseMove := @CompOnItemMouseMove;
    WizardForm.TasksList.OnMouseLeave := @CompOnMouseLeave;

 а вот как подключить  к этому коду SelectDirPage я что то ваще не догоняю (

Share this post


Link to post

Short link
Share on other sites
8 hours ago, ЛОМ said:

я так понял  это сделано вот этим кодом  да?

Возможно.

 

2 hours ago, ЛОМ said:

а вот как подключить  к этому коду SelectDirPage я что то ваще не догоняю (

А при чём здесь вообще страница? Ты эвенты должен повесить на checkListBox, а не на страницу.
Вот и дерзай, тем более ты вот уже два примера и привёл.

Share this post


Link to post

Short link
Share on other sites
7 часов назад, Kotyarko_O сказал:

А при чём здесь вообще страница? Ты эвенты должен повесить на checkListBox, а не на страницу.

 

Ну ни в какую не допетрю....

Share this post


Link to post

Short link
Share on other sites
1 hour ago, ЛОМ said:

Ну ни в какую не допетрю....

WizardForm.ComponentsList - тот же класс, что и твой ComponentsList2, только в составе класса-родителя.
Если к событиям визардского ты обращаешься так: WizardForm.ComponentsList.OnItemMouseMove, то к кастомному ты должен обращаться точно так же: ComponentsList2.OnItemMouseMove.

Edited by Kotyarko_O

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...