View Single Post
  #4  
Old 05-01-2023, 18:39
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
@César

Code:
[ProgressBarSI]
//Width=0                         // integer               (Default = SmallInstaller >> Width - 30)
Could you change this to "Default = SmallInstaller TextWidth"? This is the case with [ProgressBar], where this is correct in my opinion.
I think it's already like this, see:
Code:
  SIProgressGauge := TNewProgressBar.Create(WizardForm);
  with SIProgressGauge do begin
    Parent := WizardForm;
    Left := GetValInt('ProgressBarSI', 'Left', GetValInt('SmallInstaller', 'TextLeft', 15)) + GetValInt('ProgressBarSI', 'MoveX', 0);
    if SIProgressVertical then
    begin
      Top := GetValInt('ProgressBarSI', 'Top', GetValInt('SmallInstaller', 'TextTop', 15)) + GetValInt('ProgressBarSI', 'MoveY', 0);
      Width := GetValInt('ProgressBar' + IfThen(IsSectionEmpty('ProgressBarSI'), '', 'SI'), 'Width', 14);
      Height := GetValInt('ProgressBarSI', 'Height', GetValInt('SmallInstaller', 'TextHeight', GetValInt('SmallInstaller', 'Height', 220) - 30));
      SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) or PBS_VERTICAL);
      SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_FRAMECHANGED or SWP_NOZORDER or SWP_NOSIZE or SWP_NOMOVE);
    end else
    begin
      Top := GetValInt('ProgressBarSI', 'Top', GetValInt('SmallInstaller', 'TextTop', 15) + 65) + GetValInt('ProgressBarSI', 'MoveY', 0);
      Width := GetValInt('ProgressBarSI', 'Width', GetValInt('SmallInstaller', 'TextWidth', GetValInt('SmallInstaller', 'Width', 500) - 30));
      Height := GetValInt('ProgressBar' + IfThen(IsSectionEmpty('ProgressBarSI'), '', 'SI'), 'Height', 14);
    end;
    Min := 0;
    Max := 1000;
    Position := 0;
    if CustomCursor then
      OldCursor := SetClassLong(Handle, GCL_HCURSOR, NewCursor);
    Visible := False;
  end;
Code:
Width := GetValInt('ProgressBarSI', 'Width', GetValInt('SmallInstaller', 'TextWidth', GetValInt('SmallInstaller', 'Width', 500) - 30));

GetValInt('SmallInstaller', 'Width', 500) - 30
This will only be used if [SmallInstaller] TextWidth= does not exist.
If the key Width does not exist it will be 500.

Default To ProgressBarSI WIDTH === read ini:  ProgressBarSI/Width << SmallInstaller/TextWidth  << SmallInstaller/Width-30 << 500-30

Last edited by Cesar82; 05-01-2023 at 18:41.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
KaktoR (06-01-2023)