mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-19 08:53:30 +00:00
Added some designated initializers to AppKit.
This commit is contained in:
committed by
Ross Boucher
parent
fc85ae16a5
commit
bc6f168afa
+3
-1
@@ -58,7 +58,9 @@ CPGrooveBorder = 3;
|
||||
|
||||
- (id)initWithFrame:(CPRect)frameRect
|
||||
{
|
||||
if (self = [super initWithFrame:frameRect])
|
||||
self = [super initWithFrame:frameRect];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_fillColor = [CPColor clearColor];
|
||||
_borderColor = [CPColor blackColor];
|
||||
|
||||
+9
-4
@@ -90,6 +90,11 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
Image _image;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initByReferencingFile:@"" size:CGSizeMake(-1, -1)];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the image, by associating it with a filename. The image
|
||||
denoted in \c aFilename is not actually loaded. It will
|
||||
@@ -98,7 +103,7 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
@param aSize the image's size
|
||||
@return the initialized image
|
||||
*/
|
||||
- (CPImage)initByReferencingFile:(CPString)aFilename size:(CGSize)aSize
|
||||
- (id)initByReferencingFile:(CPString)aFilename size:(CGSize)aSize
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@@ -118,7 +123,7 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
@param aSize the size of the image
|
||||
@return the initialized image.
|
||||
*/
|
||||
- (CPImage)initWithContentsOfFile:(CPString)aFilename size:(CGSize)aSize
|
||||
- (id)initWithContentsOfFile:(CPString)aFilename size:(CGSize)aSize
|
||||
{
|
||||
self = [self initByReferencingFile:aFilename size:aSize];
|
||||
|
||||
@@ -134,9 +139,9 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
@param aFilename the file name of the image
|
||||
@return the initialized image
|
||||
*/
|
||||
- (CPImage)initWithContentsOfFile:(CPString)aFilename
|
||||
- (id)initWithContentsOfFile:(CPString)aFilename
|
||||
{
|
||||
self = [self initByReferencingFile:aFilename size: CGSizeMake(-1, -1)];
|
||||
self = [self initByReferencingFile:aFilename size:CGSizeMake(-1, -1)];
|
||||
|
||||
if (self)
|
||||
[self load];
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
_CPMenuItemView _menuItemView;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithTitle:@"" action:nil keyEquivalent:nil];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the menu item with a title, action, and keyboard equivalent.
|
||||
@param aTitle the menu item's title
|
||||
|
||||
@@ -60,6 +60,11 @@ CPPressedTab = 2;
|
||||
CPView _auxiliaryView;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithIdentifier:@""];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the tab view item with the specified identifier.
|
||||
@return the initialized CPTabViewItem
|
||||
|
||||
@@ -62,6 +62,11 @@ CPTableColumnUserResizingMask = 2;
|
||||
CPString _headerToolTip;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithIdentifier:@""];
|
||||
}
|
||||
|
||||
- (id)initWithIdentifier:(id)anIdentifier
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@@ -128,6 +128,11 @@ var CPToolbarConfigurationsByIdentifier = nil;
|
||||
[toolbarsSharingIdentifier addObject:toolbar];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithIdentifier:@""];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the toolbar with the specified identifier.
|
||||
@param anIdentifier the identifier for the toolbar
|
||||
|
||||
@@ -86,6 +86,11 @@ CPToolbarPrintItemIdentifier = @"CPToolbarPrintItemIdentifier";
|
||||
int _visibilityPriority;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithItemIdentifier:@""];
|
||||
}
|
||||
|
||||
// Creating a Toolbar Item
|
||||
/*!
|
||||
Initializes the toolbar item with a specified identifier.
|
||||
|
||||
Reference in New Issue
Block a user