botva2

DLL botva2 0.9.9.156

Нет прав для скачивания

Darthame

Новичок
Это не то, что мне нужно. Слева должен быть CheckListBox и в нем должны быть чекбоксы и радио кнопки, а справа изображение и поле с описанием. Мне нужно, чтобы при наведении на компонент в поле появлялось его описание и изображение, с помощью botva2, чтобы изображения в bmp не конвертировать.
 

sergey3695

Ветеран
Модератор
Darthame, в FAQ есть пример с описанием компонентов при наведении. Картинки сам добавишь. ImgLoad, ImgVisible функции.
 

sergey3695

Ветеран
Модератор
Darthame,
Код:
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={sd}\My Application

[Files]
Source: Files\*; Flags: dontcopy

[Components]
Name: comp1; Description: "Компонент 1";
Name: comp2; Description: "Компонент 2";
Name: comp3; Description: "Компонент 3";

[Modules]
#include "Modules\botva2.iss"

[Code]
var
  XY: Tpoint;
  Img: Longint;
  ComponetForm: TSetupForm;

procedure RepaintForm(FileName: String);
begin
  Img:=ImgLoad(ComponetForm.Handle, FileName, 0, 0, 0, 0, False, True);
  ComponetForm.Left:=WizardForm.Left+60+XY.X; ComponetForm.Top:=WizardForm.Top+187+XY.Y;
  ImgApplyChanges(ComponetForm.Handle);
  ComponetForm.Show;
end;

procedure ComponentsListItemMouseMove(Sender: TObject; X: Integer; Y: Integer; Index: Integer; Area: TItemArea);
begin
  XY.X:=X; XY.Y:=Y;
case Index of
  0: RepaintForm('1.jpg');
  1: RepaintForm('2.jpg');
  2: RepaintForm('3.jpg');
  else ComponetForm.Hide;
 end;
end;

procedure ComponetMouseMove(Sender: TObject; Shift: TShiftState; X: Integer; Y: Integer);
begin
  ComponetForm.Hide;
end;

function InitializeSetup:boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
  Result:=True;
end;

procedure InitializeWizard;
begin
 WizardForm.ComponentsList.OnItemMouseMove:=@ComponentsListItemMouseMove;
 ComponetForm:=CreateCustomForm;
 ComponetForm.BorderStyle:=bsNone;
 ComponetForm.Width:=ScaleX(326);
 ComponetForm.Height:=ScaleY(245);
 ComponetForm.OnMouseMove:=@ComponetMouseMove;
end;

procedure DeinitializeSetup;
begin
  gdipShutDown;
end;
это пример с botva2.dll.
 
Последнее редактирование:

Darthame

Новичок
А как сделать так, чтобы компоненты нельзя было складывать?

screen.png

И еще я не разобрался, как применить изображение к определенному компоненту.
 

sergey3695

Ветеран
Модератор
И еще я не разобрался, как применить изображение к определенному компоненту.
case Index of
1:
// нумерация с 0, сверху вниз. 0 = справка 1 - английская 2 = русская
А как сделать так, чтобы компоненты нельзя было складывать?
ComponentsListTVStyle=false (или сотри строчку, флаг collapsed тогда не работает).
 

Darthame

Новичок
А здесь можно применить несколько картинок и к разным компонентам?
У меня ничего не получается.
Прости за множество вопросов, я просто нуб в этом.
 

sergey3695

Ветеран
Модератор
А здесь можно применить несколько картинок и к разным компонентам?
Код:
#include "Modules\botva2.iss"

[Setup]
AppName=My Program
AppVerName=My Program 1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputDir=.

[Files]
Source: Files\*; Flags: dontcopy

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

[CustomMessages]
russian.ComponentsName1=Моя программа™
russian.ComponentsName2=Помощь
russian.ComponentsName2_1=Документация
russian.ComponentsName2_2=Руководство пользователя
russian.ComponentsInfoPanel1=Описание
russian.ComponentsInfoPanel2=Наведите курсор мыши на компонент, чтобы прочитать его описание.
russian.ComponentsDescription1=Устанавливается обязательно
russian.ComponentsDescription2=Помощь
russian.ComponentsDescription3=Прочитать документацию
russian.ComponentsDescription4=Прочитать руководство пользователя

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: text; Description: Язык субтитров; Types: full; Flags: fixed
Name: text\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: text\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: voice; Description: Язык озвучки; Types: full; Flags: fixed
Name: voice\rus; Description: Русский; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: voice\eng; Description: Английский; Flags: exclusive; ExtraDiskSpaceRequired: 600000000

[Code]
type
  TComponentDesc = record Description: String; Index: Integer; end;

var
  Descs: array of TComponentDesc;
  Info: TNewStaticText;
  InfoCaption: TNewStaticText;
  InfoPanel: TPanel;
  ImgPanel: TPanel;
  Indx: Integer;
  Img: array of Longint;

