Old 8th October 2007, 15:00   #1
RaoulOz
Junior Member
 
Join Date: Oct 2007
Posts: 2
Change Section on another section selection

Hi,

I have a question regarding sections, I have one group with two section in it:

Group
|_Section1
|_Section2

Both sections are optional but I would like to change Section2 as a ReadOnly and Selected when Section1 is clicked.
Also when Section1 is deselected, Section2 should go back to its initial state.

Is it possible?

Thanks for your help

Last edited by RaoulOz; 8th October 2007 at 16:18.
RaoulOz is offline   Reply With Quote
Old 8th October 2007, 19:14   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Implement this logic in .onSelChange. This callback function is called whenever the user changes his selection in the components page. So in there you can check if Section1 is selected. If it is, set Section2 as selected and read-only. You can use the macros from Sections.nsh to do that. Namely, look at SelectSection, SetSectionFlag and SF_RO. You can also use the LogicLib to determine if the section is selected - ${If} ${SectionIsSelected} ${section_idx}.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 9th October 2007, 13:43   #3
RaoulOz
Junior Member
 
Join Date: Oct 2007
Posts: 2
Thank you kichik.
It's what I tried but faced problems, when selecting I couldn't deselct, sometimes I couldn't select at all...
So I changed how I will handle it and just hide the necessary section and install the stuff from that section if the other one is selected.
RaoulOz 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