View Single Post
  #604  
Old 13-06-2013, 17:54
buttignol's Avatar
buttignol buttignol is offline
Registered User
 
Join Date: Sep 2012
Location: Brasil
Posts: 126
Thanks: 102
Thanked 16 Times in 13 Posts
buttignol is on a distinguished road
Thanks Razor12911 I tried many ways but failed error when compiling (Line 19 Identifier expected) inno setup 5.5.2 unicode

[Code]
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

function MbOrTb(Float: Extended): String;
begin
if Float < 1024 then Result:= NumToStr(Float)+' '+ 'MB'else
if Float/1024 < 1024 then Result:= NumToStr(Float/1024)+' '+'GB' else
Result:= NumToStr(Float/(1024*1024))+' '+'TB';
end;

procedure InitializeWizard3();
begin

procedure DirEditOnChange(Sender: TObject);
var
Path: String;
Page: TWizardPage;
lbl: TLabel;
FreeMB, TotalMB: Cardinal;
begin
Path := WizardForm.DirEdit.Text;
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
Page := PageFromID(wpSelectDir);

lbl := TLabel.Create(Page);
lbl.Width := ScaleX(105);
lbl.Height := ScaleY(43);
lbl.Caption := ExpandConstant('Espaço total do disco : ') + MbOrTb(TotalMB);
lbl.Left := 0;
lbl.Top := 155;
lbl.Parent := Page.Surface;

lbl := TLabel.Create(Page);
lbl.Width := ScaleX(75);
lbl.Height := ScaleY(23);
lbl.Caption := ExpandConstant('Espaço em disco disponível: ') + MbOrTb(FreeMB) + ' (' + IntToStr((FreeMB * 100) div TotalMB) + '%)';
lbl.Left := 0;
lbl.Top := 175;
lbl.Parent := Page.Surface;

lbl := TLabel.Create(Page);
lbl.Width := ScaleX(75);
lbl.Height := ScaleY(23);
lbl.Caption := ExpandConstant('Espaço do Game : ') + MbOrTb(24000);
lbl.Left := 0;
lbl.Top := 195;
lbl.Parent := Page.Surface;
end;

WizardForm.DirEdit.OnChange:= @DirEditOnChange;

procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
end;
Reply With Quote