inno-setup

Larger "Select Components" page in Inno Setup


I have been trying for a while to make the "Select Components" page larger as in the picture below, including the components inner-window (the white one), because I have many components ... and it gets easier to select when it is larger window. If anyone could tell if that's even possible, please give me a hint or point me in a direction.

enter image description here

Thankfully, BeGiN


Solution

  • Based on your original script I made the following changes. For storing original positions (top and height values) I have used an array of integers and made two general procedures for storing the current positions and for restoring them.

    The restoring procedure has the HeightOffset parameter, where you can specify the value, by which all the values from the input array of integers will be increased before they are passed to the wizard form component properties. Except that, I've declared a separate flag indicating that wizard form has modified size.

    I used all of this because it improves readability of the script and it's easily extendable for other pages:

    [Code]
    
    type
      TPositionStorage = array of Integer;
    
    var
      CompPageModified: Boolean;
      CompPagePositions: TPositionStorage;
    
    procedure SaveComponentsPage(out Storage: TPositionStorage);
    begin
      SetArrayLength(Storage, 10);
    
      Storage[0] := WizardForm.Height;
      Storage[1] := WizardForm.NextButton.Top;
      Storage[2] := WizardForm.BackButton.Top;
      Storage[3] := WizardForm.CancelButton.Top;
      Storage[4] := WizardForm.ComponentsList.Height;
      Storage[5] := WizardForm.OuterNotebook.Height;
      Storage[6] := WizardForm.InnerNotebook.Height;
      Storage[7] := WizardForm.Bevel.Top;
      Storage[8] := WizardForm.BeveledLabel.Top;
      Storage[9] := WizardForm.ComponentsDiskSpaceLabel.Top;
    end;
    
    procedure LoadComponentsPage(const Storage: TPositionStorage;
      HeightOffset: Integer);
    begin
      if GetArrayLength(Storage) <> 10 then
        RaiseException('Invalid storage array length.');
    
      WizardForm.Height := Storage[0] + HeightOffset;
      WizardForm.NextButton.Top := Storage[1] + HeightOffset;
      WizardForm.BackButton.Top := Storage[2] + HeightOffset;
      WizardForm.CancelButton.Top := Storage[3] + HeightOffset;
      WizardForm.ComponentsList.Height := Storage[4] + HeightOffset;
      WizardForm.OuterNotebook.Height := Storage[5] + HeightOffset;
      WizardForm.InnerNotebook.Height := Storage[6] + HeightOffset;
      WizardForm.Bevel.Top := Storage[7] + HeightOffset;
      WizardForm.BeveledLabel.Top := Storage[8] + HeightOffset;
      WizardForm.ComponentsDiskSpaceLabel.Top := Storage[9] + HeightOffset;
    end;
    
    procedure InitializeWizard;
    begin
      CompPageModified := False;
    end;
     
    procedure CurPageChanged(CurPageID: Integer);
    begin
      if CurpageID = wpSelectComponents then
      begin
        SaveComponentsPage(CompPagePositions);
        LoadComponentsPage(CompPagePositions, ScaleY(200));
        CompPageModified := True;
      end
      else
      if CompPageModified then
      begin
        LoadComponentsPage(CompPagePositions, 0);
        CompPageModified := False;
      end;
    end;