NSIS: 自定义页面中的返回、下一步和取消按钮被禁用

huangapple go评论52阅读模式
英文:

NSIS: back, next and cancel buttons are disabled in custom page

问题

以下是您要翻译的代码部分:

Function licensePage

  ${NSD_CreateLabel} 0 0u 100% 12u "请输入许可密钥"
  ${NSD_CreateText} 0% 20u 100% 12u ""
  Pop $licenseKey

  ${NSD_CreateLabel} 0 40u 100% 12u "请输入数据库密码"
  ${NSD_CreateText} 0% 60u 100% 12u ""
  Pop $dbPass
  
  nsDialogs::Show
FunctionEnd
英文:

I am trying to create a custom page with NSIS. but when I run the installer, all the buttons are in shadow and not working.

Function licensePage

  ${NSD_CreateLabel} 0 0u 100% 12u "Please enter license key"
  ${NSD_CreateText} 0% 20u 100% 12u ""
  Pop $licenseKey

  ${NSD_CreateLabel} 0 40u 100% 12u "Please enter database password"
  ${NSD_CreateText} 0% 60u 100% 12u ""
  Pop $dbPass
  
  nsDialogs::Show
FunctionEnd

the custom page is so basic.

答案1

得分: 0

你遗漏了创建调用。

Page custom nsDialogsPage
Page instfiles

Function nsDialogsPage
	nsDialogs::Create 1018
	Pop $0
	${If} $0 == error
		Abort
	${EndIf}

	${NSD_CreateLabel} 0 0 100% 12u "你好,欢迎使用nsDialogs!"
	Pop $0
	
	nsDialogs::Show

FunctionEnd
英文:

You are missing the Create call.

Page custom nsDialogsPage
Page instfiles

Function nsDialogsPage
	nsDialogs::Create 1018
	Pop $0
	${If} $0 == error
		Abort
	${EndIf}

	${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
	Pop $0
	
	nsDialogs::Show

FunctionEnd

答案2

得分: 0

To enable next button you have to add these lines

GetDlgItem $0 $HWNDPARENT 1 ; 1 is the ID of the Next button
EnableWindow $0 1
英文:

to enable next button you have to add these lines

GetDlgItem $0 $HWNDPARENT 1 ; 1 is the ID of the Next button
EnableWindow $0 1

huangapple
  • 本文由 发表于 2023年3月31日 03:26:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/75892239.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定