type
TCheckBoxTree = record
Item: FTreeViewItem;
Box: FCheckBox;
Btn: FRadioButton;
end;
var
AForm : FForm;
ATreeView: FTreeView;
CheckBoxTree: array [1..20] of TCheckBoxTree;
procedure FMXInnoInit;
var
i: Integer;
begin
AForm := InitFormHandle;
ATreeView := InitTreeViewHandle;
for i:= 1 to 20 do
begin
CheckBoxTree[i].Item := InitTreeViewItemHandle;
CheckBoxTree[i].Box := InitCheckBoxHandle;
CheckBoxTree[i].Btn := InitRadioButtonHandle;
end;
end;
function InitializeSetup(): Boolean;
begin
FMXInnoInit;
Result := True;
end;
procedure FMXDesigning; forward;
procedure InitializeWizard();
begin
EmptyWizardForm(False, 640, 480);
FMXDesigning;
AForm.Show;
end;
procedure DeinitializeSetup();
begin
FMXInnoShutDown;
end;
procedure FMXDesigning;
var
i: Integer;
begin
AForm.FCreateFluent(WizardForm.Handle, False, False, 0.56, 0);
if not IsOSMatched(B_WIN11_21H2) then
AForm.Win10FluentRedrawOnUpdate(True);
AForm.SetCursor(ExtractAndLoad('Dark.cur'));
AForm.LoadStyleFromFile(ExtractAndLoad('LightStyle.style'));
ATreeView.FCreate(AForm.Handle);
ATreeView.SetBounds(40, 40, 200, 400);
ATreeView.ItemHeight(20);
CheckBoxTree[1].Item.FCreate(ATreeView.Handle);
CheckBoxTree[1].Item.Text('Root 1'); //Root 1
CheckBoxTree[2].Item.FCreate(ATreeView.Handle);
CheckBoxTree[2].Item.Text('Root 2'); //Root 2
CheckBoxTree[3].Item.FCreate(ATreeView.Handle);
CheckBoxTree[3].Item.Text(''); //Parent 1
CheckBoxTree[3].Box.FCreate(CheckBoxTree[3].Item.Handle, True, 'Parent 1');
CheckBoxTree[3].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[4].Item.FCreate(ATreeView.Handle);
CheckBoxTree[4].Item.Text(''); //Parent 2
CheckBoxTree[4].Box.FCreate(CheckBoxTree[4].Item.Handle, True, 'Parent 2');
CheckBoxTree[4].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[5].Item.FCreate(ATreeView.Handle);
CheckBoxTree[5].Item.Text(''); //Parent 1
CheckBoxTree[5].Box.FCreate(CheckBoxTree[5].Item.Handle, True, 'Parent 1');
CheckBoxTree[5].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[6].Item.FCreate(ATreeView.Handle);
CheckBoxTree[6].Item.Text(''); //Parent 2
CheckBoxTree[6].Box.FCreate(CheckBoxTree[6].Item.Handle, True, 'Parent 2');
CheckBoxTree[6].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[7].Item.FCreate(ATreeView.Handle);
CheckBoxTree[7].Item.Text(''); //Child 1
CheckBoxTree[7].Box.FCreate(CheckBoxTree[7].Item.Handle, True, 'Child 1');
CheckBoxTree[7].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[8].Item.FCreate(ATreeView.Handle);
CheckBoxTree[8].Item.Text(''); //Child 2
CheckBoxTree[8].Box.FCreate(CheckBoxTree[8].Item.Handle, True, 'Child 2');
CheckBoxTree[8].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[9].Item.FCreate(ATreeView.Handle);
CheckBoxTree[9].Item.Text(''); //Child 1
CheckBoxTree[9].Box.FCreate(CheckBoxTree[9].Item.Handle, True, 'Child 1');
CheckBoxTree[9].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[10].Item.FCreate(ATreeView.Handle);
CheckBoxTree[10].Item.Text(''); //Child 2
CheckBoxTree[10].Box.FCreate(CheckBoxTree[10].Item.Handle, True, 'Child 2');
CheckBoxTree[10].Box.SetBounds(20, 0, 180, 20);
CheckBoxTree[11].Item.FCreate(ATreeView.Handle);
CheckBoxTree[11].Item.Text(''); //Child 1
CheckBoxTree[11].Btn.FCreate(CheckBoxTree[11].Item.Handle, True, 'Child 1');
CheckBoxTree[11].Btn.SetBounds(20, 0, 180, 20);
CheckBoxTree[11].Btn.GroupName('Parent 1');
CheckBoxTree[12].Item.FCreate(ATreeView.Handle);
CheckBoxTree[12].Item.Text(''); //Child 2
CheckBoxTree[12].Btn.FCreate(CheckBoxTree[12].Item.Handle, False, 'Child 2');
CheckBoxTree[12].Btn.SetBounds(20, 0, 180, 20);
CheckBoxTree[12].Btn.GroupName('Parent 1');
CheckBoxTree[13].Item.FCreate(ATreeView.Handle);
CheckBoxTree[13].Item.Text(''); //Child 1
CheckBoxTree[13].Btn.FCreate(CheckBoxTree[13].Item.Handle, False, 'Child 1');
CheckBoxTree[13].Btn.SetBounds(20, 0, 180, 20);
CheckBoxTree[13].Btn.GroupName('Parent 2');
CheckBoxTree[14].Item.FCreate(ATreeView.Handle);
CheckBoxTree[14].Item.Text(''); //Child 2
CheckBoxTree[14].Btn.FCreate(CheckBoxTree[14].Item.Handle, True, 'Child 2');
CheckBoxTree[14].Btn.SetBounds(20, 0, 180, 20);
CheckBoxTree[14].Btn.GroupName('Parent 2');
// AddRoot
ATreeView.AddItem(CheckBoxTree[1].Item.Handle);
ATreeView.AddItem(CheckBoxTree[2].Item.Handle);
// AddParent
CheckBoxTree[1].Item.AddItem(CheckBoxTree[3].Item.Handle);
CheckBoxTree[1].Item.AddItem(CheckBoxTree[4].Item.Handle);
CheckBoxTree[2].Item.AddItem(CheckBoxTree[5].Item.Handle);
CheckBoxTree[2].Item.AddItem(CheckBoxTree[6].Item.Handle);
// AddChild
CheckBoxTree[3].Item.AddItem(CheckBoxTree[7].Item.Handle);
CheckBoxTree[3].Item.AddItem(CheckBoxTree[8].Item.Handle);
CheckBoxTree[4].Item.AddItem(CheckBoxTree[9].Item.Handle);
CheckBoxTree[4].Item.AddItem(CheckBoxTree[10].Item.Handle);
// AddChild 2
CheckBoxTree[5].Item.AddItem(CheckBoxTree[11].Item.Handle);
CheckBoxTree[5].Item.AddItem(CheckBoxTree[12].Item.Handle);
CheckBoxTree[6].Item.AddItem(CheckBoxTree[13].Item.Handle);
CheckBoxTree[6].Item.AddItem(CheckBoxTree[14].Item.Handle);
ATreeView.ExpandAll;
end;