Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   NSIS Bug (RadioButton problem) (http://forums.winamp.com/showthread.php?t=249332)

BioDuo 22nd June 2006 08:05

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?

glory_man 22nd June 2006 11:32

What are you want to do when SectionGroup will be clicked?

BioDuo 22nd June 2006 12:55

Nothing, atleast not selecting 2 out of 3 radiobuttons :p

glory_man 22nd June 2006 16:14

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



All times are GMT. The time now is 17:56.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.