procedure ShowDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var i: Integer;
begin
  Indx:=-1;
  for i:= 0 to GetArrayLength(Descs)-1 do begin
  if (Descs[i].Index=Index) then begin Indx:=i; Break end; end;
  if (Indx >=0)and(Area=iaItem) then Info.Caption:= Descs[Indx].Description else Info.Caption:= ExpandConstant('{cm:ComponentsInfoPanel2}');
//
  ImgSetVisibility(Img[0],False);
  ImgSetVisibility(Img[1],False);
  ImgSetVisibility(Img[2],False);
  ImgPanel.Caption := 'Превью';
case Index of
  1: begin ImgPanel.Caption := ''; ImgSetVisibility(Img[0],True); end;
  2: begin ImgPanel.Caption := ''; ImgSetVisibility(Img[1],True); end;
  3: begin ImgPanel.Caption := ''; ImgSetVisibility(Img[2],True); end;
end;
  ImgApplyChanges(ImgPanel.Handle);
end;

procedure AddDescription(AIndex: Integer; ADescription: String);
var i, k: Integer;
begin
i:= GetArrayLength(Descs); SetArrayLength(Descs, i+1);
Descs[i].Description:= ADescription; Descs[i].Index:= AIndex-1
end;

function InitializeSetup:boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
  Result:=True;
end;

procedure ImgCreate(Filename: string; i: integer);
begin
  Img[i]:= ImgLoad(ImgPanel.Handle, Filename, 0, 0, ScaleX(200), ScaleY(181) - WizardForm.TypesCombo.Top, True,True);
  ImgSetVisibility(Img[i],False);
end;

procedure InitializeWizard();
begin
  WizardForm.TypesCombo.Visible:=False;
  WizardForm.ComponentsList.Height := ScaleY(181) - WizardForm.TypesCombo.Top;
  WizardForm.ComponentsList.Top := WizardForm.TypesCombo.Top;
  WizardForm.ComponentsList.Width := ScaleX(207);
  WizardForm.ComponentsList.OnItemMouseMove:= @ShowDescription

  ImgPanel := TPanel.Create(WizardForm);
  ImgPanel.Parent := WizardForm.SelectComponentsPage;
  ImgPanel.Caption := 'Превью';
  ImgPanel.Top := WizardForm.TypesCombo.Top;
  ImgPanel.Left := ScaleX(217);
  ImgPanel.Width := ScaleX(200);
  ImgPanel.Height := ScaleY(181) - WizardForm.TypesCombo.Top;
  ImgPanel.BevelInner := bvRaised;
  ImgPanel.BevelOuter := bvLowered;
//
  SetArrayLength(Img, WizardForm.ComponentsList.ItemCount);
//
  ImgCreate('1.jpg', 0);
  ImgCreate('2.jpg', 1);
  ImgCreate('3.jpg', 2);
//
  ImgApplyChanges(ImgPanel.Handle);

  InfoPanel := TPanel.Create(WizardForm);
  InfoPanel.Parent := WizardForm.SelectComponentsPage;
  InfoPanel.Caption := '';
  InfoPanel.Top := ScaleY(190);
  InfoPanel.Left := ScaleX(0);
  InfoPanel.Width := ScaleX(417);
  InfoPanel.Height := ScaleY(40);
  InfoPanel.BevelInner := bvRaised;
  InfoPanel.BevelOuter := bvLowered;
  InfoCaption := TNewStaticText.Create(WizardForm);
  InfoCaption.Parent := WizardForm.SelectComponentsPage;
  InfoCaption.Caption := ExpandConstant('{cm:ComponentsInfoPanel1}');
  InfoCaption.Left := ScaleX(7);
  InfoCaption.Top := InfoPanel.Top - ScaleY(6);
  InfoCaption.Font.Color := clActiveCaption;

  Info := TNewStaticText.Create(WizardForm);
  Info.Parent := InfoPanel;
  Info.AutoSize := False;
  Info.Left := ScaleX(6);
  Info.Width := ScaleX(403);
  Info.Top := ScaleY(12);
  Info.Height := ScaleY(24);
  Info.Caption := ExpandConstant('{cm:ComponentsInfoPanel2}');
  Info.WordWrap := true;

  AddDescription(1, 'Справка'); //первый параметр - это номер компонента, идет последовательно от начала записи компонентов
  AddDescription(2, 'Английская справка'); //Второй параметр - это собственно описание компонента
  AddDescription(3, 'Русская справка');
  AddDescription(4, 'Плагины');
  AddDescription(5, 'Внутреннего просмотра');
  AddDescription(6, 'Архиваторные');
  AddDescription(7, 'Системные');
  AddDescription(8, 'CanonCam');
  AddDescription(9, 'PluginManager');
  AddDescription(10, 'Registry');
  AddDescription(11, 'Services');
  AddDescription(12, 'StartupGuard');
  AddDescription(13, 'Другие');
end;

procedure DeinitializeSetup;
begin
  gdipShutDown;
end;
 

Nemko

Дилетант
Модератор
Тут пример компонента (напоминает переключатель или кнопку с двумя состояниями), написан для botva2. P.S.: Давно "родил", может кому пригодиться.
 

Вложения

  • 94.5 KB Просмотры: 56
Сверху