
15-11-2023, 08:02
|
 |
Registered User
|
|
Join Date: Oct 2019
Location: iran
Posts: 92
Thanks: 568
Thanked 40 Times in 34 Posts
|
|
Quote:
Originally Posted by BLACKFIRE69
@ADMIRAL,
after making a few changes to the code, you can make it work. however, if i'm correct, there're some aspects in the script that need further implementation. it would be better to ask the authors to complete the script.
Code:
Edit1:
* Replace the current 'ListBoxOnChange' code with this.
procedure ListBoxOnChange(Sender: TObject);
var
ADir: String;
begin
if (FMXListBox[2].GetItemIndex > -1) then
begin
ADir := FMXEdit[1].GetText;
StringChange(ADir, ExtractFileDrive(ADir), FMXListBox[2].GetItemText(FMXListBox[2].GetItemIndex));
FMXLabel[197].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
FMXEdit[1].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
WizardForm.DirEdit.Text:= ADir;
FMXDiskUsage.SetDir(WizardForm.DirEdit.Text);
FMXLabel[82].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1));
FMXLabel[85].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1) + ' is available from the selected drive');
FMXArc[5].Angle(FMXDiskUsage.FreeSpace, FMXDiskUsage.TotalSpace);
end;
end;
procedure ListBx3OnChange(Sender: TObject);
var
ADir: WideString;
begin
if FMXListBox[3].GetItemIndex > -1 then
begin
ADir:= ExtractFileDrive(FMXEdit[1].GetText) + '\' + AddBackslash(FMXListBox[3].GetItemText(FMXListBox[3].GetItemIndex)) + '{#MyAppName}';
FMXLabel[197].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
FMXEdit[1].Text(MinimizePathName(ADir, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
WizardForm.DirEdit.Text:= ADir;
FMXDiskUsage.SetDir(WizardForm.DirEdit.Text);
FMXLabel[82].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1));
FMXLabel[85].Text(MbOrTb(FMXDiskUsage.FreeSpace, 1) + ' is available from the selected drive');
FMXArc[5].Angle(FMXDiskUsage.FreeSpace, FMXDiskUsage.TotalSpace);
end;
end;
Code:
Edit2:
* Comment out the following line in the code.
//FMXEdit[1].OnChange(@ListBoxOnChange);
Code:
Edit3:
* Replace the ListBoxOnChange event with ListBx3OnChange for the FMXListBox[3].
FMXListBox[3].OnChange(@ListBx3OnChange);
.
|
Thank you for your quick reply, but even with the edit's codes, I am still facing the same problem. Are there any problems for you with these codes in the script?
__________________
Search and Find
|