toggle bold on/off
Does anyone here know how to make a function to toggle SF_BOLD on/off for a SectionGroup without any negative side-effects?
I've tried numerous variations of the suggested SectionGetFlags, IntOp, SectionSetFlags combinations without success.
For example, I have two required main files, one of which has no options and one of which has a lot of options. So, it works great if I do simple code like:
Function .onSelChange
${If} ${SectionIsSelected} ${MainFileNoOptions}
!insertmacro UnSelectSection ${OptionGroup}
${EndIf}
FunctionEnd
This prevents selection of anything in the OptionGroup if MainFileNoOptions is selected. Thus, if MainFileWithOptions is selected, then the test fails and I can pick things from the OptionGroup.
Great, but I'd also like to indicate whether the OptionGroup is active or not by making it bold if you can use it, non-bold if you can't use it. So, if I expand the logic to say something like:
Function .onSelChange
${If} ${SectionIsSelected} ${MainFileNoOptions}
!insertmacro UnSelectSection ${OptionGroup}
SectionGetFlags ${OptionGroup} $R0
IntOp $R0 $R0 - ${SF_BOLD}
SectionSetFlags ${OptionGroup} $R0
${ElseIf} ${SectionIsSelected} ${MainFileWithOptions}
SectionGetFlags ${OptionGroup} $R0
IntOp $R0 $R0 + ${SF_BOLD}
SectionSetFlags ${OptionGroup} $R0
${EndIf}
FunctionEnd
Then it adds/removes SF_BOLD correctly when I toggle between MainFileNoOptions and MainFileWithOptions, but now OptionGroup stops working correctly (clicking any of the sections inside it merely toggles the bold on/off and nothing can be selected because the SectionSetFlags command is blocking my change attempts).
Any suggestions would be greatly appreciated. Thanks!