diff --git a/ChangeLog b/ChangeLog index 1641de60e..3ca1be1d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-22 fabien + + * Source/NSCell.m : Improved documentation + * Source/NSControl.m : Improved documentation + 2005-11-21 fabien * Source/NSButton.m : Improved documentation diff --git a/Source/NSCell.m b/Source/NSCell.m index ea0982c9c..e10cffc00 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -1401,7 +1401,7 @@ static NSColor *shadowCol; [self setObjectValue: [sender objectValue]]; } -/**

Sets NSCell's double value to sender's double value

+/**

Sets the NSCell's double value to sender's double value

See Also: -setDoubleValue:

*/ - (void) takeDoubleValueFrom: (id)sender @@ -1409,7 +1409,7 @@ static NSColor *shadowCol; [self setDoubleValue: [sender doubleValue]]; } -/**

Sets NSCell's float value to sender's float value

+/**

Sets the NSCell's float value to sender's float value

See Also: -setFloatValue:

*/ - (void) takeFloatValueFrom: (id)sender @@ -1417,7 +1417,7 @@ static NSColor *shadowCol; [self setFloatValue: [sender floatValue]]; } -/**

Sets NSCell's int value to sender's int value

+/**

Sets the NSCell's int value to sender's int value

See Also: -setIntValue:

*/ - (void) takeIntValueFrom: (id)sender @@ -1425,7 +1425,7 @@ static NSColor *shadowCol; [self setIntValue: [sender intValue]]; } -/**

Sets NSCell's NSString value to sender's NSSting value

+/**

Sets the NSCell's NSString value to sender's NSSting value

See Also: -setStringValue:

*/ - (void) takeStringValueFrom: (id)sender diff --git a/Source/NSControl.m b/Source/NSControl.m index 859bc5b5e..04c68f045 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -80,8 +80,8 @@ static Class actionCellClass; usedCellClass = factoryId ? factoryId : cellClass; } -/**

Initializes a new NSControl into the frame frameRect and create - a new NSCell

See Also: -setCell:

+/**

Initializes and returns a new NSControl into the rectangle + frameRect and create a new associated NSCell

See Also: -setCell:

*/ - (id) initWithFrame: (NSRect)frameRect { @@ -101,16 +101,16 @@ static Class actionCellClass; [super dealloc]; } -/**

Returns the NSControl's cell

See Also: -setCell:

+/**

Returns the NSControl's cell.

See Also: -setCell:

*/ - (id) cell { return _cell; } -/**

Sets the NSControl's cell to aCell, Raises an NSInvalidArgumentException - exception if aCell is nil or if it is not a cell class

-

See Also: -cell

+/**

Sets the NSControl's cell to aCell, + Raises an NSInvalidArgumentException exception if aCell is not nil and + if it is not a cell class.

See Also: -cell

*/ - (void) setCell: (NSCell *)aCell { @@ -121,8 +121,8 @@ static Class actionCellClass; ASSIGN(_cell, aCell); } -/**

Returns whether the selected cell of the NSControl is enabled

-

See Also: -setEnabled:

+/**

Returns whether the selected cell of the NSControl is enabled.

+

See Also: -setEnabled: [NSCell-isEnabled]

*/ - (BOOL) isEnabled { @@ -131,17 +131,18 @@ static Class actionCellClass; /**

Sets whether the NSControl's selected cell is enabled. If flag is NO, this method abort the editing. This method marks self for - display

See Also: -isEnabled

+ display.

See Also: -isEnabled [NSCell-setEnabled:]

*/ - (void) setEnabled: (BOOL)flag { [[self selectedCell] setEnabled: flag]; if (!flag) [self abortEditing]; + [self setNeedsDisplay: YES]; } -/**

Returns the NSControl's selected cell

+/**

Returns the NSControl's selected cell.

*/ - (id) selectedCell { @@ -149,7 +150,7 @@ static Class actionCellClass; } /**

Returns the tag of the NSControl's selected cell (if exists). - -1 otherwise

See Also: [NSCell-tag]

+ -1 otherwise.

See Also: [NSCell-tag]

*/ - (int) selectedTag { @@ -161,8 +162,9 @@ static Class actionCellClass; return [selected tag]; } -/**

Returns the value if the NSControl's selected cell as double

-

See Also: [NSCell-doubleValue]

+/**

Returns the value of the NSControl's selected cell as double.

+

See Also: -setDoubleValue: [NSCell-doubleValue] -intValue -floatValue + doubleValue stringValue

*/ - (double) doubleValue { @@ -170,24 +172,27 @@ static Class actionCellClass; return [[self selectedCell] doubleValue]; } -/**

Returns the value if the NSControl's selected cell as float

-

See Also: [NSCell-floatValue]

+/**

Returns the value of the NSControl's selected cell as float.

+

See Also: -setFloatValue: [NSCell-floatValue] -intValue -stringValue + doubleValue

*/ - (float) floatValue { return [[self selectedCell] floatValue]; } -/**

Returns the value if the NSControl's selected cell as int

-

See Also: [NSCell-intValue]

+/**

Returns the value of the NSControl's selected cell as int.

+

See Also: -setIntValue: [NSCell-intValue] -floatValue -doubleValue + -stringValue

*/ - (int) intValue { return [[self selectedCell] intValue]; } -/**

Returns the value if the NSControl's selected cell as NSString

-

See Also: [NSCell-stringValue]

+/**

Returns the value of the NSControl's selected cell as NSString.

+

See Also: -setStringValue: [NSCell-stringValue] -intValue -floatValue + -doubleValue -stringValue

*/ - (NSString *) stringValue { @@ -199,9 +204,10 @@ static Class actionCellClass; return [[self selectedCell] objectValue]; } -/**

Sets the value if the NSControl's selected cell to double. +/**

Sets the value of the NSControl's selected cell to double. If the selected cell is an action cell, it marks self for display.

-

See Also: -doubleValue [NSCell-setDoubleValue:]

+

See Also: -doubleValue [NSCell-setDoubleValue:] -setIntValue: + -setStringValue: -setFloatValue:

*/ - (void) setDoubleValue: (double)aDouble { @@ -218,9 +224,10 @@ static Class actionCellClass; } } -/**

Sets the value if the NSControl's selected cell to float. +/**

Sets the value of the NSControl's selected cell to float. If the selected cell is an action cell, it marks self for display.

-

See Also: -floatValue [NSCell-setFloatValue:]

+

See Also: -floatValue [NSCell-setFloatValue:] -setIntValue: + -setStringValue: -setDoubleValue:

*/ - (void) setFloatValue: (float)aFloat { @@ -237,9 +244,10 @@ static Class actionCellClass; } } -/**

Sets the value if the NSControl's selected cell to int. +/**

Sets the value of the NSControl's selected cell to int. If the selected cell is an action cell, it marks self for display.

-

See Also: -intValue [NSCell-setIntValue:]

+

See Also: -intValue [NSCell-setIntValue:] -setDoubleValue: + -setFloatValue: -setStringValue:

*/ - (void) setIntValue: (int)anInt { @@ -256,9 +264,10 @@ static Class actionCellClass; } } -/**

Sets the value if the NSControl's selected cell to NSString. +/**

Sets the value of the NSControl's selected cell to NSString. If the selected cell is an action cell, it marks self for display.

-

See Also: stringValue [NSCell-setStringValue:]

+

See Also: -stringValue [NSCell-setStringValue:] -setIntValue: + -setFloatValue: -setDoubleValue:

*/ - (void) setStringValue: (NSString *)aString { @@ -290,28 +299,37 @@ static Class actionCellClass; } } -/**

Marks self for display

+/**

Marks self for display.

*/ - (void) setNeedsDisplay { [super setNeedsDisplay: YES]; } -/* - * Interacting with Other Controls - */ +/**

Sets the NSControl's selected cell to the sender's double value

+

See Also: [NSCell-takeDoubleValueFrom:] -takeFloatValueFrom: + takeIntValueFrom: takeStringValueFrom:

+*/ - (void) takeDoubleValueFrom: (id)sender { [[self selectedCell] takeDoubleValueFrom: sender]; [self setNeedsDisplay: YES]; } +/**

Sets the NSControl's selected cell to the sender's float value

+

See Also: [NSCell-takeDoubleValueFrom:] -takeDoubleValueFrom: + takeIntValueFrom: takeStringValueFrom:

+*/ - (void) takeFloatValueFrom: (id)sender { [[self selectedCell] takeFloatValueFrom: sender]; [self setNeedsDisplay: YES]; } +/**

Sets the NSControl's selected cell to the sender's float int

+

See Also: [NSCell-takeDoubleValueFrom:] -takeDoubleValueFrom: + takeFloatValueFrom: takeStringValueFrom:

+*/ - (void) takeIntValueFrom: (id)sender { [[self selectedCell] takeIntValueFrom: sender]; @@ -324,6 +342,10 @@ static Class actionCellClass; [self setNeedsDisplay: YES]; } +/**

Sets the NSControl's selected cell to the sender's float int

+

See Also: [NSCell-takeDoubleValueFrom:] -takeDoubleValueFrom: + takeFloatValueFrom: takeIntValueFrom:

+*/ - (void) takeStringValueFrom: (id)sender { [[self selectedCell] takeStringValueFrom: sender]; @@ -331,8 +353,9 @@ static Class actionCellClass; } /**

Returns the alignment of the text in the NSControl's cell. - Returns NSNaturalTextAlignment if the cell does not exists

-

See Also: -setAlignment:

+ Returns NSNaturalTextAlignment if the cell does not exists. + See NSTextAlignment for + more informations.

See Also: -setAlignment: [NSCell-alignment]

*/ - (NSTextAlignment) alignment { @@ -342,9 +365,8 @@ static Class actionCellClass; return NSNaturalTextAlignment; } -/**

Returns the font of the text in the NSControl's cell. - Returns nil if the cell does not exists

-

See Also: -setFont:

+/**

Returns the font of the text in the NSControl's cell. Returns nil if + the cell does not exists.

See Also: -setFont: [NSCell-font]

*/ - (NSFont *) font { @@ -354,9 +376,11 @@ static Class actionCellClass; return nil; } -/**

Sets the alignment of the text in the NSControl's cell. - This method abort the editing and marks self for display if the cell - is an NSActionCell

See Also: -alignment

+/**

Sets the alignment of the text in the NSControl's cell to + mode. This method abort the editing and marks self for display + if the cell is an NSActionCell. See + NSTextAlignment for more informations.

+

See Also: -alignment [NSCell-setAlignment:] -abortEditing

*/ - (void) setAlignment: (NSTextAlignment)mode { @@ -370,8 +394,9 @@ static Class actionCellClass; } } -/**

Sets the font of the text in the NSControl's cell.

-

See Also: -font

+/**

Sets the font of the text in the NSControl's cell and the + editor object (if exists) to fontObject

+

See Also: -font [NSCell-setFont:] -currentEditor

*/ - (void) setFont: (NSFont *)fontObject { @@ -412,9 +437,9 @@ static Class actionCellClass; return [_cell formatter]; } -/**

Sends an [NSCell-endEditing:] message to the current object used to +/**

Sends an [NSCell-endEditing:] message to the current object used to edit the NSControl. Returns NO if the the currentEditor does not exists, - YES otherwise.

+ YES otherwise.

*/ - (BOOL) abortEditing { @@ -430,7 +455,8 @@ static Class actionCellClass; return YES; } - +/**

Returns the NSText object used when editing the NSControl.

+ */ - (NSText *) currentEditor { if (_cell != nil) @@ -507,6 +533,9 @@ static Class actionCellClass; [self drawCell: _cell]; } +/**

Redraws a aCell if it is the NSControl's cell.

+

See Also: -setCell: [NSCell-drawWithFrame:inView:]

+ */ - (void) drawCell: (NSCell *)aCell { if (_cell == aCell) @@ -515,6 +544,9 @@ static Class actionCellClass; } } +/**

Redraws a aCell's inside if it is the NSControl's cell.

+

See Also: -setCell: [NSCell-drawInteriorWithFrame:inView:]

+ */ - (void) drawCellInside: (NSCell *)aCell { if (_cell == aCell) @@ -524,7 +556,8 @@ static Class actionCellClass; } } -/**

Selects aCell if it's the NSControl's cell

+/**

Sets the aCell's state to NSOnState and marks self for display + if it is the NSControl's cell.

*/ - (void) selectCell: (NSCell *)aCell { @@ -535,22 +568,21 @@ static Class actionCellClass; } } - -/**

Marks self for display

+/**

Marks self for display.

*/ - (void) updateCell: (NSCell *)aCell { [self setNeedsDisplay: YES]; } -/**

Marks self for display

+/**

Marks self for display.

*/ - (void) updateCellInside: (NSCell *)aCell { [self setNeedsDisplay: YES]; } -/**

Returns the NSControl's cell action method

+/**

Returns the NSControl's cell action method.

See Also: -setAction: [NSCell-action]

*/ - (SEL) action @@ -559,8 +591,7 @@ static Class actionCellClass; } /**

Returns whether the NSControl's cell can continuously sends its action - message

-

See Also: -setContinuous: [NSCell-isContinuous]

+ message.

See Also: -setContinuous: [NSCell-isContinuous]

*/ - (BOOL) isContinuous { @@ -580,7 +611,7 @@ static Class actionCellClass; return [_cell sendActionOn: mask]; } -/**

Sets the NSControl's cell action method

+/**

Sets the NSControl's cell action method.

See Also: -action [NSCell-setAction:]

*/ - (void) setAction: (SEL)aSelector @@ -589,14 +620,14 @@ static Class actionCellClass; } /**

Sets whether the NSControl's cell can continuously sends its action - message

See Also: -isContinuous [NSCell-setContinuous:]

+ message.

See Also: -isContinuous [NSCell-setContinuous:]

*/ - (void) setContinuous: (BOOL)flag { [_cell setContinuous: flag]; } -/**

Sets the target object of the NSControl's cell to anObject

+/**

Sets the target object of the NSControl's cell to anObject.

See Also: -target [NSCell-setTarget:]

*/ - (void) setTarget: (id)anObject @@ -604,7 +635,7 @@ static Class actionCellClass; [_cell setTarget: anObject]; } -/**

Returns the target object of the NSControl's cell

+/**

Returns the target object of the NSControl's cell.

See Also: -setTarget: [NSCell-target]

*/ - (id) target @@ -642,8 +673,7 @@ static Class actionCellClass; return [selected attributedStringValue]; } -/** - * Assigning a Tag +/** Assigning a Tag */ - (void) setTag: (int)anInt { @@ -684,8 +714,8 @@ static Class actionCellClass; return [[self selectedCell] acceptsFirstResponder]; } -/* - * Tracking the Mouse +/** + * */ - (void) mouseDown: (NSEvent *)theEvent { @@ -777,11 +807,18 @@ static Class actionCellClass; [_cell resetCursorRect: _bounds inView: self]; } +/**

Returns wheter multiple clicks are ignored.

+

See Also: -setIgnoresMultiClick: -mouseDown:

+ */ - (BOOL) ignoresMultiClick { return _ignoresMultiClick; } + +/**

Sets wheter multiple clicks are ignored.

+

See Also: -ignoresMultiClick -mouseDown:

+ */ - (void) setIgnoresMultiClick: (BOOL)flag { _ignoresMultiClick = flag;