pcrowley
23rd January 2008 16:35 UTC
Double cancel on custom page
I have a simple custom page with a cancel button on it. Clicking the cancel button prompts the user if they really want to abort, just like normal. Clicking Yes returns to the custom page. Clicking the Cancel button again again prompts and then finally cancels.
It is not getting into the Leave function for the page, I checked that. Very little customization has been done from a HMEdit-wizard created script.
There is a custom function for UserAbort which when removed drops all prompting - you still need to click cancel twice.
I've done a bunch of searching but I can't find anything about this.
Red Wine
23rd January 2008 17:21 UTC
Seems MUI_ABORTWARNING is defined, also seems you're checking the return value of the dialog.
pcrowley
23rd January 2008 19:48 UTC
Yes, but ....
I've gone through a couple of iterations of this.
There is a wizard-added UserAbort function that was referenced by MUI_CUSTOMFUNCTION_ABORT. What I have now is the following:
; MUI Settings
!define MUI_ABORTWARNING
;!define MUI_CUSTOMFUNCTION_ABORT "UserAbort"
I'm not checking any result from the custom page:
Function DisplayCustomerInformation
StrCpy $REGSERIAL ""
StrCpy $REGEMAIL ""
!insertmacro MUI_HEADER_TEXT "Customer Information" "Customer Information"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "CustomerRegistration.ini"
Push $9
InstallOptions::dialog "$PLUGINSDIR\CustomerRegistration.ini"
Pop $9 ; must pop this back off the stack, it contains the last button clicked
Return
FunctionEnd
I put in a MessageBox after the Pop at the end of this to just say "Hi there" and it comes out after the SECOND cancel.
pcrowley
23rd January 2008 20:19 UTC
Just a thought here
There is validation on this page with fields that must have content in them.
Could this be the problem?
Afrow UK
24th January 2008 12:58 UTC
Remove that Return call. Shouldn't make any difference but you don't need it nonetheless.
Stu