Improved documentation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22022 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fabien_ 2005-11-16 16:40:37 +00:00
parent 6988bf34c2
commit 296b84c827
3 changed files with 64 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2005-11-16 fabien <fabien@sonappart.net>
* Source/NSColorPanel.m : Improved documentation
* Source/NSColorWell.m : Improved documentation
2005-11-16 Richard Frith-Macdonald <rfm@gnu.org> 2005-11-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSEPSPrintOperation.m: * Source/GSEPSPrintOperation.m:

View file

@ -363,6 +363,8 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
@end @end
/**<p>TODO Description</p>
*/
@implementation NSColorPanel @implementation NSColorPanel
/* /*
@ -378,6 +380,8 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
} }
} }
/**<p>Creates ( if needed ) and returns the shared NSColorPanel</p>
*/
+ (NSColorPanel *)sharedColorPanel + (NSColorPanel *)sharedColorPanel
{ {
if (_gs_gui_color_panel == nil) if (_gs_gui_color_panel == nil)
@ -395,6 +399,8 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
return _gs_gui_color_panel; return _gs_gui_color_panel;
} }
/** <p>Returns whether the NSColorPanel has been already created</p>
*/
+ (BOOL) sharedColorPanelExists + (BOOL) sharedColorPanelExists
{ {
return (_gs_gui_color_panel == nil) ? NO : YES; return (_gs_gui_color_panel == nil) ? NO : YES;
@ -478,16 +484,26 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
[super dealloc]; [super dealloc];
} }
/** <p>Returns the NSColorPanel's accessory view if it exists,
nil otherwise</p><p>See Also: -setAccessoryView:</p>
*/
- (NSView *) accessoryView - (NSView *) accessoryView
{ {
return _accessoryView; return _accessoryView;
} }
/** <p> Returns whether the NSColorPanel continuously sends the action message.
The default is ... </p><p>See Also: -setContinuous:-setAction: -setTarget:
</p>
*/
- (BOOL) isContinuous - (BOOL) isContinuous
{ {
return _isContinuous; return _isContinuous;
} }
/** <p> Returns the current mode of the NSColorPanel.</p>
<p>See Also: -setMode:</p>
*/
- (int) mode - (int) mode
{ {
if (_currentPicker != nil) if (_currentPicker != nil)
@ -496,6 +512,11 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
return 0; return 0;
} }
/**<p> Sets the accessoryView to a view. The old view ( if exists ) will be
remove ( and release ). You need to retain it if you want to use
it later</p>
<p>See Also: -accessoryView</p>
*/
- (void) setAccessoryView: (NSView *)aView - (void) setAccessoryView: (NSView *)aView
{ {
if (_accessoryView == aView) if (_accessoryView == aView)
@ -512,11 +533,17 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
_action = aSelector; _action = aSelector;
} }
/** <p>Sets whether the NSColorPanel sends continuously action messages</p>
<p>See Also: -isContinuous</p>
*/
- (void) setContinuous: (BOOL)flag - (void) setContinuous: (BOOL)flag
{ {
_isContinuous = flag; _isContinuous = flag;
} }
/** <p>Set the NSColorPanel mode to mode. TODO more about _pickers</p>
<p>See Also: -mode</p>
*/
- (void) setMode: (int)mode - (void) setMode: (int)mode
{ {
int i, count; int i, count;
@ -605,11 +632,18 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel;
return 1.0; return 1.0;
} }
/** <p>Returns the current NSColor displayed by the NSColorPanel</p>
<p>See Also : -setColor:</p>
*/
- (NSColor *) color - (NSColor *) color
{ {
return [_colorWell color]; return [_colorWell color];
} }
/** <p>Sets the NSColor displayed to aColor. This method post a
NSColorPanelColorChangedNotification notification</p>
<p>See Also: -color</p>
*/
- (void) setColor: (NSColor *)aColor - (void) setColor: (NSColor *)aColor
{ {
[_colorWell setColor: aColor]; [_colorWell setColor: aColor];

View file

@ -71,6 +71,11 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
return _action; return _action;
} }
/**<p>Activates the NSColorWell and displays the NSColorPanel with the current
NSColorWell's color.
If exclusive is YES other NSColorWells are desacivate (through notification)
</p><p>See Also: -deactivate</p>
*/
- (void) activate: (BOOL)exclusive - (void) activate: (BOOL)exclusive
{ {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
@ -100,11 +105,18 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
} }
/**<p> Returns the current NSColor of the NSColorWell</p>
<p> See Also: -setColor:</p>
*/
- (NSColor *) color - (NSColor *) color
{ {
return _the_color; return _the_color;
} }
/** <p>Desactivates the NSColorWell and marks self for display.
It is usally call from an observer, when another NSColorWell is
activate</p><p>See Also: -activate:</p>
*/
- (void) deactivate - (void) deactivate
{ {
_is_active = NO; _is_active = NO;
@ -260,11 +272,17 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
return self; return self;
} }
/** <p>Returns whether the NSColorWell is active</p>
<p>See Also: -activate: -deactivate</p>
*/
- (BOOL) isActive - (BOOL) isActive
{ {
return _is_active; return _is_active;
} }
/** <p>Returns whether the NSColorWell has border</p>
<p>See Also: -setBordered:</p>
*/
- (BOOL) isBordered - (BOOL) isBordered
{ {
return _is_bordered; return _is_bordered;
@ -322,12 +340,19 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
_action = action; _action = action;
} }
/**<p>Sets whether the NSColorWell has border and marks self for display</p>
<p>See Also: -isBordered</p>
*/
- (void) setBordered: (BOOL)bordered - (void) setBordered: (BOOL)bordered
{ {
_is_bordered = bordered; _is_bordered = bordered;
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
} }
/** <p>Sets the NSColorWell to color. Sets the NSColorPanel if active,
notify the target of color change and marks self to display</p>
<p>See Also: -color</p>
*/
- (void) setColor: (NSColor *)color - (void) setColor: (NSColor *)color
{ {
ASSIGN(_the_color, color); ASSIGN(_the_color, color);