Radiobuttons OnSelChange SectionGroup error
Greetings. Very strange behavior. Context is the components screen, and I'm trapping the onClick event with OnSelChange. That routine uses the following code to stick into $1 the value of the radiobox that was clicked. based on that value, I do stuff controlled in a case statement. I put a message box at the end of this code to show the output of the click and this string of macros.
MOST of these radio buttons are not displayed. ( set to "" ) but because of the way that onSelchange reports the return value from a declared section, the number increases reguardless of if the section is displayed or not... so that if sections 0-9 are hidden, and the first checkbox on the components screen is displayed it will return 10 as the value that was clicked. Ok.. fine...
but now, I've added a sectiongroup and its all gone to crap. If I click on the sectiongroup line or checkbox, it returns 19 (The ordinal id for the last checkbox - section: MDI_sa) and then if I click it again, it returns 18 ( the ordinal of the section labled: MDI_mm ) And then it repeats. 19, 18 ,19 ,18 It never returns 15 ( the ordinal value that would be assigned for the sectiongroup marker if it treated them the same...but if they don't treat them the same, then there is no ordinal 19 and it doesn't make sense again...)
StrCpy $1 $BaseRadioDefault
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${g1o1} ; ordinal 0
; most of these are hidden at any one time....
!insertmacro RadioButton ${g1o2} ; ordinal 1
!insertmacro RadioButton ${g1o3} ; ord 2
!insertmacro RadioButton ${g1o4} ; ord 3
!insertmacro RadioButton ${g1o5} ; ord 4
!insertmacro RadioButton ${g1o6} ; ord 5
!insertmacro RadioButton ${g1o7} ; ord 6
!insertmacro RadioButton ${g1o8} ; ord 7
!insertmacro RadioButton ${g1o9} ; ord 8
!insertmacro RadioButton ${g1oA} ; ord 9
!insertmacro RadioButton ${g1oB} ; ord 10
!insertmacro RadioButton ${g1oC} ; ord 11
!insertmacro RadioButton ${g1oA2} ; ord 12
!insertmacro RadioButton ${g1o6B} ; ord 13
!insertmacro RadioButton ${g1o7B} ; ord 14
!insertmacro RadioButton ${MDI}
; This is the group section header. SHOULD Be ordinal 15
!insertmacro RadioButton ${MDI_mx} ; ord 16
; none of these are hidden
!insertmacro RadioButton ${MDI_dc} ; ord 17
; they will always display
!insertmacro RadioButton ${MDI_mm} ; ord 18
!insertmacro RadioButton ${MDI_sa} ; ord 19??
!insertmacro EndRadioButtons
MessageBox MB_OK "Clicked On: $1" ; results in alternating
; values of 19 and 18 when you click on the group header.
I attached the pic of the way the screen displays with two normal options visible and the bottom group showing.
Please, any guidance as to what I'm assuming incorrectly?
Thanks
_Andy