Old 21st January 2008, 05:54   #1
lovespy108
Member
 
Join Date: Sep 2007
Posts: 63
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!!!!
lovespy108 is offline   Reply With Quote
Old 21st January 2008, 06:03   #2
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Copied from IO documentation,
Quote:
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 21st January 2008, 07:50   #3
lovespy108
Member
 
Join Date: Sep 2007
Posts: 63
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?
lovespy108 is offline   Reply With Quote
Old 21st January 2008, 08:13   #4
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 21st January 2008, 08:37   #5
lovespy108
Member
 
Join Date: Sep 2007
Posts: 63
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 ""
lovespy108 is offline   Reply With Quote
Old 21st January 2008, 08:46   #6
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
StrCpy $value "" is the right method.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump