mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Refs #1264. Fix accidental global, cleanup.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* _CPToolTipWindowView.j
|
||||
* AppKit
|
||||
*
|
||||
* Created by Antoine Mercadal
|
||||
* Created by Antoine Mercadal
|
||||
* Copyright 2011 <primalmotion@archipelproject.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -42,7 +42,7 @@
|
||||
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
|
||||
{
|
||||
var contentRect = CGRectMakeCopy(aFrameRect);
|
||||
|
||||
|
||||
contentRect.origin.x += 3;
|
||||
contentRect.origin.y += 3;
|
||||
contentRect.size.width -= 6;
|
||||
@@ -92,7 +92,7 @@
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
radius = 2,
|
||||
strokeWidth = 1;
|
||||
|
||||
|
||||
CGContextSetStrokeColor(context, _strokeColor);
|
||||
CGContextSetFillColor(context, _backgroundColor);
|
||||
CGContextSetLineWidth(context, strokeWidth);
|
||||
|
||||
+21
-14
@@ -34,8 +34,7 @@ var _CPToolTipHeight = 24.0,
|
||||
|
||||
|
||||
/*! @ingroup appkit
|
||||
This is a basic tooltip that behaves mostlt like
|
||||
Cocoa ones.
|
||||
This is a basic tooltip that behaves mostly like Cocoa ones.
|
||||
*/
|
||||
@implementation _CPToolTip : CPWindow
|
||||
{
|
||||
@@ -46,7 +45,7 @@ var _CPToolTipHeight = 24.0,
|
||||
#pragma mark -
|
||||
#pragma mark Class Methods
|
||||
|
||||
/*! returns an initialized _CPToolTip with string and attach it to given view
|
||||
/*! Returns an initialized _CPToolTip with the given text and attach it to given view.
|
||||
@param aString the content of the tooltip
|
||||
*/
|
||||
+ (_CPToolTip)toolTipWithString:(CPString)aString
|
||||
@@ -58,7 +57,9 @@ var _CPToolTipHeight = 24.0,
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
/*! compute a cool size for the given string
|
||||
/*!
|
||||
Compute a cool size for the given string.
|
||||
|
||||
@param aToolTipSize the original wanted tool tip size
|
||||
@param aText the wanted text
|
||||
@return CPArray containing the computer toolTipSize and textFrameSize
|
||||
@@ -82,7 +83,9 @@ var _CPToolTipHeight = 24.0,
|
||||
return [aToolTipSize, textFrameSize];
|
||||
}
|
||||
|
||||
/*! override default windowView class loader
|
||||
/*!
|
||||
Override default windowView class loader.
|
||||
|
||||
@param aStyleMask the window mask
|
||||
@return the windowView class
|
||||
*/
|
||||
@@ -95,7 +98,9 @@ var _CPToolTipHeight = 24.0,
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
|
||||
/*! returns an initialized _CPToolTip with string
|
||||
/*!
|
||||
Returns an initialized _CPToolTip with string.
|
||||
|
||||
@param aString the content of the tooltip
|
||||
@param aStyleMask the tooltip's style mask
|
||||
*/
|
||||
@@ -137,7 +142,7 @@ var _CPToolTipHeight = 24.0,
|
||||
#pragma mark Controls
|
||||
|
||||
/*!
|
||||
Show the tooltip after computing the position
|
||||
Show the tooltip after computing the position.
|
||||
*/
|
||||
- (void)showToolTip
|
||||
{
|
||||
@@ -164,7 +169,7 @@ var _CPToolTipHeight = 24.0,
|
||||
|
||||
|
||||
/*! @ingroup appkit
|
||||
Make CPView supporting toolTips.
|
||||
Add tooltip support to CPView.
|
||||
*/
|
||||
@implementation CPView (toolTips)
|
||||
|
||||
@@ -183,10 +188,12 @@ var _CPToolTipHeight = 24.0,
|
||||
if (!_DOMElement)
|
||||
return;
|
||||
|
||||
var fIn = function(e){
|
||||
var fIn = function(e)
|
||||
{
|
||||
[self _fireToolTip];
|
||||
};
|
||||
fOut = function(e){
|
||||
},
|
||||
fOut = function(e)
|
||||
{
|
||||
[self _invalidateToolTip];
|
||||
};
|
||||
|
||||
@@ -224,7 +231,7 @@ var _CPToolTipHeight = 24.0,
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the receiver's tooltip
|
||||
Returns the receiver's tooltip.
|
||||
*/
|
||||
- (CPString)toolTip
|
||||
{
|
||||
@@ -232,7 +239,7 @@ var _CPToolTipHeight = 24.0,
|
||||
}
|
||||
|
||||
/*! @ignore
|
||||
starts the tooltip timer
|
||||
Starts the tooltip timer.
|
||||
*/
|
||||
- (void)_fireToolTip
|
||||
{
|
||||
@@ -276,4 +283,4 @@ var _CPToolTipHeight = 24.0,
|
||||
_CPCurrentToolTip = [_CPToolTip toolTipWithString:_toolTip];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user