Archive: Start Radio Buttons macro doesn't handle section groups.


Start Radio Buttons macro doesn't handle section groups.
Greetings everyone,

I have a clear answer now to the issue that became rather cluttered on this post:

http://forums.winamp.com/showthread....80#post2388180

But a less cluttered framing of the question would be:

What is the effect that a SectionGroup has on the Radiobutton macros..... used in this fashion:

!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${1notINgroup}
!insertmacro RadioButton ${2notINgroup}
!insertmacro RadioButton ${3InGroup}
!insertmacro RadioButton ${4InGroup}
!insertmacro RadioButton ${5InGroup}
!insertmacro EndRadioButtons

The simple state is that if the user clicks on the section group header in teh components page.... then ALL of the untis inside it will be marked as ON... and hence 3 will be on, but 4 will trump it, and 5 will trump 4.

The only way to fix this, is to do soemthing like this:

; presuming that 3InGroup,4InGroup,5InGroup is wrapped with
; a section group marker titled InGroup


!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${1notINgroup}
!insertmacro RadioButton ${2notINgroup}


; get flags for group section

SectionGetFlags ${InGroup} $TempRadioButtonFlagsVar
; test against 35 which is the setting for if a user
; clicked directly onto the section group header....
; the flags for the group header would be 98 if they had
; clicked on a sub option under the group...
; See the flags in the help index under SectionGetFlags

StrCmp $TempRadioButtonFlagsVar "35" 0 NextRadioButton
; if we drop in then we clear the group....
IntOp $TempRadioButtonFlagsVar $TempRadioButtonFlagsVar & ${SECTION_OFF}
SectionSetFlags ${InGroup} $TempRadioButtonFlagsVar
NextRadioButton:

!insertmacro RadioButton ${3InGroup}
!insertmacro RadioButton ${4InGroup}
!insertmacro RadioButton ${5InGroup}
!insertmacro EndRadioButtons


Clarification....
Just so future readers understand.....

StrCpy $1
insertmacro StartRadioButtons $1
insertmacro RadioButtons a,b,c,d,e,f,g, etc...
insertmacro EndRadioButtons
StrCmp $1

Is a macro set for creating and handling mutually exclusive option selection. And that is why having all the options under the sectiongroup being selected at the same time, was a functional error. Because presentation dictated I needed it grouped, but implmenentation of the 'event' dictated that I should only ever return $1 for a selectable option... (NOT all options together) and the way the macro list processes the flag states, the last one that is found to be selected will be returned.... so when they were all selected, the last in the group would always come back as the one clicked, even though it was the group header that received the user click.