Search code examples
inno-setuppascalscript

TLabel control is cropped on custom page when window is resized to smallest possible (on Inno Setup)


I have this TLabel defined on my custom page:

{ lblPromptMode (TLabel) }
lblPromptMode := TLabel.Create(pageAutoBackup);
lblPromptMode.Parent := pnlBackupMode;
lblPromptMode.Enabled := True;
lblPromptMode.Visible := True;
lblPromptMode.Top := radBackupModeManual.Top + radBackupModeManual.Height + ScaleY(10);
lblPromptMode.Width := pnlBackupMode.Width;
lblPromptMode.Font.Color := $000000;
lblPromptMode.Color := $F0F0F0;
lblPromptMode.Caption := ExpandConstant('{cm:lblPromptMode}');

I am now localizing the page and have a query that has come to light when puting in the Dutch translations.

When the window is display it actually looks fine (I am using the modern style setting in the script):

Modern Style

But if I resize the window to the smallest possible:

Resized Smallest

This control is now cropped as you can see. Can (and should) we address this in any way?


Solution

  • There's no easy way to solve this. While you can set the label to wrap, if it is too long (TLabel.WordWrap), you would have to reserve space for two lines on the dialog. That would would not look good with shorter translations, as it disconnects the label from the control.

    Implementing the page in a way that it would automatically expand the label to two lines, when needed only, is lot of work and not usual in classic Windows applications.

    I'd recommend you to:

    • shorten the text to fit the minimal window;
    • or increase the minimal windows size to fit the text (WizardForm.Constraints.MinWidth);
    • or split the text to a shorter label above the combo box, and add an additional details below the combo box to another label – possibly reserving space for two lines with wrapping, if you still needs them there – Unused free space below a control is ok, while above a control it's not.