[setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
[Components]
Name: Mode; Description: mode; Types: custom; flags: fixed
Name: Mode/SPOnly; Description: SPOnly; Flags: disablenouninstallwarning
Name: Mode/MPOnly; Description: MPOnly; Flags: disablenouninstallwarning
Name: Mode2; Description: mode; Types: custom; flags: fixed
Name: Mode2/SPOnly2; Description: SPOnly2; Flags: disablenouninstallwarning
Name: Mode2/MPOnly2; Description: MPOnly2; Flags: disablenouninstallwarning
[Code]
type
TCheckListBoxHelper = record
Index: Integer;
ItemArea: TItemArea;
end;
var
CLBHelper: TCheckListBoxHelper;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure ComponentsListOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if (Button = mbLeft) and (CLBHelper.ItemArea = iaItem) then
begin
with TNewCheckListBox(Sender) do
begin
if ItemEnabled[CLBHelper.Index] then
begin
case State[CLBHelper.Index] of
cbUnchecked,
cbGrayed:
CheckItem(CLBHelper.Index, coCheckWithChildren);
cbChecked:
CheckItem(CLBHelper.Index, coUncheck);
end;
end;
end;
end;
end;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure ComponentsListOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
begin
CLBHelper.Index := Index;
CLBHelper.ItemArea := Area;
end;
procedure InitializeWizard;
begin
with WizardForm.ComponentsList do
begin
TreeViewStyle:= True;
if TreeViewStyle then
begin
OnMouseDown := @ComponentsListOnMouseDown;
OnItemMouseMove := @ComponentsListOnItemMouseMove;
end;
end;
end;
Оно самоени это?
Код:[setup] AppName=My Application AppVersion=1.5 DefaultDirName={pf} [Languages] Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl" [Components] Name: Mode; Description: mode; Types: custom; flags: fixed Name: Mode/SPOnly; Description: SPOnly; Flags: disablenouninstallwarning Name: Mode/MPOnly; Description: MPOnly; Flags: disablenouninstallwarning Name: Mode2; Description: mode; Types: custom; flags: fixed Name: Mode2/SPOnly2; Description: SPOnly2; Flags: disablenouninstallwarning Name: Mode2/MPOnly2; Description: MPOnly2; Flags: disablenouninstallwarning [Code] type TCheckListBoxHelper = record Index: Integer; ItemArea: TItemArea; end; var CLBHelper: TCheckListBoxHelper; ////////////////////////////////////////////////////////////////////////////////////////////////////////////// procedure ComponentsListOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbLeft) and (CLBHelper.ItemArea = iaItem) then begin with TNewCheckListBox(Sender) do begin if ItemEnabled[CLBHelper.Index] then begin case State[CLBHelper.Index] of cbUnchecked, cbGrayed: CheckItem(CLBHelper.Index, coCheckWithChildren); cbChecked: CheckItem(CLBHelper.Index, coUncheck); end; end; end; end; end; ///////////////////////////////////////////////////////////////////////////////////////////////////////// procedure ComponentsListOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea); begin CLBHelper.Index := Index; CLBHelper.ItemArea := Area; end; procedure InitializeWizard; begin with WizardForm.ComponentsList do begin TreeViewStyle:= True; if TreeViewStyle then begin OnMouseDown := @ComponentsListOnMouseDown; OnItemMouseMove := @ComponentsListOnItemMouseMove; end; end; end;
Не подскажете?ни это?
Код:[setup] AppName=My Application AppVersion=1.5 DefaultDirName={pf} [Languages] Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl" [Components] Name: Mode; Description: mode; Types: custom; flags: fixed Name: Mode/SPOnly; Description: SPOnly; Flags: disablenouninstallwarning Name: Mode/MPOnly; Description: MPOnly; Flags: disablenouninstallwarning Name: Mode2; Description: mode; Types: custom; flags: fixed Name: Mode2/SPOnly2; Description: SPOnly2; Flags: disablenouninstallwarning Name: Mode2/MPOnly2; Description: MPOnly2; Flags: disablenouninstallwarning [Code] type TCheckListBoxHelper = record Index: Integer; ItemArea: TItemArea; end; var CLBHelper: TCheckListBoxHelper; ////////////////////////////////////////////////////////////////////////////////////////////////////////////// procedure ComponentsListOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbLeft) and (CLBHelper.ItemArea = iaItem) then begin with TNewCheckListBox(Sender) do begin if ItemEnabled[CLBHelper.Index] then begin case State[CLBHelper.Index] of cbUnchecked, cbGrayed: CheckItem(CLBHelper.Index, coCheckWithChildren); cbChecked: CheckItem(CLBHelper.Index, coUncheck); end; end; end; end; end; ///////////////////////////////////////////////////////////////////////////////////////////////////////// procedure ComponentsListOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea); begin CLBHelper.Index := Index; CLBHelper.ItemArea := Area; end; procedure InitializeWizard; begin with WizardForm.ComponentsList do begin TreeViewStyle:= True; if TreeViewStyle then begin OnMouseDown := @ComponentsListOnMouseDown; OnItemMouseMove := @ComponentsListOnItemMouseMove; end; end; end;
А что подсказывать. Вам дали пример... используйте его в своих целях.Не подскажете?
И где мне дали пример? Почитай шапку для начала.А что подсказывать. Вам дали пример... используйте его в своих целях.
if TreeViewStyle then
begin
OnMouseDown := @ComponentsListOnMouseDown;
OnItemMouseMove := @ComponentsListOnItemMouseMove;
end;
if TreeViewStyle or TVStyle then
begin
OnMouseDown := @ComponentsListOnMouseDown;
OnItemMouseMove := @ComponentsListOnItemMouseMove;
end;
TVStyle неизвестное значение при компиляции. инно 5.5.1 юникодjustdj, да фигню написал. я прям уверен если
заменить на этоКод:if TreeViewStyle then begin OnMouseDown := @ComponentsListOnMouseDown; OnItemMouseMove := @ComponentsListOnItemMouseMove; end;
то заработает.Код:if TreeViewStyle or TVStyle then begin OnMouseDown := @ComponentsListOnMouseDown; OnItemMouseMove := @ComponentsListOnItemMouseMove; end;
[Setup]
ComponentsListTVStyle=true
with WizardForm.ComponentsList do
begin
if Checked[0] and Checked[1] and Checked[2] and Checked[4] then
WizardForm.TypesCombo.ItemIndex:= 0
else
WizardForm.TypesCombo.ItemIndex:= 1;
end;
[setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\1
ComponentsListTVStyle=true
[Languages]
Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
[Types]
Name: full; Description: Полная установка
Name: custom; Description: Выборочная установка; Flags: iscustom
[Components]
Name: a; Description: Моя программа™; Types: full
Name: a\a; Description: Руководство пользователя; Types: full
Name: a\a\a; Description: Русский; Flags: exclusive
Name: a\a\b; Description: English; Flags: exclusive
Name: a\b; Description: Справка; Types: full
[Code]
type
TCheckListBoxHelper = record
Index: Integer;
ItemArea: TItemArea;
end;
var
CLBHelper: TCheckListBoxHelper;
b: tnewchecklistbox;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure ComponentsListOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if (Button = mbLeft) and (CLBHelper.ItemArea = iaItem) then
begin
with TNewCheckListBox(Sender) do
begin
if ItemEnabled[CLBHelper.Index] then
begin
case State[CLBHelper.Index] of
cbUnchecked,
cbGrayed:
CheckItem(CLBHelper.Index, coCheckWithChildren);
cbChecked:
CheckItem(CLBHelper.Index, coUncheck);
end;
end;
end;
end;
//
with WizardForm.ComponentsList do
begin
if Checked[0] and Checked[1] and Checked[2] and Checked[4] then
WizardForm.TypesCombo.ItemIndex:= 0
else
WizardForm.TypesCombo.ItemIndex:= 1;
end;
end;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
procedure ComponentsListOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
begin
CLBHelper.Index := Index;
CLBHelper.ItemArea := Area;
end;
procedure InitializeWizard;
begin
with WizardForm.ComponentsList do
begin
OnMouseDown := @ComponentsListOnMouseDown;
OnItemMouseMove := @ComponentsListOnItemMouseMove;
end;
end;
Можно добавить вызов обработчика OnClickCheck() после установки состояния элементачто-то кроме как вручную прописывать не знаю
****
case State[CLBHelper.Index] of
cbUnchecked,
cbGrayed:
CheckItem(CLBHelper.Index, coCheckWithChildren);
cbChecked:
CheckItem(CLBHelper.Index, coUncheck);
end;
TNewCheckListBox(Sender).OnClickCheck(Sender);
****