Help tips or hints are very useful, as they simplify the user interface and help users understand objects that sometimes aren’t self-evident. 4D supports help tips in most areas and inputs when hovering the pointer over them, but that was not the case with a list box object.
With 4D v16 R5 we have added the possibility to display a help tip on a list box cell thanks to the enrichment of two commands.
Define a tip on a list box
The OBJECT SET HELP TIP command has been expanded to support list boxes:
// Set a help tip on myListbox object
OBJECT SET HELP TIP(*;"myListbox";"This is the list box help tip!")
display a tip on a list box cell
To make things even better, help tips can be defined according to the position of the mouse. With a just few lines of code, you can set help tips based on the hovered column and even according to each row!
For this, the LISTBOX GET CELL POSITION command has also been enhanced with two new, optional parameters (mouseX and mouseY, in pixels) and returns the corresponding column and row numbers.
This command can be called during the On mouse move event to update the help tip content dynamically, according to the column and row position of the mouse over the list box.
// Get the list box column and row to know what cell the user hovers
LISTBOX GET CELL POSITION(*;"myListbox";$x;$y;$column;$row)
If($column=1) & ($row=1)
// Update tip content according to the hovered cell
OBJECT SET HELP TIP(*;"myListbox";"This is cell (1;1)")