Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 05-03-2024, 11:21
Fak Eid Fak Eid is offline
Registered User
 
Join Date: Jun 2023
Location: Mars
Posts: 147
Thanks: 98
Thanked 152 Times in 54 Posts
Fak Eid is on a distinguished road
Auto Update Directory Space on Directory Edit

Code for Edit Box
Code:
  Page2Edit.FCreate(Page2.Handle);
  Page2Edit.SetBounds(NSSX(100), NSSY(190), NSSX(520), NSSY(35));
  Page2Edit.FontSetting('{#FontName}', VCLFontSizeToFMX2(13), ALGainsBoro);
  Page2Edit.CanFocus(True);
  Page2Edit.Enabled(True);
  Page2Edit.Text(MinimizePathName(WizardForm.DirEdit.Text, WizardForm.DirEdit.Font, WizardForm.DirEdit.Width));
  Page2Edit.OnTyping(@BrowseEditOnChange);

Logic for procedure
Code:
procedure BrowseEditOnChange(Sender: TObject);
var
  PrevDrive, CurrentDrive: String;
begin
  PrevDrive := ExtractFileDrive(WizardForm.DirEdit.Text);
  CurrentDrive := ExtractFileDrive(Page2Edit.GetText);

  // Set the installation path to the edited text value
  WizardForm.DirEdit.Text := Page2Edit.GetText;

  if PrevDrive <> CurrentDrive then
    DirUpdateProc(nil);
end;
Logic for Directory Update Procedure:
Code:
procedure DirUpdateProc(Sender: TObject);
begin
  DiskUsage.SetDir(WizardForm.DirEdit.Text);
  SelectDirLabel[3].Text('Total Space - ' + MbOrTb(DiskUsage.TotalSpace, 1) + #13 +
                         'Available Space - '+ MbOrTb(DiskUsage.FreeSpace, 1) + #13 +
                         'Repack Size - ' + MbOrTb({#RepackSize}, 1));
  if Round(DiskUsage.FreeSpace) > StrToInt('{#RequiredSpace}') then
  begin
    WizardBtn[4].Enabled(True);  //Install Button enabled if there is space
  end else
  begin
    WizardBtn[4].Enabled(False); //Install Button disabled if no space
    ShowMessage('Not Enough Space', 'Selected Directory does not have required space. Please select a different directory location.');
  end;
end;
Attached Images
File Type: gif Recording 2024-03-06 003906.gif (508.9 KB, 241 views)
Reply With Quote
The Following 8 Users Say Thank You to Fak Eid For This Useful Post:
ADMIRAL (07-03-2024), audiofeel (05-03-2024), Behnam2018 (05-03-2024), BLACKFIRE69 (05-03-2024), JIEXA MEDVED (18-03-2024), Lord.Freddy (05-03-2024), Tihiy_Don (06-03-2024), Wanterlude (13-07-2025)
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM BLACKFIRE69 Conversion Tutorials 0 15-11-2023 17:35
Windows Phone Installer similar to razor12911's original design? Kitsune1982 Conversion Tutorials 0 02-07-2020 13:04
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 13:25.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com