diff --git a/ChangeLog b/ChangeLog index 07b1c918a..075991c9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * Source/NSCustomImageRep.m : Improved documentation * Source/NSFontPanel.m : Improved documentation * Source/NSForm.m : Improved documentation + * Source/NSFormCell.m : Improved documentation 2005-11-16 fabien diff --git a/Source/NSFormCell.m b/Source/NSFormCell.m index a534cf59f..69b036e79 100644 --- a/Source/NSFormCell.m +++ b/Source/NSFormCell.m @@ -49,6 +49,8 @@ static NSColor *shadowCol; } @end +/**

TODO Description

+ */ @implementation NSFormCell + (void) initialize { @@ -65,14 +67,18 @@ static NSColor *shadowCol; } /* The title attributes are those inherited from the NSActionCell class. */ -- init +- (id) init { return [self initTextCell: @"Field:"]; } -- initTextCell: (NSString *)aString +/**

Initializes and returns new NSFormCell with aString as its title

+ */ +- (id) initTextCell: (NSString *)aString { - self = [super initTextCell: @""]; + if (! ( self = [super initTextCell: @""] ) ) + return nil; + _cell.is_bezeled = YES; _cell.is_editable = YES; [self setAlignment: NSLeftTextAlignment]; @@ -80,6 +86,7 @@ static NSColor *shadowCol; [_titleCell setAlignment: NSRightTextAlignment]; _formcell_auto_title_width = YES; _displayedTitleWidth = -1; + return self; } @@ -89,6 +96,9 @@ static NSColor *shadowCol; [super dealloc]; } +/**

Returns whether the NSFormCell is Opaque. Returns YES if + the textCell and the title cell are both Opaque, NO otherwise

+ */ - (BOOL)isOpaque { return [_titleCell isOpaque] && [super isOpaque]; @@ -108,9 +118,13 @@ static NSColor *shadowCol; } } +/**

Sets the NSFormCell title to aString. + TODO => _formcell_auto_title_width / Update the control(s)

+ */ - (void)setTitle: (NSString*)aString { [_titleCell setStringValue: aString]; + if (_formcell_auto_title_width) { // Invalidates title width @@ -136,11 +150,18 @@ static NSColor *shadowCol; } } +/**

Sets the text alignment of the NSFormCell's title to mode. + NSRightTextAlignment by default. See NSTextAlignment for more information +

See Also: -titleAlignment

+ */ - (void)setTitleAlignment:(NSTextAlignment)mode { [_titleCell setAlignment: mode]; } +/**

Set text font of the NSFormCell's title to fontObject.

+

See Also: -titleFont

+ */ - (void)setTitleFont: (NSFont*)fontObject { [_titleCell setFont: fontObject]; @@ -155,6 +176,9 @@ static NSColor *shadowCol; } } +/**

Sets the width of the NSFormCell's title to width. All NSFormCell + of the NSForm are updated

See Also: -titleWidth

+*/ - (void)setTitleWidth: (float)width { if (width >= 0) @@ -180,16 +204,25 @@ static NSColor *shadowCol; return [_titleCell attributedStringValue]; } +/**

Returns the NSFormCell's title

See Also: -setTitle:

+ */ - (NSString*)title { return [_titleCell stringValue]; } +/**

Returns the text alignment of the NSFormCell's title. + NSRightTextAlignment by default. See NSTextAlignment for more informations +

See Also: -setTitleAlignment:

+ */ - (NSTextAlignment)titleAlignment { return [_titleCell alignment]; } +/**

Returns the text font of the NSFormCell's title

+

See Also: -setTitleFont:

+ */ - (NSFont*)titleFont { return [_titleCell font];