在Inno Setup中按字体大小缩放单选按钮列表 [英] Scale radio button list with font size in Inno Setup

查看:29
本文介绍了在Inno Setup中按字体大小缩放单选按钮列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试通过单选按钮应用自定义安装掩码时(我使用了:

  [LangOptions]DialogFontSize = 20 

When trying to apply a custom installation mask with radio buttons (I used code provided in Replace installation types dropdown list by radio buttons) I see I am unable to use higher fonts as a little spacing should be needed between one radio button field and another one. To give you a visual example:

As default font size are not so easy to be read I wonder if there is a way of adding extra spacing between one radio button field and the next one.

解决方案

Checkboxes and Radio buttons created on runtime in Inno Setup do not scale their height automatically with a DPI/font size.

So you have to scale them programmatically.

...
RadioButton.Left := WizardForm.TypesCombo.Left; 
RadioButton.Height := ScaleY(RadioButton.Height);
RadioButton.Top := WizardForm.TypesCombo.Top + I * RadioButton.Height;
...

The ScaleY(RadioButton.Height) takes the default combobox/radiobutton height, which is designed for the default font and no display scaling (100%) and scales that to the custom font and actual display scaling.


Though note that using a non-default font-size for your application/setup is not a good idea. The user should choose a font size he/she is comfortable with in Windows preferences. You should not override his/her choice.


When changing the font size, do not modify the shared default.isl, use the [LangOptions] section of your project file instead:

[LangOptions]
DialogFontSize=20

这篇关于在Inno Setup中按字体大小缩放单选按钮列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