Inno Setup - Alter PageNameLabel / PageDescriptionLabel font parameters (colour, size)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Inno Setup - Alter PageNameLabel / PageDescriptionLabel font parameters (colour, size)



So I got this in my .iss file:


[Files]
Source: "WizModernImageTop2.bmp"; Flags: dontcopy

[Code]

function CloneStaticTextToLabel(StaticText: TNewStaticText): TLabel;
begin
Result := TLabel.Create(WizardForm);
Result.Parent := StaticText.Parent;
Result.Left := StaticText.Left;
Result.Top := StaticText.Top;
Result.Width := StaticText.Width;
Result.Height := StaticText.Height;
Result.AutoSize := StaticText.AutoSize;
Result.ShowAccelChar := StaticText.ShowAccelChar;
Result.WordWrap := StaticText.WordWrap;
Result.Font := StaticText.Font;
StaticText.Visible := False;
WizardForm.PageDescriptionLabel.Font.Color := clRed;
WizardForm.PageNameLabel.Font.Color := clRed;
end;

var
PageDescriptionLabel: TLabel;
PageNameLabel: TLabel;

procedure InitializeWizard;
var
BitmapImage: TBitmapImage;
begin
ExtractTemporaryFile('WizModernImageTop2.bmp');
BitmapImage := TBitmapImage.Create(WizardForm);
BitmapImage.Parent := WizardForm.MainPanel;
BitmapImage.Width := WizardForm.MainPanel.Width;
BitmapImage.Height := WizardForm.MainPanel.Height;
BitmapImage.Stretch := True;
BitmapImage.AutoSize := False;
BitmapImage.Bitmap.LoadFromFile(ExpandConstant('tmpWizModernImageTop2.bmp'));
WizardForm.WizardSmallBitmapImage.Visible := True;
WizardForm.PageDescriptionLabel.Visible := True;
WizardForm.PageNameLabel.Visible := True;


Create TLabel equivalent of standard TNewStaticText components
PageNameLabel := CloneStaticTextToLabel(WizardForm.PageNameLabel);
PageDescriptionLabel := CloneStaticTextToLabel(WizardForm.PageDescriptionLabel);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
Update the custom TLabel components from the standard hidden components
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
end;



What I want to achieve:



Change colour/size (where needed) of PageNameLabel and PageDescriptionLabel to white so to become visible. Right now its black on black. I don't know the font parameters for the WizardForm elements, eh...



UPDATE: If anyone is wiling to use an image in his installer instead displaying the small WizardSmallImage icon to the right, use the provided code above, it makes it so labels are displayed on top of the image with transparency enabled. It requires Unicode version of Inno to work.





But PageDescriptionLabel and PageNameLabel are not transparent in the first place. So they will have gray background over your (supposedly) black image. I assume, you must be using this solution: Transparency under text in page name and description labels - but your question does not reflect that.
– Martin Prikryl
Aug 7 at 13:13



PageDescriptionLabel


PageNameLabel





Actually I am not using any other code than what I have linked in the OP and the text has transparent background: i.imgur.com/KUJ66hr.jpg Just an example image to see the transparency, what I would use is real image not just gradient.
– Janski
Aug 7 at 14:17





1 Answer
1



Use TNewStaticText.Font.Color to change a label color.


TNewStaticText.Font.Color


WizardForm.PageDescriptionLabel.Font.Color := clWhite;
WizardForm.PageNameLabel.Font.Color := clWhite;





Okay I tried adding these 2 lines: WizardForm.PageDescriptionLabel.Font.Color := clWhite; WizardForm.PageNameLabel.Font.Color := clWhite; Just under: WizardForm.PageNameLabel.Visible := True; and I see no change whatsoever.
– Janski
Aug 7 at 14:24






What version of Windows are you using?
– Martin Prikryl
Aug 7 at 14:31





I am using Windows 7 and the Windows Classic color scheme, I thought you maybe fell its XP. Just Win 7 64bits. I failed to mention I have the ANSI edition of Inno.
– Janski
Aug 7 at 14:44





If It run your code, with my addition (.Font.Color := clWhite) compiled with Inno Setup 5.6.1 (tested with both Ansi and Unicode with same results) and run the installer on Windows 7 with "Windows Classic" theme, loading a solid black image, I get this: i.stack.imgur.com/DcIGf.png - I.e. as expected, the label is not transparent and the white color is applied. For comparison with clRed: i.stack.imgur.com/9U80u.png
– Martin Prikryl
Aug 7 at 19:28


.Font.Color := clWhite


clRed





What gives? Images wont open (says deleted). What is the best solution you recommend then if it wont work for you, do this: Transparency under text in page name and description labels? I think I have tried it few times and only the image was displaying, not the labels then I went to look for better code and found what I currently have. I really wanna have that feature in this installer and maybe have a custom skin afterwards. Too bad Inno does not support WYSIWIG interface and its all code you can't know by yourself.
– Janski
Aug 7 at 21:37






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS