mamilo
5th January 2007 15:40 UTC
show/hide directory request
Hi,
I have developped a custom page where I can choose the install type with RadioButtons. When install-button is choosed the directory request muss be hide and when update-button is choosed the directory muss be showed. So far it is ok. But when I choose update and I go to the next page and I return to this custom page, the update-button is still checked but the directory request is hide!
I would like that it stays showed! How can I do that?. I have see an example in InstallOptions\testnotify. I have tried it but it doesn't work. I send a test file with the ini-file.
Any help is welcome!
Thanks,
mamilo
Red Wine
5th January 2007 15:52 UTC
Add code to the custom page show function that resets the desired controls to their default state, every time the page is reloaded. e.g.
function CustomCreate
push $R1
InstallOptions::InitDialog /NOUNLOAD '$PLUGINSDIR\custom.ini'
pop $R1
;disable next button every time page is reloaded
GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
InstallOptions::Show '$PLUGINSDIR\custom.ini'
pop $R1
pop $R1
functionend
mamilo
5th January 2007 16:22 UTC
Thanks for your help it is working!
mamilo
Red Wine
5th January 2007 17:03 UTC
You're welcome!
Just a notice. On a second look these push and pop are copied pasted from other example though they are not accurate.
If you want to preserve the value that possibly contains $R1 you should do it like this:
function CustomCreate
push $R1 ;park $R1 value to the stack
InstallOptions::InitDialog /NOUNLOAD '$PLUGINSDIR\custom.ini'
pop $R1
messagebox mb_ok 'Now $$R1 contains the dialog HWND == $R1'
GetDlgItem $R1 $HWNDPARENT 1
EnableWindow $R1 0
InstallOptions::Show '$PLUGINSDIR\custom.ini'
pop $R1
messagebox mb_ok 'Now $$R1 contains the pressed button == $R1'
pop $R1
messagebox mb_ok 'Now $$R1 contains the the path to custom.ini == $R1'
pop $R1
messagebox mb_ok 'Now $$R1 got back the value from stack == $R1'
functionend