Added tooltip support

This commit is contained in:
M ESCO authored and Ross Boucher committed 2009-03-05 14:40:56 -08:00
1 parent a1e3feda4f
commit 55fa6024db
1 file changed
+26
+26
View File
@@ -100,6 +100,8 @@ var CPControlBlackColor = [CPColor blackColor];
CPCellImagePosition _imagePosition;
CPImageScaling _imageScaling;
CPString _toolTip;
// Target-Action Support
id _target;
SEL _action;
@@ -314,6 +316,30 @@ var CPControlBlackColor = [CPColor blackColor];
return _textShadow;
}
/*!
Sets the tooltip for the receiver.
@param aToolTip the tooltip
*/
-(void)setToolTip:(CPString)aToolTip
{
if (_toolTip == aToolTip)
return;
_toolTip = aToolTip;
#if PLATFORM(DOM)
_DOMElement.title = [aToolTip cssString];
#endif
}
/*!
Returns the receiver's tooltip
*/
-(CPString)toolTip
{
return _toolTip;
}
/*!
Returns the receiver's target action
*/