lovespy108
21st January 2008 05:54 UTC
How to capture the Back Event?
nsDialogs has OnBack Function to caputer back event.
How InstallOptions and the default UI of NSIS capture the back event?
(How NSIS know it will go back to the front page when the 'Back' button is clicked?)
I want to deal with that event.
Thanks for help!!!!:up: :up:
Red Wine
21st January 2008 06:03 UTC
Copied from IO documentation,
Return value
After a dialog is created (using display or show), a return value is available:
* success - The user has pressed the Next button
* back - The user has pressed the Back button
* cancel - The user has pressed the Cancel button
* error - An error has occurred, the dialog cannot be displayed.
You only have to check this value if you need something really special, such as doing something when the user pressed the Back button.
If you need the return value, use the INSTALLOPTIONS_DISPLAY_RETURN or INSTALLOPTIONS_SHOW_RETURN macro. The return value will be added to the stack, so you can use the Pop command to get it.
lovespy108
21st January 2008 07:50 UTC
Thank you.I solved the problem with your method.
***************************************
##[Field 1]is a RadioButton###
Before initializing dialog,I use the following way.After showing the dialog,the RadioButton is checked.
WriteINIStr installType.ini "Field 1" "State" 1
But If I use another way,the RadioButton is not checked.
StrCpy $Value 1
WriteINIStr installType.ini "Field 1" "State" $Value
What's the reason?
Red Wine
21st January 2008 08:13 UTC
Probably $value contains no supported string (either 1 for checked or 0 for no checked).
By the way it's not my method, it is the IO documentation which is a nice edition ;)
lovespy108
21st January 2008 08:37 UTC
It's my fault.
I defined $Value for the front page.
I want to use the $Value at the next page.Before using it,I want to empty $Value.
Is my method right?
Pop $Value
or
StrCpy $Value ""
Red Wine
21st January 2008 08:46 UTC
StrCpy $value "" is the right method.