Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 30th August 2005, 01:26   #1
Rolando
Member
 
Join Date: Aug 2004
Location: Beirut, Lebanon
Posts: 50
Choosing 1 out of 3 sections

I need to allow a user to select only 1 out of 3 sections in the components page, and I don't want to use radiobuttons because they can't be unselected. So I'm hoping someone can help me make something somehow exactly like this only for 3 options and not only 2. I tried making my own but no luck. The three sections are ${addc} ${addcb} and ${adp}.

Thank you
Rolando is offline   Reply With Quote
Old 30th August 2005, 10:13   #2
Rolando
Member
 
Join Date: Aug 2004
Location: Beirut, Lebanon
Posts: 50
anyone ?
Rolando is offline   Reply With Quote
Old 30th August 2005, 18:37   #3
OJi
Guest
 
Posts: n/a
one-section.nsi in NSIS\examples should help.
is that what are you searching for ?

OJi.
  Reply With Quote
Old 30th August 2005, 21:09   #4
Rolando
Member
 
Join Date: Aug 2004
Location: Beirut, Lebanon
Posts: 50
Quote:
Originally posted by OJi
one-section.nsi in NSIS\examples should help.
is that what are you searching for ?

OJi.
Nope I'm not looking for radiobuttons... I already showed a link for a peice of code made by AfrowUK and what I'm looking for is the same thing but for 3 options not only 2.
Rolando is offline   Reply With Quote
Old 31st August 2005, 09:07   #5
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
Try this code:
code:

!define LOGICLIB_SECTIONCMP
!include LogicLib.nsh
...
Function .onInit
...
StrCpy $5 ${addc}
...
FunctionEnd
...
Function .onSelChange
${If} ${SectionIsSelected} ${addc}
${OrIf} ${SectionIsSelected} ${addcb}
${OrIf} ${SectionIsSelected} ${adp}
!insertmacro StartRadioButtons $5
!insertmacro RadioButton ${addc}
!insertmacro RadioButton ${addcb}
!insertmacro RadioButton ${adp}
!insertmacro EndRadioButtons
${EndIf}
FunctionEnd


Here Radiobutton script is activated only if one of sections was selected.
glory_man is offline   Reply With Quote
Old 31st August 2005, 10:09   #6
Rolando
Member
 
Join Date: Aug 2004
Location: Beirut, Lebanon
Posts: 50
but radiobuttons can't be unselected :S
Rolando is offline   Reply With Quote
Old 31st August 2005, 10:36   #7
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
This code allow you to unselect all sections. Try it.
glory_man is offline   Reply With Quote
Old 31st August 2005, 13:14   #8
Rolando
Member
 
Join Date: Aug 2004
Location: Beirut, Lebanon
Posts: 50
Quote:
Originally posted by glory_man
This code allow you to unselect all sections. Try it.
I didn't quite understand it's algorithim so sorry for being prejudgemental. It worked fine. Thanks
Rolando is offline   Reply With Quote
Old 31st August 2005, 13:37   #9
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
About algorithim - it's easy.
Radiobutton script allow you to choice only one of 3 sections. So $5-variable keep this (single) section id.
If you deselect this section you need to skeep radiobutton script (If - OrIf - OrIf statements) [$5 keep id of last selected section]. Next time you select section - radiobutton script activate again.
glory_man is offline   Reply With Quote
Reply
Go Back   Winamp 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