Old 22nd June 2006, 08:05   #1
BioDuo
Junior Member
 
Join Date: Jun 2005
Posts: 21
NSIS Bug (RadioButton problem)

I pointed this problem out earlier, only I didn't get any reply so I post my script..

code:
!include "Sections.nsh"

;--------------------------------

Name "One Section"
OutFile "one-section.exe"

;--------------------------------

; Pages

Page components

;--------------------------------

; Sections

Section !Required
SectionIn RO
SectionEnd

SectionGroup /e "SectionGroup Test RadioButton"

Section "Group 1 - Option 1" g1o1
SectionEnd

Section /o "Group 1 - Option 2" g1o2
SectionEnd

Section /o "Group 1 - Option 3" g1o3
SectionEnd
SectionGroupEnd


Function .onInit

StrCpy $1 ${g1o1} ; Group 1 - Option 1 is selected by default

FunctionEnd

Function .onSelChange

!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${g1o1}
!insertmacro RadioButton ${g1o2}
!insertmacro RadioButton ${g1o3}
!insertmacro EndRadioButtons

FunctionEnd



When you click 'SectionGroup Test RadioButton' both Option 1 and 2 jumps on, another click and Option 2 and Option 3 jumps on, is there a way to fix this?
BioDuo is offline   Reply With Quote
Old 22nd June 2006, 11:32   #2
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
What are you want to do when SectionGroup will be clicked?
glory_man is offline   Reply With Quote
Old 22nd June 2006, 12:55   #3
BioDuo
Junior Member
 
Join Date: Jun 2005
Posts: 21
Nothing, atleast not selecting 2 out of 3 radiobuttons
BioDuo is offline   Reply With Quote
Old 22nd June 2006, 16:14   #4
glory_man
Senior Member
 
Join Date: Sep 2004
Location: Mogilev (Belarus)
Posts: 372
This is not a bug, this is problem of RadioButton macros. Try this code.
code:

!include "LogicLib.nsh"
...
SectionGroup /e "SectionGroup Test RadioButton" sg1
...
Function .onSelChange

${If} ${SectionIsSelected} ${sg1}
!insertmacro UnSelectSection ${sg1}
!insertmacro SelectSection $1
${Else}
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${g1o1}
!insertmacro RadioButton ${g1o2}
!insertmacro RadioButton ${g1o3}
!insertmacro EndRadioButtons
${EndIf}

FunctionEnd

glory_man 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