NSIS 许可证页面上的两个复选框 [英] Two checkboxes on a NSIS license page

查看:83
本文介绍了NSIS 许可证页面上的两个复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行此处 但由于语法的复杂性和时间不足,我需要有人帮助我解决这个问题.

I am trying to do pretty much what is being asked here but due to the complexity of the syntax and shortage of time, I need someone to help me out on this.

我花了几个小时试图显示两个复选框而不是一个,但我一直失败.NSIS 语法正在杀死我,我似乎无法将参数设置为第二个 USER32::CreateWindowEx 正确.我想显示第一个复选框下方(或右侧)的第二个复选框.

I have spent a couple of hours try to get TWO checkboxes shown instead of one but I keep failing. The NSIS syntax is killing me and I can't seem to get the params to the second USER32::CreateWindowEx right. I want to display the second checkbox below (or to the right) of the first one.

到目前为止,我已经完成了以下修改,但这似乎并没有创建第二个复选框(有关其余代码,请参阅原始帖子).

So far I have done the following modifications but this doesn't seem to create the second checkbox (please see the original post for the rest of the code).

; ---<snip>---
System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Some option",i ${__NSD_CheckBox_STYLE},ir6,ir7,ir8,ir9,ir0,i666,i0,i0)i.r2'
System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Second option",i ${__NSD_CheckBox_STYLE},ir6+100,ir7,ir8,ir9,ir0,i667,i0,i0)i.r3'
SendMessage $0 ${WM_GETFONT} 0 0 $0
SendMessage $2 ${WM_SETFONT} $0 1
SendMessage $3 ${WM_SETFONT} $0 1
${NSD_SetState} $2 1 ;check it
${NSD_SetState} $3 1 ;check it
FunctionEnd

Function licleave
FindWindow $5 "#32770" "" $HWNDPARENT
GetDlgItem $0 $5 666
GetDlgItem $1 $5 667
${NSD_GetState} $0 $0
${NSD_GetState} $1 $1
MessageBox mb_ok "Checkbox=$0 $1"
FunctionEnd

推荐答案

You cannot do math like ir6+100 in a system::call (You can only OR simple numbers), try IntOp $6 $6 + 100 在创建第二个复选框之前.

You cannot do math like ir6+100 in a system::call (You can only OR simple numbers), try IntOp $6 $6 + 100 before you create the second checkbox.

其他答案中的代码也为复选框提供了与对话框相同的宽度,因此添加到它右侧的任何其他控件都将显示在其后面.

The code from the other answer also gave the checkbox the same width as the dialog so any other control added to the right of it will appear behind it.

您还必须调整第一个复选框的大小:

You must adjust the size of the first checkbox as well:

...
IntOp $8 $8 / 2 ; Use half the width
System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Some option",i ${__NSD_CheckBox_STYLE},ir6,ir7,ir8,ir9,ir0,i666,i0,i0)i.r2'
IntOp $6 $6 + $8 ; Offset 2nd checkbox by the width of the first
System::Call 'USER32::CreateWindowEx(i0,t "Button",t "Other option",i ${__NSD_CheckBox_STYLE},ir6,ir7,ir8,ir9,ir0,i667,i0,i0)i.r3'
...

这篇关于NSIS 许可证页面上的两个复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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