Old 28th November 2009, 19:23   #1
viragolion
Junior Member
 
Join Date: Nov 2009
Posts: 4
Section toggle

I would like to create two sections in my installer wich can't be selected together. I wan't them only to be i one of these states: both unselected. Only section A selected or only section B selected. Does someone have an example script for me?

thank you in advance!
viragolion is offline   Reply With Quote
Old 29th November 2009, 05:37   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
The google keyword is 'mutually exclusive sections'.
MSG is offline   Reply With Quote
Old 29th November 2009, 08:19   #3
viragolion
Junior Member
 
Join Date: Nov 2009
Posts: 4
Wonderfull google keyword. Was searching on a bunch of terms, but this hits the nail right on the spot!

Thank you very very much!!
viragolion is offline   Reply With Quote
Old 29th November 2009, 19:18   #4
viragolion
Junior Member
 
Join Date: Nov 2009
Posts: 4
still a little problem here, but i'm comming closer. When i add this to my script i can use it for two sections. How would a make it work for another two sections?

example:
A
B
C
D

I can choose either A or B or none of them AND
I can choose either C or D or none of them
AB and CD are independend from each other.

thx!
viragolion is offline   Reply With Quote
Old 30th November 2009, 03:51   #5
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Simply duplicate the code, and use a second variable to keep track of the second section group.
MSG is offline   Reply With Quote
Old 1st December 2009, 12:13   #6
viragolion
Junior Member
 
Join Date: Nov 2009
Posts: 4
Hi,

thank you for your guidance. I have it almost working. Problem is that selecting sectionB doesn't unselect sectionA anymore when one has selected sectionC or D
I have to manually unselect sectionA to be able to select sectionB again. Most likely something stupid i've done, but perhaps it's easily fixed. I've pasted my code below.

code:
Function .onSelChange
Push $0

StrCmp $R9 ${-secA} check_-secA

SectionGetFlags ${-secA} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${-secA}
SectionGetFlags ${-secB} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${-secB} $0

Goto done

check_-secA:

SectionGetFlags ${-secB} $0
IntOp $0 $0 & ${SF_SELECTED}
IntCmp $0 ${SF_SELECTED} 0 done done
StrCpy $R9 ${-secB}
SectionGetFlags ${-secA} $0
IntOp $0 $0 & ${SECTION_OFF}
SectionSetFlags ${-secA} $0
done:
Pop $0
Push $1
StrCmp $R9 ${-secC} check_-secC

SectionGetFlags ${-secC} $1
IntOp $1 $1 & ${SF_SELECTED}
IntCmp $1 ${SF_SELECTED} 0 done2 done2
StrCpy $R9 ${-secC}
SectionGetFlags ${-secD} $1
IntOp $1 $1 & ${SECTION_OFF}
SectionSetFlags ${-secD} $1

Goto done2

check_-secC:

SectionGetFlags ${-secD} $1
IntOp $1 $1 & ${SF_SELECTED}
IntCmp $1 ${SF_SELECTED} 0 done2 done2
StrCpy $R9 ${-secD}
SectionGetFlags ${-secC} $1
IntOp $1 $1 & ${SECTION_OFF}
SectionSetFlags ${-secC} $1

done2:
Pop $1
FunctionEnd



thank you,
Martin

Sorry, found my error.
I was using $R9 two times. Changed one instance to $R8 and working flawless now.

thank you!
viragolion 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