Old 18th May 2007, 17:45   #1
lore_flo
Junior Member
 
Join Date: May 2007
Posts: 6
Question how to determine which button is pressed?

How can I detect if the user has pressed the next / back / cancel button? can I change the actions executed ?

Thanks.
lore_flo is offline   Reply With Quote
Old 18th May 2007, 18:23   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
The page Leave function is only executed when the user clicks the Next button.

Stu
Afrow UK is offline   Reply With Quote
Old 21st May 2007, 13:29   #3
lore_flo
Junior Member
 
Join Date: May 2007
Posts: 6
Ok, and if the user click the back function? Or he selects cancel ? there are perhaps equivalent functions (next button --> leave Function, back --> start function (for example?))?
In my mask I have some mandatory fields. When the user clicks the next button, I test if the fields are empty: if so, using a Goto instruction, I return to the correspondent label, at the beginning of the function. But if the user clicks the "Back" or the "cancel" options, how to detect it?
if he choose "back" I would return to the previous page, if he choose cancel I woul abort the installation. thanks
lore_flo is offline   Reply With Quote
Old 21st May 2007, 14:17   #4
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
If the user clicks 'back', then then install will go back to the previous page (no additional programming necessary).

Assuming that your page is a custom page, you can (in your page's show function) pop a value off the stack to indicate which button was pressed. The value returned with be either "back", "success", "cancel" or "error". (See the InstallOptions docs for more info.)

In addition, if the user presses cancel, then the .onUserAbort function would be executed. If you call "abort" in that function, the cancel will be aborted. (This would be a way for you to intercept the user's cancel request, if desired.)
Comperio 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