From 60f78f10a1e6da5a3e58bcf388d8215a82c1bc52 Mon Sep 17 00:00:00 2001 From: Fabien Vallon Date: Mon, 21 Nov 2005 15:19:13 +0000 Subject: [PATCH] Improved documentation git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22063 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 1 + Source/NSCell.m | 148 ++++++++++++++++++++++++------------------------ 2 files changed, 74 insertions(+), 75 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4689d942..ccd442020 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * Source/NSButton.m : Improved documentation * Source/NSButtonCell.m : Improved documentation * Source/NSCachedImageRep.m : Improved documentation + * Source/NSCell.m : Improved documentation 2005-11-21 Fred Kiefer diff --git a/Source/NSCell.m b/Source/NSCell.m index 533f98a87..ea0982c9c 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -138,9 +138,9 @@ static NSColor *shadowCol; return [self initTextCell: @""]; } -/**

Initialize an NSCell with anImage. This method sets the image position - to NSImageOnly and the cell's type to NSImageCellType.

-

See Also: -initTextCell:

+/**

Initialize and returns a new NSCell with a NSImage anImage. + This method sets the image position to NSImageOnly and the cell's type + to NSImageCellType.

See Also: -initTextCell:

*/ - (id) initImageCell: (NSImage*)anImage { @@ -171,9 +171,9 @@ static NSColor *shadowCol; return self; } -/**

Initialize a new NSCell aString. - * This method sets the cell's type to NSTextCellType.

- *

See Also: -initImageCell:

+/**

Initialize and returns a new NSCell with a NSString aString. + This method sets the cell's type to NSTextCellType.

+

See Also: -initImageCell:

*/ - (id) initTextCell: (NSString*)aString { @@ -432,7 +432,8 @@ static NSColor *shadowCol; } } -/**

Returns some NSCell's attributes for the specified NSCellAttribute

+/**

Returns some NSCell's attributes for the specified NSCellAttribute

*

See Also: -setCellAttribute:to:

*/ - (int) cellAttribute: (NSCellAttribute)aParameter @@ -598,9 +599,9 @@ static NSColor *shadowCol; } } -/**

Set the NSCell's type.

-

TODO more doc about the implementation

- *

See Also: -type

+/**

Sets the NSCell's type. See NSCellType +

TODO more doc about the implementation

+

See Also: -type

*/ - (void) setType: (NSCellType)aType { @@ -629,12 +630,10 @@ static NSColor *shadowCol; } } -/** - *

Returns the cell's type. it returns NSNullCellType if the - * cell's type flag is set to NSImageCellType and if the cell's image - * is nil

- *

See Also -setType:

- * +/**

Returns the cell's type. Returns NSNullCellType if the + cell's type flag is set to NSImageCellType and if the cell's image + is nil. See NSCellType for more + informations.

See Also -setType:

*/ - (NSCellType) type { @@ -662,8 +661,7 @@ static NSColor *shadowCol; } /**

Returns whether the NSCell has a bezeled border. By default a NSCell - has no bezeled border

-

See Also: -setBezeled:

+ has no bezeled border

See Also: -setBezeled:

*/ - (BOOL) isBezeled { @@ -671,8 +669,7 @@ static NSColor *shadowCol; } /**

Returns whether the NSCell has a border. By default a NSCell has - border

-

See Also: -setBordered: -setBezeled: -isBezeled

+ border

See Also: -setBordered: -setBezeled: -isBezeled

*/ - (BOOL) isBordered { @@ -740,9 +737,9 @@ static NSColor *shadowCol; } } -/**

Returns the cell's state

- *

See Also: -setState:

- */ +/**

Returns the NSCell's state

+

See Also: -setState:

+*/ - (int) state { return _cell.state; @@ -794,17 +791,17 @@ static NSColor *shadowCol; [self setState: [self nextState]]; } -/**

Returns the alignment of the text used in the NSCell. See NSTextAlignment - for more information. By default the text alignment is - NSJustifiedTextAlignment

-

See Also: -setAlignment:

+/**

Returns the alignment of the text used in the NSCell. See + NSTextAlignment for more + informations. By default the text alignment is NSJustifiedTextAlignment

+

See Also: -setAlignment:

*/ - (NSTextAlignment) alignment { return _cell.text_align; } -/**

Returns the font of the text used in the cell

+/**

Returns the font of the text used in the NSCell

See Also: -setFont:

*/ - (NSFont*) font @@ -812,7 +809,7 @@ static NSColor *shadowCol; return _font; } -/**

Returns whether the cell is editable. By default a NSCell is not editable +/**

Returns whether the cell is editable.By default a NSCell is not editable.

See Also: -setEditable:

*/ - (BOOL) isEditable @@ -820,7 +817,7 @@ static NSColor *shadowCol; return _cell.is_editable; } -/**

Returns whether the cell is selectable. This method will returns YES if +/**

Returns whether the cell is selectable. This method returns YES if the cell is selectable or editable. NO otherwise

See Also: -setSelectable: -isEditable -setEditable:

*/ @@ -829,16 +826,16 @@ static NSColor *shadowCol; return _cell.is_selectable || _cell.is_editable; } -/**

Returns whether the NSCell is scrollable. By default NO

-

See Also: -setScrollable:

+/**

Returns whether the NSCell is scrollable. By default a NSCell is not + scrollable

See Also: -setScrollable:

*/ - (BOOL) isScrollable { return _cell.is_scrollable; } -/**

Sets the alignment of the text

-

See Also: -alignment

+/**

Sets the alignment of the text. See NSTextAlignment.

See Also: -alignment

*/ - (void) setAlignment: (NSTextAlignment)mode { @@ -846,8 +843,8 @@ static NSColor *shadowCol; _cell.text_align = mode; } -/**

Sets whether the NSCell's text is editable.

-

See Also: -isEditable -setSelectable: -isSelectable

+/**

Sets whether the NSCell's text is editable.

+

See Also: -isEditable -setSelectable: -isSelectable

*/ - (void) setEditable: (BOOL)flag { @@ -873,7 +870,7 @@ static NSColor *shadowCol; ASSIGN (_font, fontObject); } -/**

Set whether the cell selectable. Making a cell unselectable also +/**

Sets whether the cell selectable. Making a cell unselectable also * makes it uneditable until a -setEditable: re-enables it.

*

See Also: -isSelectable -setEditable: -isEditable

*/ @@ -886,8 +883,7 @@ static NSColor *shadowCol; } /**

Sets whether the NCell is scrollable. By default a NSCell is not - scrollable

- *

See Also: -isSelectable

+ scrollable

See Also: -isSelectable

*/ - (void) setScrollable: (BOOL)flag { @@ -1027,8 +1023,8 @@ static NSColor *shadowCol; [self setStringValue: aString]; } -/**

Returns the action selector, This method returns NULL by default. - It is usally implemented by subclasses

+/**

Implemented by subclasses to return the action method. + The NSCell implementaiton returns NULL.

See Also: -setAction: -setTarget: -target

*/ - (SEL) action @@ -1036,8 +1032,8 @@ static NSColor *shadowCol; return NULL; } -/**

Sets the action selector. This method is implement by subclasses. - By default raises a NSInternalInconsistencyException

+/**

Implemented by subclasses to set the action method. + The NSCell implementation raises a NSInternalInconsistencyException

See Also: -action -setTarget: -target

*/ - (void) setAction: (SEL)aSelector @@ -1046,8 +1042,8 @@ static NSColor *shadowCol; format: @"attempt to set an action in an NSCell"]; } -/**

Sets the target object. This method is implemented by sublclasses. - By default raises a NSInternalInconsistencyException

+/**

Implemented by subclasses to set the target object. + The NSCell implementation raises a NSInternalInconsistencyException

See Also: -target -setAction: -action

*/ - (void) setTarget: (id)anObject @@ -1056,16 +1052,17 @@ static NSColor *shadowCol; format: @"attempt to set a target in an NSCell"]; } -/**

Returns the target object. This method is implemented by sublclasses. - By default returns nil

See Also: -setTarget: -setAction: -action

+/**

Implemented by subclass to return the target object. + The NSCell implementation returns nil

+

See Also: -setTarget: -setAction: -action

*/ - (id) target { return nil; } -/**

Returns whether the cell can continuously send action. Some sublcass - should redefine this method with NSLeftMouseDraggedMask

+/**

Returns whether the cell can continuously send its action messages. + Some subclasses should redefine this method with NSLeftMouseDraggedMask

See Also: -setContinuous:

*/ - (BOOL) isContinuous @@ -1074,8 +1071,8 @@ static NSColor *shadowCol; return (_action_mask & NSPeriodicMask) != 0; } -/**

Sets whether the cell can continuously send action. Some sublcass - should redefine this method with NSLeftMouseDraggedMask

+/**

Sets whether the cell can continuously send its action messages. + Some subclasses should redefine this method with NSLeftMouseDraggedMask

*

See Also: -isContinuous

*/ - (void) setContinuous: (BOOL)flag @@ -1102,9 +1099,9 @@ static NSColor *shadowCol; return previousMask; } -/**

Returns the NSCell's image.If the cell's type is NSImageCellType, - * returns nil otherwise.

- *

See Also: -setImage: -setType: -type

+/**

Returns the NSCell's image if the NSCell's type is NSImageCellType, + returns nil otherwise.

+

See Also: -setImage: -setType: -type

*/ - (NSImage*) image { @@ -1138,8 +1135,8 @@ static NSColor *shadowCol; ASSIGN (_cell_image, anImage); } -/**

Assigns a tag to the NCell. This method is implemented by subclasses. - By default it raises an NSInvalidArgumentException.

+/**

Implemented by sublclasses to assigns the tag anInt. + The NSCell implementation raises an NSInvalidArgumentException.

See Also: -tag

*/ - (void) setTag: (int)anInt @@ -1148,8 +1145,8 @@ static NSColor *shadowCol; format: @"attempt to set a tag in an NSCell"]; } -/**

Returns the cell's tag. This method is implemented by subclasses. - By default it returns -1

See Also: -setTag:

+/**

Implemented by subclasses to Return the tag. + The NSCell implementation returns -1

See Also: -setTag:

*/ - (int) tag { @@ -1444,9 +1441,8 @@ static NSColor *shadowCol; return _represented_object; } -/**

Sets the NSCell's represented object to anObject. anObject will - be retain.

-

See Also: -representedObject

+/**

Sets the NSCell's represented object to anObject. + anObject will be retain.

See Also: -representedObject

*/ - (void) setRepresentedObject: (id)anObject { @@ -1668,8 +1664,8 @@ static NSColor *shadowCol; } } -/**

Returns the key equivalent. This method is implemented by subclasses. - *By default it return an empty NSString.

+/**

Implemented by subclasses to returns the key equivalent. + The NSCell implementation returns an empty NSString.

*/ - (NSString*) keyEquivalent { @@ -1677,19 +1673,21 @@ static NSColor *shadowCol; } /**

Does nothing. This method is used by subclasses to recalculate sizes

- *

It is usally called by a NSControl object ([NSControl-calcSize])

+ *

It is usally called from a NSControl object ([NSControl-calcSize])

*/ - (void) calcDrawInfo: (NSRect)aRect { } -/**

Returns the minimun size needed to display the NSCell. - This size is calculate by adding :

-

- the borders (plain or bezeled) size

-

- the spacing between the border and inside the cell

-

- the TODO ... if the cell is type of NSTextCellType - or the image size if the cell has a NSImageCellType type.

-

This method returns NSZeroSize if the cell has a NSNullCellType type +/**Returns the minimun size needed to display the NSCell. + This size is calculate by adding : + + the borders (plain or bezeled) size + the spacing between the border and inside the cell + the TODO ... if the cell is type of NSTextCellType + or the image size if the cell has a NSImageCellType type. + +

This method returns NSZeroSize if the cell has a NSNullCellType type (Cocoa returns a very big size instead).

*/ @@ -1839,15 +1837,15 @@ static NSColor *shadowCol; return NSDefaultControlTint; } -/**

TODO. This method is used by subclass

+/**

This method is used by subclass to specified the control view. + This method returns nil

*/ - (NSView*) controlView { return nil; } -/** - *

This drawing is minimal and with no background, +/**

This drawing is minimal and with no background, * to make it easier for subclass to customize drawing.

*/ - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView @@ -1905,7 +1903,7 @@ static NSColor *shadowCol; // prettyfying } -/**

Draws the the cell in controlView

+/**

Draws the cell in controlView

*/ - (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView {