![]() |
#1 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
![]()
Hello, Guys.
Sorry if such issue have already been discussed. Hope this will help me to get quick solution. 1. Have my own custom page. There are 2 checkboxes there and one depends on another. Everything is simple like a table. 2. If the FIRST one is checked the SECOND is active. If the FIRST is unchecked the second becomes enabled. 3. I save states of both checkboxes. And now the problem. If I press NEXT button and then on the following page at once button BACK window that should be disabled appears active again. The same is when I press BACK button on the sane custom page. Hope described clear ![]() Thank you. |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
At the page's leave function, save the state to a variable. Then in the page creation code, do something like:
${NSD_CreateCheckBox} ${If} $variable == 1 setstate 1 ${Else} setstate 0 ${EndIf} etc. |
![]() |
![]() |
![]() |
#3 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
Thank you for your answer.
Custom page is made via ini file, so impossible to make changes (I think) Also would be good to know how to make PRE and LEAVE functions for custom page. |
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You can add the NOTIFY flag to check boxes. To check/uncheck them you can use the nsDialogs macros. See the Install Options readme for getting their handles. Alternatively, just switch to nsDialogs
![]() Edit: pre and leave functions? If you've used Page Custom then you should know it has two parameters (show function and optional leave function). There is no need for a pre function as that is just the show function before calling a ::Show plug-in function. Stu |
![]() |
![]() |
![]() |
#5 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
Seems have to place my code here.
Actually it is simple by itself PHP Code:
|
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
As I said, use the macro from nsDialogs to check/uncheck dynamically.
Stu |
![]() |
![]() |
![]() |
#7 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
Solved the problem by modifying Function MyCustomPage
PHP Code:
|
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Just to explain why your previous code did not work; it was because you needed to place it between INITDIALOG and SHOW rather than before DISPLAY.
Edit: Also sorry for pointing you in the wrong direction (nsDialogs). When you said set the state that implied the check/unchecked state rather than the enabled/disabled state. Stu |
![]() |
![]() |
![]() |
#9 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
Thanks, Stu. Sorry haven't seen your last answer.
Unfortunately, the problem persists, as my method doesn't work correctly. Disabling checkbox (making it inactive) by WriteIniStr causes next time reading by MUI_INSTALLOPTIONS_DISPLAY a new ini file with actually disabled control (checkbox) and even activating it by EnableWindows does nothing since control doesn't receive notifications. So problem persists and I still need help. How to save checkboxes disabled states after quiting and then returning to the custom page? |
![]() |
![]() |
![]() |
#10 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You want to do both. Write to the INI file and set dynamically. To do it dynamically you have to use InitDialog and Show as I have said already.
Stu |
![]() |
![]() |
![]() |
#11 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
Thanks again, Stu.
Actually I've replaced MUI_INSTALLOPTIONS_DISPLAY with INSTALLOPTIONS_INITDIALOG and INSTALLOPTIONS_SHOW. But wat is the real difference? As I can see it is impossible to use the in the Page Custome leave function as it causes an error (or quitting installer). Also from many tests with code and direct change of ini file I don't see any way to change functionality of the control (checkbox in my case) in the Page Custom leave function. Am I wrong? If so please anybody show me how to do this. |
![]() |
![]() |
![]() |
#12 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You can change it between InitDialog and Show or in the Leave function. At both times the dialog is in memory. If your code is not working then you are doing something wrong. Perhaps you should just switch to nsDialogs!
Stu |
![]() |
![]() |
![]() |
#13 |
Member
Join Date: May 2008
Location: Ukraine
Posts: 93
|
SOLVED! Stu, thank you for your time and patience.
Inattention is the rock on which I've split. Inattention, guys ... 2 checkboxes. 1. If the first one is checked the second one could be checked or unchecked. 2. If the first checkbox unchecked the second is disabled. The states if checkboxes are saved when the is closed. Actually I have many checkboxes, but adapted it to 1 secondary checkbox. PHP Code:
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|