pengyou
27th August 2003 10:34 UTC
Confusing problem with one-section.nsi
The 'one-section.nsi' script allows 1 out of 4 sections to be selected. I have tried to modify the script to select 1 out of 2 sections. My modified script works OK if subsections are disabled but if subsections are enabled, the second section (optional #2) cannot be selected.
Have I made a mistake in my script?
I am using Win98SE with the 26 August CVS snapshot (according to the Changelog, no CVS changes have been made since 23 August, so I have the latest CVS).
pengyou
27th August 2003 13:30 UTC
If I change my script to select 1 out of 3 sections, it works properly when subsections are enabled.
It seems that when only 2 sections are available, the wrong section flags are being set. If there are 2 sections to choose from and "optional #1" is already selected, I have found that:
Clicking on "Choose one" sets the section flags as follows: 'subsec' = 35, 'sec1' = 1, 'sec2' = 1
Clicking on "optional #2" sets the section flags as follows: 'subsec' = 35 , 'sec1' = 1, 'sec2' = 1
When "optional #2" is clicked, the 'subsec' section flag should not be 35.
kichik
27th August 2003 14:00 UTC
Since clicking on the subsection and selecting the second section is the same thing you can simply remove the subsection check, it's useless.
pengyou
27th August 2003 16:33 UTC
Thanks for the suggestion Kichik. However it does not solve the problem completely.
Removing the subsection test does allow the other section to be selected. But double-clicking the subsection to collapse the tree now changes the selected section.
In the original 'one-section.nsi' script which uses 4 sections, if I click on "optional #2" to select it then double-click on "choose one" (to collapse the tree) and then click on the '+' sign to expand the tree, the "optional #2" section is still ticked.
In my script with only two sections and with the subsection test removed, if I select "optional #2" then double-click "choose one" (to collapse the tree) and then click on the '+' sign to expand the tree, the "optional #2" section is no longer ticked ("optional #1" is now ticked).
I still think there is a problem with the way the section flags are being updated when there are only two sections in a subsection.
kichik
27th August 2003 16:43 UTC
Double clicking on a subsection will always generate a one click event too. This event is treated as if the user selected the subsection. There is no way I can think of to tell if the user selected the second section or the subection when there are two sections.
pengyou
27th August 2003 18:21 UTC
Thanks for explaining this. It seems that using two sections in this way is not a good idea, so I will try something else.
TonyDS
27th August 2003 21:08 UTC
I got it to work with the help from pengyou to start with