In addition to the code templates, TipLink also generates a number of useful code embeds that occur before and after the TipLink commands.
These make it easy for you to put code in place to do things like change the visible state of PowerToolbar buttons to indicate what tooltip mode is active.
These are the embed points:
An example of using these embeds could be taken from our demo program.
We want to toggle the "latched" state of two buttons based on the GLO:TipMode
So we insert this block of code into the After ROUTINE:SetTooltips embed:
!Turn our toolbar "state" buttons On/Off based on tips active or not
CASE GLO:TipLink
OF 0
!Unlatch both buttons
Toolbar2.SetChecked(ID2_Normal, False)
Toolbar2.SetChecked(ID2_Balloon, False)
OF 1
!Conditionally latch one of the buttons
CASE GLO:TipType
OF 1 !Normal
!Handcode to Synchronize the toolbar "states" for "Normal Tips"
Toolbar2.SetChecked(ID2_Normal, True)
Toolbar2.SetChecked(ID2_Balloon, False)
OF 2 !Balloon
!Handcode to Synchronize the toolbar "states" for "Balloon Tips"
Toolbar2.SetChecked(ID2_Normal, False)
Toolbar2.SetChecked(ID2_Balloon, True)
END !CASE
END !CASE
This simple bit of code will now set the button state of the PowerToolbar to match the GLO:TipMode setting
When the setting is on Balloon - we see:
and when the setting is on Normal we see: