I am getting blank tree view for my Start menu folder browser form, I created using TStartMenuFolderTreeView
.
I the problem that I do not call the TStartMenuFolderTreeView.SetPaths
?
Here is the Inno Setup code:
[Code]
var
Form2: TSetupForm;
GFLabel1: TLabel;
GFButton1, GFButton2: TButton;
gEdit: TEdit;
GroupTreeView: TStartMenuFolderTreeView;
procedure Button1Click (Sender: TObject);
begin
Form2.Close
WizardForm.Enabled:=True;
WizardForm.GroupEdit.Text:=gEdit.Text;
end;
procedure Button2Click (Sender: TObject);
begin
Form2.Close
WizardForm.Enabled:=True;
end;
procedure EditOnChange(Sender:Tobject);
begin
gEdit.Text:=AddBackSlash(GroupTreeView.Directory) + '{#GroupName}';
end;
procedure Close (Sender:Tobject; var Action: TCloseAction);
begin
Form2.close
WizardForm.Enabled:=True;
end;
procedure GroupButtonClick(Sender:Tobject);
begin
Form2:=CreateCustomForm;
with Form2 do
begin
Width:=470;
Height:=296;
Position:=poScreenCenter;
CenterInsideControl(WizardForm, False);
Caption:='Browse For Folder';
OnClose:=@Close;
end;
GFLabel1:=TLabel.Create(Form2);
with GFLabel1 do
begin
Parent:=Form2;
SetBounds(5,5,100,10)
Caption:='Select a folder in list below, Then click OK.';
end;
GFButton1:=TButton.Create(Form2);
with GFButton1 do
begin
Parent:=Form2;
SetBounds(285,22,80,25)
Caption:='OK';
OnClick:=@Button1Click;
end;
GFButton2:=TButton.Create(Form2);
with GFButton2 do
begin
Parent:=Form2;
SetBounds(370,22,80,25)
Caption:='Cancel';
OnClick:=@Button2Click;
end;
gEdit:=TEdit.Create(Form2);
with gEdit do
begin
Parent:=Form2;
SetBounds(5,25,275,15)
Text:=WizardForm.GroupEdit.Text;
OnChange:=@EditOnChange;
end;
GroupTreeView:=TStartMenuFolderTreeView.Create(Form2);
with GroupTreeView do
begin
Parent:=Form2;
SetBounds(5,53,445,205)
OnChange:=@EditOnChange;
end;
GroupTreeView.ChangeDirectory(AddBackslash(WizardForm.GroupEdit.Text), true);
gEdit.Text:=AddBackslash(GroupTreeView.Directory);
Form2.Show;
WizardForm.Enabled:=false;
end;
procedure InitializeWizard();
begin
with WizardForm.GroupBrowseButton do
begin
OnClick:=@GroupButtonClick;
end;
end;