Old 9th January 2006, 16:52   #1
karate_y2k
Junior Member
 
Join Date: Jan 2006
Posts: 4
Section Dependency Question

I'm looking for a way to have three co-dependent sections.
Here is an example:

Sec1
Sec2
Sec3
Sec4

Sec1 is required (I have this figured out).
What I need help with is handling the following:
Sec2 is optional. Sec3 and Sec 4 are independent of each other, but both require Sec2.
Possible Senarios (1, 1+2, 1+2+3, 1+2+4, 1+2+3+4)
Not Valid Senarios (1+3, 1+4, 1+3+4)

Hopefully this is clear.

Thanks for the help!
karate_y2k is offline   Reply With Quote
Old 9th January 2006, 17:28   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
So logically in .onSelChange check if Sec3 or Sec4 are checked, and if one of them are, then check Sec2 (if it isn't already checked, but a logic check for that shouldn't be necessary!) This should be very easy to implement.

Hang in there and I'll put it up on the Wiki for others to use.

-Stu
Afrow UK is offline   Reply With Quote
Old 9th January 2006, 18:08   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
http://nsis.sourceforge.net/Section_Dependency

-Stu
Afrow UK is offline   Reply With Quote
Old 9th January 2006, 18:43   #4
karate_y2k
Junior Member
 
Join Date: Jan 2006
Posts: 4
Thanks a lot! It works great.

Nit Picking...
It's not possible to deselect Sec2 unless Sec3 and Sec4 are unchecked. Is it possible to have it so deselecting Sec2 automatically deselects Sec3 and Sec4?

Thanks
karate_y2k is offline   Reply With Quote
Old 9th January 2006, 21:10   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I'll make up some new macros to do this that 'link' Sections together which you can use in conjunction with the existing macros.

Edit: I was unable to make it work properly because one set of macro's won't work with the other. I need to make it into one set of macro's which means that we will probably only be able to have one to one relationship Sections (e.g. only one Section is linked to another, not 2 Sections to 1), but I shall think about it.

-Stu

Last edited by Afrow UK; 9th January 2006 at 21:38.
Afrow UK is offline   Reply With Quote
Old 10th January 2006, 17:39   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I got it working but It wasn't possible putting it into a macro because it isn't dynamic enough that way (unless everyone only wants 2 sections dependent on 1 other).

You have to use it 'as-is' shown in the working script itself. If you need help using it let me know. The script SectionDependency.nsh header is no longer needed and you can delete it unless you are happy with the old script.

http://nsis.sourceforge.net/Section_Dependency

-Stu
Afrow UK is offline   Reply With Quote
Old 10th January 2006, 18:45   #7
karate_y2k
Junior Member
 
Join Date: Jan 2006
Posts: 4
That's EXACTLY what I needed. You are my official NSIS hero.
Thanks
karate_y2k 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