|
GLG Toolkit, C / C++ API Library
Version 4.6
|
These callbacks may be used to implement custom axis label and tooltip formatting. More...
These callbacks may be used to implement custom axis label and tooltip formatting.
Typedefs | |
| typedef char *(* | GlgLabelFormatter) (GlgObject axis, GlgLabelType label_type, GlgValueType value_type, double value, time_t sec, double fractional_sec, void *reserved) |
| A label formatter used to supply custom labels for chart axes and installed via GlgSetLabelFormatter. More... | |
| typedef char *(* | GlgTooltipFormatter) (GlgObject viewport, GlgObject object, GlgObject tooltip_obj, GlgLong root_x, GlgLong root_y) |
| A tooltip formatter used to supply custom tooltip strings and installed via GlgSetTooltipFormatter. More... | |
| typedef char*(* GlgLabelFormatter) (GlgObject axis, GlgLabelType label_type, GlgValueType value_type, double value, time_t sec, double fractional_sec, void *reserved) |
A label formatter used to supply custom labels for chart axes and installed via GlgSetLabelFormatter.
This function is invoked every time a new label string needs to be generated. It can create and return a label string, or return NULL to use a default label string.
When the created label string is no longer needed, it will be freed by the Toolkit using GlgFree. Therefore, it must be allocated using GlgAlloc or one of the GLG string utility functions, such as GlgStrClone or GlgConcatStrings.
| axis | The label's axis object. |
| label_type | The type of the label: GLG_TICK_LABEL_TYPE or GLG_SELECTION_LABEL_TYPE. |
| value_type | The type of the axis' value: GLG_NUMERICAL_VALUE or GLG_TIME_VALUE. |
| value | The value corresponding to the label position. |
| sec | An integer number of seconds since the Epoch corresponding to the label position for GLG_TIME_VALUE axes. |
| fractional_sec | The fractional number of seconds for GLG_TIME_VALUE axes. |
| reserved | This parameter is reserved for future implementations. |
| typedef char*(* GlgTooltipFormatter) (GlgObject viewport, GlgObject object, GlgObject tooltip_obj, GlgLong root_x, GlgLong root_y) |
A tooltip formatter used to supply custom tooltip strings and installed via GlgSetTooltipFormatter.
This function is invoked every time a new tooltip string needs to be generated. It can query an object's properties and use them to generate a returned tooltip string.
If the GlgTooltipFormatterOnErase global configuration resource is set to 1, the method will also be invoked with NULL parameters when the tooltip is erased.
When the tooltip string is no longer needed, it will be freed by the Toolkit using GlgFree. Therefore, it must be allocated using GlgAlloc or one of the GLG string utility functions, such as GlgStrClone or GlgConcatStrings.
| viewport | The viewport object for which tooltips are enabled via the ProcessMouse property. |
| object | The object that owns the TooltipString resource. |
| tooltip_obj | The TooltipString object (S data object). |
| root_x | The x coordinate of the cursor. In the GTK environment, the coordinate is relative to the top level frame window containing the viewport. In all other environment, it is relative to the device screen. |
| root_y | The y coordinate of the cursor. In the GTK environment, the coordinate is relative to the top level frame window containing the viewport. In all other environment, it is relative to the device screen. |