diff --git a/ChangeLog b/ChangeLog index 41dcae983..a4beb8853 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-24 fabien + + * Source/NSMatrix.m: Improved documentation, various cleanups + * Source/NSOpenPanel.m: Improved documentation + 2005-11-22 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index 934e839e3..4f42e771f 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -1590,22 +1590,25 @@ static SEL getSel; return [self previousKeyView]; } +/** + */ - (void) textDidBeginEditing: (NSNotification *)aNotification { - NSMutableDictionary *d; + NSMutableDictionary *dict; + + dict = [[NSMutableDictionary alloc] initWithDictionary: + [aNotification userInfo]]; + AUTORELEASE (dict); + [dict setObject: [aNotification object] forKey: @"NSFieldEditor"]; - d = [[NSMutableDictionary alloc] initWithDictionary: - [aNotification userInfo]]; - AUTORELEASE (d); - [d setObject: [aNotification object] forKey: @"NSFieldEditor"]; [nc postNotificationName: NSControlTextDidBeginEditingNotification object: self - userInfo: d]; + userInfo: dict]; } - (void) textDidChange: (NSNotification *)aNotification { - NSMutableDictionary *d; + NSMutableDictionary *dict; NSFormatter *formatter; // MacOS-X asks us to inform the cell if possible. @@ -1613,14 +1616,14 @@ static SEL getSel; @selector(textDidChange:)]) [_selectedCell textDidChange: aNotification]; - d = [[NSMutableDictionary alloc] initWithDictionary: + dict = [[NSMutableDictionary alloc] initWithDictionary: [aNotification userInfo]]; - AUTORELEASE (d); - [d setObject: [aNotification object] forKey: @"NSFieldEditor"]; + AUTORELEASE (dict); + [dict setObject: [aNotification object] forKey: @"NSFieldEditor"]; [nc postNotificationName: NSControlTextDidChangeNotification object: self - userInfo: d]; + userInfo: dict]; formatter = [_cell formatter]; if (formatter != nil) @@ -1979,6 +1982,10 @@ static SEL getSel; } } +/**

Draws the cell at row row and column column

+

See Also: [NSCell-drawWithFrame:inView:] -setDrawsCellBackground: + -drawsCellBackground

+ */ - (void) drawCellAtRow: (int)row column: (int)column { NSCell *aCell = [self cellAtRow: row column: column]; @@ -2024,6 +2031,10 @@ static SEL getSel; } } +/**

(Un)Highlights the cell (if exists ) at row at row row + and column column. and maks the cell rect for display.

+

See Also: -setNeedsDisplayInRect: [NSCell-setHighlighted:]

+ */ - (void) highlightCell: (BOOL)flag atRow: (int)row column: (int)column { NSCell *aCell = [self cellAtRow: row column: column]; @@ -2035,6 +2046,12 @@ static SEL getSel; } } +/**

Sends the cell action, if a NSMatrix's cell is selected + and enabled, sends the NSMatrix action otherwise. Returns YES if + the action is succesfully sent. NO if a cell is selected but not enabled + or if an action can not be sent.

+

See Also: -sendAction:to: -selectedCell

+ */ - (BOOL) sendAction { if (_selectedCell) @@ -2113,6 +2130,8 @@ static SEL getSel; } } +/** + */ - (void) sendDoubleAction { if ([_selectedCell isEnabled] == NO) @@ -2922,17 +2941,20 @@ static SEL getSel; return _action; } -/** - * Sets the message to send when a double click occurs.
- * NB: In GNUstep the following method does *not* set - * ignoresMultiClick to NO as in the MacOS-X spec.
- * It simply sets the doubleAction, as in OpenStep spec. +/**

Sets the message to send when a double click occurs. + NB: In GNUstep the following method does *not* set + ignoresMultiClick to NO as in the MacOS-X spec. + It simply sets the doubleAction, as in OpenStep spec.

+

-doubleAction

*/ - (void) setDoubleAction: (SEL)aSelector { _doubleAction = aSelector; } +/**

Returns the action method, used when the user double clicks

+

See Also: -setDoubleAction:

+ */ - (SEL) doubleAction { return _doubleAction; @@ -3013,11 +3035,17 @@ static SEL getSel; return _drawsCellBackground; } +/**

Sets whether the NSMatrix resizes its cells automatically

+

See Also: -autosizesCells

+ */ - (void) setAutosizesCells: (BOOL)flag { _autosizesCells = flag; } +/**

Returns whether the NSMatrix resizes its cells automatically

+

See Also: -autosizesCells

+ */ - (BOOL) autosizesCells { return _autosizesCells; diff --git a/Source/NSOpenPanel.m b/Source/NSOpenPanel.m index b2882ef77..e67796ebf 100644 --- a/Source/NSOpenPanel.m +++ b/Source/NSOpenPanel.m @@ -255,7 +255,8 @@ static NSOpenPanel *_gs_gui_open_panel = nil; } } -/**

Creates ( if needed ) and returns the shared NSOpenPanel instance

*/ +/**

Creates ( if needed ) and returns the shared NSOpenPanel instance.

+*/ + (NSOpenPanel *) openPanel { if (!_gs_gui_open_panel) @@ -288,8 +289,8 @@ static NSOpenPanel *_gs_gui_open_panel = nil; * Filtering Files */ /**

Allows the user to select multiple files if flag is YES. - The default behavior is not to allow multiple selections

-

See Also: -allowsMultipleSelection

+ The default behavior is not to allow multiple selections

See Also: + -allowsMultipleSelection [NSBrowser-setAllowsMultipleSelection:]

*/ - (void) setAllowsMultipleSelection: (BOOL)flag { @@ -297,17 +298,17 @@ static NSOpenPanel *_gs_gui_open_panel = nil; } /**

Returns YES if the user is allowed to select multiple files. The - default behavior is not to allow mutiple selections.

-

See Also: -setAllowsMultipleSelection:

+ default behavior is not to allow mutiple selections.

See Also: + -setAllowsMultipleSelection: [NSBrowser-allowsMultipleSelection]

*/ - (BOOL) allowsMultipleSelection { return [_browser allowsMultipleSelection]; } -/**

Allows the user to choose directories if flag is YES. The default - behavior is to allow choosing directories.

-

See Also: -canChooseDirectories

+/**

Allows the user to choose directories if flag is YES. The default + behavior is to allow choosing directories.

+

See Also: -canChooseDirectories [NSBrowser-setAllowsBranchSelection:]

*/ - (void) setCanChooseDirectories: (BOOL)flag { @@ -355,9 +356,9 @@ static NSOpenPanel *_gs_gui_open_panel = nil; return nil; } -/**

Returns an array containing the absolute paths (as NSString - objects) of the selected files and directories. If multiple - selections aren't allowed, the array contains a single name.

+/**

Returns an array containing the absolute paths (as NSString + objects) of the selected files and directories. If multiple + selections aren't allowed, the array contains a single name.

*/ - (NSArray *) filenames { @@ -420,9 +421,9 @@ static NSOpenPanel *_gs_gui_open_panel = nil; /* * Running the NSOpenPanel */ -/**

Displays the open panel in a modal session, filtering for - files that have the specified types

-

See Also: -runModalForDirectory:file:types:

+/**

Displays the open panel in a modal session, filtering for + files that have the specified types

+

See Also: -runModalForDirectory:file:types:

*/ - (int) runModalForTypes: (NSArray *)fileTypes {