Improved documentation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22088 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fabien Vallon 2005-11-24 09:11:43 +00:00
parent 4389009b89
commit d269303a22
3 changed files with 64 additions and 30 deletions

View file

@ -1,3 +1,8 @@
2005-11-24 fabien <fabien@sonappart.net>
* Source/NSMatrix.m: Improved documentation, various cleanups
* Source/NSOpenPanel.m: Improved documentation
2005-11-22 Richard Frith-Macdonald <rfm@gnu.org> 2005-11-22 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Additions/GNUstepGUI/GSDrawFunctions.h: * Headers/Additions/GNUstepGUI/GSDrawFunctions.h:

View file

@ -1590,22 +1590,25 @@ static SEL getSel;
return [self previousKeyView]; return [self previousKeyView];
} }
/**
*/
- (void) textDidBeginEditing: (NSNotification *)aNotification - (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 [nc postNotificationName: NSControlTextDidBeginEditingNotification
object: self object: self
userInfo: d]; userInfo: dict];
} }
- (void) textDidChange: (NSNotification *)aNotification - (void) textDidChange: (NSNotification *)aNotification
{ {
NSMutableDictionary *d; NSMutableDictionary *dict;
NSFormatter *formatter; NSFormatter *formatter;
// MacOS-X asks us to inform the cell if possible. // MacOS-X asks us to inform the cell if possible.
@ -1613,14 +1616,14 @@ static SEL getSel;
@selector(textDidChange:)]) @selector(textDidChange:)])
[_selectedCell textDidChange: aNotification]; [_selectedCell textDidChange: aNotification];
d = [[NSMutableDictionary alloc] initWithDictionary: dict = [[NSMutableDictionary alloc] initWithDictionary:
[aNotification userInfo]]; [aNotification userInfo]];
AUTORELEASE (d); AUTORELEASE (dict);
[d setObject: [aNotification object] forKey: @"NSFieldEditor"]; [dict setObject: [aNotification object] forKey: @"NSFieldEditor"];
[nc postNotificationName: NSControlTextDidChangeNotification [nc postNotificationName: NSControlTextDidChangeNotification
object: self object: self
userInfo: d]; userInfo: dict];
formatter = [_cell formatter]; formatter = [_cell formatter];
if (formatter != nil) if (formatter != nil)
@ -1979,6 +1982,10 @@ static SEL getSel;
} }
} }
/**<p>Draws the cell at row <var>row</var> and column <var>column</var></p>
<p>See Also: [NSCell-drawWithFrame:inView:] -setDrawsCellBackground:
-drawsCellBackground</p>
*/
- (void) drawCellAtRow: (int)row column: (int)column - (void) drawCellAtRow: (int)row column: (int)column
{ {
NSCell *aCell = [self cellAtRow: row column: column]; NSCell *aCell = [self cellAtRow: row column: column];
@ -2024,6 +2031,10 @@ static SEL getSel;
} }
} }
/** <p>(Un)Highlights the cell (if exists ) at row at row <var>row</var>
and column <var>column</var>. and maks the cell rect for display.</p>
<p>See Also: -setNeedsDisplayInRect: [NSCell-setHighlighted:]</p>
*/
- (void) highlightCell: (BOOL)flag atRow: (int)row column: (int)column - (void) highlightCell: (BOOL)flag atRow: (int)row column: (int)column
{ {
NSCell *aCell = [self cellAtRow: row column: column]; NSCell *aCell = [self cellAtRow: row column: column];
@ -2035,6 +2046,12 @@ static SEL getSel;
} }
} }
/**<p>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.</p>
<p>See Also: -sendAction:to: -selectedCell</p>
*/
- (BOOL) sendAction - (BOOL) sendAction
{ {
if (_selectedCell) if (_selectedCell)
@ -2113,6 +2130,8 @@ static SEL getSel;
} }
} }
/**
*/
- (void) sendDoubleAction - (void) sendDoubleAction
{ {
if ([_selectedCell isEnabled] == NO) if ([_selectedCell isEnabled] == NO)
@ -2922,17 +2941,20 @@ static SEL getSel;
return _action; return _action;
} }
/** /** <p>Sets the message to send when a double click occurs.
* Sets the message to send when a double click occurs.<br /> NB: In GNUstep the following method does *not* set
* NB: In GNUstep the following method does *not* set ignoresMultiClick to NO as in the MacOS-X spec.
* ignoresMultiClick to NO as in the MacOS-X spec.<br /> It simply sets the doubleAction, as in OpenStep spec.</p>
* It simply sets the doubleAction, as in OpenStep spec. <p>-doubleAction</p>
*/ */
- (void) setDoubleAction: (SEL)aSelector - (void) setDoubleAction: (SEL)aSelector
{ {
_doubleAction = aSelector; _doubleAction = aSelector;
} }
/** <p>Returns the action method, used when the user double clicks</p>
<p>See Also: -setDoubleAction:</p>
*/
- (SEL) doubleAction - (SEL) doubleAction
{ {
return _doubleAction; return _doubleAction;
@ -3013,11 +3035,17 @@ static SEL getSel;
return _drawsCellBackground; return _drawsCellBackground;
} }
/** <p>Sets whether the NSMatrix resizes its cells automatically</p>
<p>See Also: -autosizesCells</p>
*/
- (void) setAutosizesCells: (BOOL)flag - (void) setAutosizesCells: (BOOL)flag
{ {
_autosizesCells = flag; _autosizesCells = flag;
} }
/** <p>Returns whether the NSMatrix resizes its cells automatically</p>
<p>See Also: -autosizesCells</p>
*/
- (BOOL) autosizesCells - (BOOL) autosizesCells
{ {
return _autosizesCells; return _autosizesCells;

View file

@ -255,7 +255,8 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
} }
} }
/**<p> Creates ( if needed ) and returns the shared NSOpenPanel instance</p> */ /**<p>Creates ( if needed ) and returns the shared NSOpenPanel instance.</p>
*/
+ (NSOpenPanel *) openPanel + (NSOpenPanel *) openPanel
{ {
if (!_gs_gui_open_panel) if (!_gs_gui_open_panel)
@ -288,8 +289,8 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
* Filtering Files * Filtering Files
*/ */
/**<p> Allows the user to select multiple files if flag is YES. /**<p> Allows the user to select multiple files if flag is YES.
The default behavior is not to allow multiple selections</p> The default behavior is not to allow multiple selections</p><p>See Also:
<p>See Also: -allowsMultipleSelection</p> -allowsMultipleSelection [NSBrowser-setAllowsMultipleSelection:]</p>
*/ */
- (void) setAllowsMultipleSelection: (BOOL)flag - (void) setAllowsMultipleSelection: (BOOL)flag
{ {
@ -297,17 +298,17 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
} }
/**<p>Returns YES if the user is allowed to select multiple files. The /**<p>Returns YES if the user is allowed to select multiple files. The
default behavior is not to allow mutiple selections.</p> default behavior is not to allow mutiple selections.</p><p>See Also:
<p>See Also: -setAllowsMultipleSelection:</p> -setAllowsMultipleSelection: [NSBrowser-allowsMultipleSelection]</p>
*/ */
- (BOOL) allowsMultipleSelection - (BOOL) allowsMultipleSelection
{ {
return [_browser allowsMultipleSelection]; return [_browser allowsMultipleSelection];
} }
/** <p>Allows the user to choose directories if flag is YES. The default /**<p>Allows the user to choose directories if flag is YES. The default
behavior is to allow choosing directories.</p> behavior is to allow choosing directories.</p>
<p>See Also: -canChooseDirectories</p> <p>See Also: -canChooseDirectories [NSBrowser-setAllowsBranchSelection:]</p>
*/ */
- (void) setCanChooseDirectories: (BOOL)flag - (void) setCanChooseDirectories: (BOOL)flag
{ {
@ -355,9 +356,9 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
return nil; return nil;
} }
/** <p>Returns an array containing the absolute paths (as NSString /**<p>Returns an array containing the absolute paths (as NSString
objects) of the selected files and directories. If multiple objects) of the selected files and directories. If multiple
selections aren't allowed, the array contains a single name.</p> selections aren't allowed, the array contains a single name.</p>
*/ */
- (NSArray *) filenames - (NSArray *) filenames
{ {
@ -420,9 +421,9 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
/* /*
* Running the NSOpenPanel * Running the NSOpenPanel
*/ */
/** <p>Displays the open panel in a modal session, filtering for /**<p>Displays the open panel in a modal session, filtering for
files that have the specified types </p> files that have the specified types </p>
<p>See Also: -runModalForDirectory:file:types:</p> <p>See Also: -runModalForDirectory:file:types:</p>
*/ */
- (int) runModalForTypes: (NSArray *)fileTypes - (int) runModalForTypes: (NSArray *)fileTypes
{ {