Suggestion: Tooltip in ListBox

Hello Jules,
following the modifications suggested by francis in concerning individual table cells tooltips, I ask you if you could do the same for the ListBox / ListBoxModel classes.

Make ListBoxRowComponent inherit from TooltipClient:

class ListBoxRowComponent : public Component, public TooltipClient
Implement the getTooltip() function in ListBoxRowComponent:

[code] const String getTooltip()
if (owner.getModel() != 0)
return owner.getModel()->getRowTooltip (row);

    return String::empty;

Add a new virtual function in ListBoxModel:

/** Returns a tooltip for a particular row in the list. */ virtual const String getRowTooltip (int rowNumber);
With the following default implementation:

const String ListBoxModel::getRowTooltip (int /*rowNumber*/) { return String::empty; }
This also allows you to easily show the tooltip of the listbox when the mouse is on one row, not only when it is on the empty space.


Good suggestion! Thanks!