Tooltip formatter object used as a parameter of the GlgObject::SetTooltipFormatter method.
A tooltip formatter may be used to supply custom tooltip strings.
◆ CreateGlgTooltipFormatter()
Constructor. Creates a custom tooltip formatter that can be used as a parameter of the GlgObject::SetTooltipFormatter method. The static method is invoked on the GLG Toolkit handle obtaned via a "new GlgToolkit()" call at the application start-up.
- Parameters
-
tooltip_formatter_func | A custom tooltip formatter function to be invoked to provide a custom tooltip for an object when its tooltip is activated, The function's type signature must match the the type signature of the GetString method. |
- Returns
- An opaque internal object representing GlgTooltipFormatter.
◆ GetString()
Tooltip formatting method.
This method is invoked to get the text to be displayed in a tooltip. It can query object's properties and display them in the tooltip. The returned string will be used as the tooltip text. If the method returns null, the default tooltip will be used. If the method returns an empty string, the tooltip will not be displayed. If the GlgTooltipFormatterOnErase global configuration resource is set to 1, the method will also be invoked with null parameters when the tooltip is erased.
- Parameters
-
viewport | The viewport object for which tooltips are enabled via the ProcessMouse property. |
glg_object | The object that owns the TooltipString resource. |
tooltip_obj | The TooltipString object (S data object). |
root_x | The x coordinate of the cursor relatively to the screen. |
root_y | The y coordinate of the cursor relatively to the screen. |
- Returns
- The string to be displayed in the tooltip.