NSIS:StateChanged 上的自定义页面
NSIS: Custom page on StateChanged
我有一些带有复选框的不同许可页面。如果未选中复选框,则应禁用 Next
按钮。如果复选框状态发生变化,是否有我可以使用的事件?这是我的代码之一
var Window
var labelDescription
var checkBoxIsUserAgree
Function CreateCustomLicense1
nsDialogs::Create 1018
Pop $Window
GetDlgItem [=10=] $HWNDPARENT
EnableWindow [=10=] 0
${NSD_CreateLabel} 13u 22u 270u 96u "Description"
Pop $labelDescription
${NSD_CreateCheckBox} 10u 110u 100u 15u "I Agree"
$checkBoxIsUserAgree
FunctionEnd
Function ShowCustomLicence1
Call CreateCustomLicense1
nsDialogs::Show
Function
Function .oncheckBoxIsUserAgreeStateChanged ; what event I can use for track checkbox state changing
EnableWindow [=10=] 1
FunctionEnd
内置的 NSIS 许可页面支持复选框,可以多次使用,但如果您坚持创建自定义页面,则只需添加一个 on* 处理程序:
!include nsDialogs.nsh
Var checkBoxIsUserAgree
Function ShowCustomLicence1
nsDialogs::Create 1018
Pop
GetDlgItem [=10=] $HWNDPARENT 1
EnableWindow [=10=] 0
${NSD_CreateLabel} 13u 22u 270u 90u "Description"
Pop
${NSD_CreateCheckBox} 10u 110u 100u 15u "I Agree"
Pop $checkBoxIsUserAgree
${NSD_OnClick} $checkBoxIsUserAgree oncheckBoxIsUserAgreeStateChanged1
nsDialogs::Show
FunctionEnd
Function oncheckBoxIsUserAgreeStateChanged1
Pop ; Throw away parameter
${NSD_GetState} $checkBoxIsUserAgree
EnableWindow [=10=]
FunctionEnd
Page Custom ShowCustomLicence1
Page InstFiles
我有一些带有复选框的不同许可页面。如果未选中复选框,则应禁用 Next
按钮。如果复选框状态发生变化,是否有我可以使用的事件?这是我的代码之一
var Window
var labelDescription
var checkBoxIsUserAgree
Function CreateCustomLicense1
nsDialogs::Create 1018
Pop $Window
GetDlgItem [=10=] $HWNDPARENT
EnableWindow [=10=] 0
${NSD_CreateLabel} 13u 22u 270u 96u "Description"
Pop $labelDescription
${NSD_CreateCheckBox} 10u 110u 100u 15u "I Agree"
$checkBoxIsUserAgree
FunctionEnd
Function ShowCustomLicence1
Call CreateCustomLicense1
nsDialogs::Show
Function
Function .oncheckBoxIsUserAgreeStateChanged ; what event I can use for track checkbox state changing
EnableWindow [=10=] 1
FunctionEnd
内置的 NSIS 许可页面支持复选框,可以多次使用,但如果您坚持创建自定义页面,则只需添加一个 on* 处理程序:
!include nsDialogs.nsh
Var checkBoxIsUserAgree
Function ShowCustomLicence1
nsDialogs::Create 1018
Pop
GetDlgItem [=10=] $HWNDPARENT 1
EnableWindow [=10=] 0
${NSD_CreateLabel} 13u 22u 270u 90u "Description"
Pop
${NSD_CreateCheckBox} 10u 110u 100u 15u "I Agree"
Pop $checkBoxIsUserAgree
${NSD_OnClick} $checkBoxIsUserAgree oncheckBoxIsUserAgreeStateChanged1
nsDialogs::Show
FunctionEnd
Function oncheckBoxIsUserAgreeStateChanged1
Pop ; Throw away parameter
${NSD_GetState} $checkBoxIsUserAgree
EnableWindow [=10=]
FunctionEnd
Page Custom ShowCustomLicence1
Page InstFiles