-1

I have two @Martin Prikryl codes that I can't get them to work together.

  1. Larger "Select Components" page in Inno Setup
  2. Long descriptions on Inno Setup components

I followed all the instructions Martin said about the @TLama code, but the codes didn't work together.

Component captions do not appear when I activate the code to change the page height.

I would like a way to merge them and make them work together.

1 Answers1

0

I solved the problem by adding the page's custom height value to the CompLabel.Top of the component captions code.

I also had to change the procedure to CurPageChanged and created an <event( ' ' )> to merge the two codes and created a directive #define CustomPageHeight "ScaleY(200)" to define the custom height of the page.

                        // Set page height here
#define CustomPageHeight "ScaleY(200)"

[Code]

// Final part of code for component captions

Var StopCall: Boolean;
    <event('CurPageChanged')> // Added event here
Procedure CurPageChanged1(CurPageID: Integer);
Begin
  If StopCall = false Then
    Begin
      If CurPageID = wpWelcome Then
        Begin
          SetTimer(0, 0, 50, CreateCallback(@HoverTimerProc));

          CompLabel := TLabel.Create(WizardForm);
          CompLabel.Parent := WizardForm.SelectComponentsPage;
          CompLabel.Left := WizardForm.ComponentsList.Left;
          CompLabel.Width := WizardForm.ComponentsList.Width;
          CompLabel.Height := ScaleY(37);                                                   // Added here
          CompLabel.Top := WizardForm.ComponentsList.Top + WizardForm.ComponentsList.Height + {#CustomPageHeight} - CompLabel.Height;
          
          CompLabel.AutoSize := False;
          CompLabel.WordWrap := True;

          WizardForm.ComponentsList.Height := WizardForm.ComponentsList.Height - CompLabel.Height - ScaleY(2);
          StopCall := true;
        End;
    End;
End;

// Code for custom height page 

var
  CompPageModified: Boolean;
    <event('CurPageChanged')> // Added event here
procedure CurPageChanged2(CurPageID: Integer);
begin
  if CurpageID = wpSelectComponents then
  begin                                     // Changed here
    WizardForm.Height := WizardForm.Height + {#CustomPageHeight};
    CompPageModified := True;
  end
    else
  if CompPageModified then
  begin                                     // Changed here
    WizardForm.Height := WizardForm.Height - {#CustomPageHeight};
    CompPageModified := False;
  end;
end;