@XLD --
I had done something earlier with toggle buttons and the on/off feedback to the user seemed to be a little more better than buttons. So that's why I threw it in that way
@dschmitt
1. When you click one of the toggle buttons this fires which flips the status variables AND invalidates the ribbon ( = re-init status, etc.)
Sub onToggleAction(control As IRibbonControl, pressed As Boolean)
Select Case control.ID
Case "tbA"
bPressedA = Not bPressedA
bVisibleA = Not bVisibleA
oRibbon.Invalidate
Case "tbB"
bPressedB = Not bPressedB
bVisibleB = Not bVisibleB
oRibbon.Invalidate
Case "tbC"
bPressedC = Not bPressedC
bVisibleC = Not bVisibleC
oRibbon.Invalidate
End Select
End Sub
[/CODE]
2. As part of the ribbon re-initing, the 3 group getVisible callbacks each ask if the the group is to be displayed or not
'Callback for gA getVisible
Sub getGroupVisible(control As IRibbonControl, ByRef returnedVal)
Select Case control.ID
Case "gA"
returnedVal = bVisibleA
Case "gB"
returnedVal = bVisibleB
Case "gC"
returnedVal = bVisibleC
End Select
End Sub
There are many ways to clean the Mark I version code, but I went for a straight forward approach and didn't try to be too clever
since that's when I get myself in trouble