07-15-2013 08:21 AM
Hello,
for some tooltips I want to dynamically generate the text displayed, e.g. depending on the current properties of the respective control (indicator/normal; range...). However, I do not want to build the string (which may be quite complex) whenever one of the control properties is changed, I would prefer to build the tooltips text only if the tooltip actually is going to be displayed...
So what I am looking for is something like a menu dimmer callback (which doesn't exist for tooltips) or a suitable event... - I do not want to query the mouse coordinates as this gets messy for many controls and controls on different tab panels...
Any suggestions of how to implement dynamic tooltip texts?
Thanks!!
07-15-2013 11:32 AM
I can't see that there is much that could be done with the tooltip attributes accessed via SetCtrlAttribute(..). A quick test seems to suggest that the tooltip can be shown when the only event that the control has recieved is EVENT_MOUSE_POINTER_MOVE when the user hovers the cursor over the control.
However, there are the old-style tooltips that are part of the Programmer's Toolbox (i.e. SetCtrlTooltipAttribute(..), etc.). Since the source code is available in toolbox.c it could be modified to add the functionality that you want. I could envision a new attribute that you could set with SetCtrlTooltipAttribute(..) that would be a function pointer to a callback function that would be called before the tooltip is displayed. You could use that to programmatically set up the tooltip text.