2

I'm trying to create a custom component window. So far i have found some code here on stackoverflow that lets me set the outerwindow height of the components window. The problem i have is that the actual component selection box doesnt grow with it, like i have a big window but still a small component selection box.

Picture of my problem:

enter image description here

Hope someone can help me with this.

The code i have is this

var
  DefaultTop, 
  DefaultLeft, 
  DefaultHeight,
  DefaultBackTop, 
  DefaultNextTop, 
  DefaultCancelTop,
  DefaultBevelTop, 
  DefaultOuterHeight: Integer;

const 
  LicenseHeight = 600;
  LicenseWidth = 600;

procedure InitializeWizard();
begin
  DefaultTop := WizardForm.Top;
  DefaultLeft := WizardForm.Left;
  DefaultHeight := WizardForm.Height;
  DefaultBackTop := WizardForm.BackButton.Top;
  DefaultNextTop := WizardForm.NextButton.Top;
  DefaultCancelTop := WizardForm.CancelButton.Top;
  DefaultBevelTop := WizardForm.Bevel.Top;    
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpSelectComponents then
  begin
    WizardForm.Top := DefaultTop - (LicenseHeight - DefaultHeight) div 2;
    WizardForm.Height := LicenseHeight;
    WizardForm.Width := LicenceWidth;
    WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (LicenseHeight - DefaultHeight);
    WizardForm.CancelButton.Top := DefaultCancelTop + (LicenseHeight - DefaultHeight);
    WizardForm.NextButton.Top := DefaultNextTop + (LicenseHeight - DefaultHeight);
    WizardForm.BackButton.Top := DefaultBackTop + (LicenseHeight - DefaultHeight);
    WizardForm.Bevel.Top := DefaultBevelTop + (LicenseHeight - DefaultHeight);
  end
  else 
  begin
    WizardForm.Top := DefaultTop;
    WizardForm.Left := DefaultLeft;
    WizardForm.Height := DefaultHeight;
    WizardForm.OuterNotebook.Height := DefaultOuterHeight;
    WizardForm.CancelButton.Top := DefaultCancelTop;
    WizardForm.NextButton.Top := DefaultNextTop;
    WizardForm.BackButton.Top := DefaultBackTop;
    WizardForm.Bevel.Top := DefaultBevelTop;
  end;
end;
TLama
  • 75,147
  • 17
  • 214
  • 392
  • I think i'm missing the innerbox controls like "WizardForm.Height" for the height. I can't find the one that controls the inner box of the component menu. – user3702212 Jun 03 '14 at 08:37
  • Sorry, but I think I don't understand. By that inner box you mean client part of the window (or control) ? If so, then there are [`ClientWidth`](http://docwiki.embarcadero.com/Libraries/XE6/en/Vcl.Controls.TControl.ClientWidth) and [`ClientHeight`](http://docwiki.embarcadero.com/Libraries/XE6/en/Vcl.Controls.TControl.ClientHeight) properties available. – TLama Jun 03 '14 at 08:59
  • picture of my problem http://nl.tinypic.com/view.php?pic=fng3fs&s=8#.U42OdPl_v_E like my outer window is big but the selection thing is still small – user3702212 Jun 03 '14 at 09:00
  • That is exactly what i wanted, how would i go about modifying the width with your script? – user3702212 Jun 03 '14 at 09:22
  • I see. Uhm, well, that's quite a lot of shuffling. For vertical direction I [`wrote this`](http://stackoverflow.com/a/20587788/960757) some time ago. You can extend that script even for horizontal direction. Inno Setup Pascal Script doesn't publish `Anchors` property so you must do all this stuff manually. Pity. It could save a lot of work. – TLama Jun 03 '14 at 09:22
  • see my reply above, dor some reason my reply got put above yours. EDIT: Thanks anyway i should be able to incorperate the width myself with the example you gave me thanks many times. – user3702212 Jun 03 '14 at 09:24

0 Answers0