Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno setup WordWrap and Autosize

Tags:

inno-setup

I'm creating a setup using Inno Setup, and I changed license page to not show license, but to link to it instead. I also added a StaticText to show some text, and the problem is that when I add too much text, I need WordWrap := true, and AutoSize := false, and this makes StaticText width in Setup created really small. Why it is sized if AutoSize = false? What to do to prevent it from minimizing when WordWrap = true. Change parent?

procedure InitializeWizard;
var  
 FormButton: TNewButton;
 Page: TWizardPage;
 ComboBox: TNewComboBox;
begin
  WizardForm.LicenseAcceptedRadio.Hide;
  WizardForm.LicenseNotAcceptedRadio.Hide;
  LicenseContextText := TNewStaticText.Create(WizardForm.InnerPage);
  with LicenseContextText do
  begin
    Parent := WizardForm.InnerPage;
    //TODO: check if we need 
    Left   := ScaleX(250);
    Top    := ScaleY(50);
    Height := ScaleY(100);
    Width  := ScaleX(1000); //200;
    //Color := clBlack;
    Font.Color := clGray;
    //WordWrap := true;
    //AutoSize := false;
    Caption := 'Some content text, Some content text, Some content text';// 
    Visible := false;
  end;
  LicenseLinkLabel := TNewStaticText.Create(WizardForm.InnerPage);
  with LicenseLinkLabel do
  begin
    Parent := WizardForm.InnerPage;
    //TODO: check if we need 
    Left := 340;
    Top := 240;
    Height := 100;
    Cursor := crHand;
    Font.Color := clBlue;
    Font.Style := [fsUnderline];
    Caption := 'the License Agreement';
    OnClick := @LicenseLinkLabelClick;
    Visible := false;
  end;
  LicenseLinkURL := TNewCheckBox.Create(WizardForm.InnerPage);
  with LicenseLinkURL do
  begin
    Parent := WizardForm.InnerPage;
    Left := 277;
    Top := 238;
    Width := 60;
    Caption := ' I accept';
    OnClick := @OnLicenseCheckBoxClick;
    Visible := false;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
 if (CurPageID = wpLicense) then
 begin
     WizardForm.Bevel1.Visible := false;
     WizardForm.MainPanel.Visible := false;
     WizardForm.InnerNotebook.Visible := false;
     LicenseLinkLabel.Visible := true;
     LicenseLinkURL.Visible := true;
     LicenseContextText.Visible := true;
like image 879
mishander Avatar asked Oct 29 '25 12:10

mishander


1 Answers

Set the AutoSize and WordWrap properties before you set the Width and Height properties.

This is unrelated, but also rather than hard-coding specific values for the sizes you might want to consider using sizes relative to existing elements in the WizardForm, to eg. have it automatically fit to the width of the page area within the form.

like image 95
Miral Avatar answered Oct 31 '25 11:10

Miral



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!