> > It would be possible to derive a tooltip class from
> > qx.ui.popup.ToolTip which overrode _beforeAppear and used the
> > current mouse coordinates (qx.event.type.MouseEvent.getClientX()
> > etc) to ask the widget what the label and icon should be for the
> > tooltip, maybe via an event interface.
>
> This is basically OK. I've used getBoundToWidget() in the overridden
> tooltip _beforeAppear and called the function getToolTipLabel if the
> function is defined.
An alternative approach is to define this function in the overridden
tooltip:
setContent : function(sLabel, sIcon)
{
sLabel = sLabel == undefined ? "" : sLabel;
sIcon = sIcon == undefined ? "" : sIcon;
var oAtom = this.getAtom();
var bChanged = (sLabel != oAtom.getLabel() || sIcon !=
oAtom.getIcon());
oAtom.setLabel(sLabel);
oAtom.setIcon(sIcon);
if (bChanged)
{
var oTTM = qx.ui.popup.ToolTipManager.getInstance();
var oCurrentToolTip = oTTM.getCurrentToolTip();
oTTM.setCurrentToolTip(null);
oTTM.setCurrentToolTip(oCurrentToolTip);
}
}
Then in the table I define an event listener for "mousemove" and set the
appropriate label into the tooltip. The tooltip decides, via setContent,
whether it should be shown again. The call to setCurrentToolTip(null) is
required because if the tooltip object is the same it isn't shown again.
There's probably more things to do here including resetting the content
on mouse out. But it basically works.
Hugh
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel