diff --git a/ChangeLog b/ChangeLog index 955eec5e7..df8161030 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-16 fabien + + * Source/NSColorPanel.m : Improved documentation + * Source/NSColorWell.m : Improved documentation + 2005-11-16 Richard Frith-Macdonald * Source/GSEPSPrintOperation.m: diff --git a/Source/NSColorPanel.m b/Source/NSColorPanel.m index daff97bac..2c6d0964b 100644 --- a/Source/NSColorPanel.m +++ b/Source/NSColorPanel.m @@ -363,6 +363,8 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; @end +/**

TODO Description

+ */ @implementation NSColorPanel /* @@ -378,6 +380,8 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; } } +/**

Creates ( if needed ) and returns the shared NSColorPanel

+ */ + (NSColorPanel *)sharedColorPanel { if (_gs_gui_color_panel == nil) @@ -395,6 +399,8 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; return _gs_gui_color_panel; } +/**

Returns whether the NSColorPanel has been already created

+ */ + (BOOL) sharedColorPanelExists { return (_gs_gui_color_panel == nil) ? NO : YES; @@ -478,16 +484,26 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; [super dealloc]; } +/**

Returns the NSColorPanel's accessory view if it exists, + nil otherwise

See Also: -setAccessoryView:

+ */ - (NSView *) accessoryView { return _accessoryView; } +/**

Returns whether the NSColorPanel continuously sends the action message. + The default is ...

See Also: -setContinuous:-setAction: -setTarget: +

+ */ - (BOOL) isContinuous { return _isContinuous; } +/**

Returns the current mode of the NSColorPanel.

+

See Also: -setMode:

+ */ - (int) mode { if (_currentPicker != nil) @@ -496,6 +512,11 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; return 0; } +/**

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

+

See Also: -accessoryView

+ */ - (void) setAccessoryView: (NSView *)aView { if (_accessoryView == aView) @@ -512,11 +533,17 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; _action = aSelector; } +/**

Sets whether the NSColorPanel sends continuously action messages

+

See Also: -isContinuous

+ */ - (void) setContinuous: (BOOL)flag { _isContinuous = flag; } +/**

Set the NSColorPanel mode to mode. TODO more about _pickers

+

See Also: -mode

+ */ - (void) setMode: (int)mode { int i, count; @@ -605,11 +632,18 @@ static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; return 1.0; } +/**

Returns the current NSColor displayed by the NSColorPanel

+

See Also : -setColor:

+ */ - (NSColor *) color { return [_colorWell color]; } +/**

Sets the NSColor displayed to aColor. This method post a + NSColorPanelColorChangedNotification notification

+

See Also: -color

+*/ - (void) setColor: (NSColor *)aColor { [_colorWell setColor: aColor]; diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 66b8fa99c..de25b5218 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -71,6 +71,11 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = return _action; } +/**

Activates the NSColorWell and displays the NSColorPanel with the current + NSColorWell's color. + If exclusive is YES other NSColorWells are desacivate (through notification) +

See Also: -deactivate

+ */ - (void) activate: (BOOL)exclusive { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; @@ -100,11 +105,18 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = [self setNeedsDisplay: YES]; } +/**

Returns the current NSColor of the NSColorWell

+

See Also: -setColor:

+ */ - (NSColor *) color { return _the_color; } +/**

Desactivates the NSColorWell and marks self for display. + It is usally call from an observer, when another NSColorWell is + activate

See Also: -activate:

+ */ - (void) deactivate { _is_active = NO; @@ -260,11 +272,17 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = return self; } +/**

Returns whether the NSColorWell is active

+

See Also: -activate: -deactivate

+ */ - (BOOL) isActive { return _is_active; } +/**

Returns whether the NSColorWell has border

+

See Also: -setBordered:

+ */ - (BOOL) isBordered { return _is_bordered; @@ -322,12 +340,19 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = _action = action; } +/**

Sets whether the NSColorWell has border and marks self for display

+

See Also: -isBordered

+ */ - (void) setBordered: (BOOL)bordered { _is_bordered = bordered; [self setNeedsDisplay: YES]; } +/**

Sets the NSColorWell to color. Sets the NSColorPanel if active, + notify the target of color change and marks self to display

+

See Also: -color

+ */ - (void) setColor: (NSColor *)color { ASSIGN(_the_color, color);