This is ColorBrowserCell.m in view mode; [Download] [Up]
//--------------------------------------------------------------------------------------------------------- // // ColorBrowserCell // // Inherits From: NXBrowserCell // // Declared In: ColorBrowserCell.h // // Disclaimer // // You may freely copy, distribute and reuse this software and its // associated documentation. I disclaim any warranty of any kind, // expressed or implied, as to its fitness for any particular use. // //--------------------------------------------------------------------------------------------------------- #import "ColorBrowserCell.h" @implementation ColorBrowserCell //--------------------------------------------------------------------------------------------------------- // Initialization and Freeing //--------------------------------------------------------------------------------------------------------- - init { // Answers a new instance of ColorBrowserCell. [super init]; [self setTextColor: NX_COLORBLACK]; return self; } - initTextCell:(const char *)aString { // Answers a new instance of ColorBrowserCell. [super initTextCell: aString]; [self setTextColor: NX_COLORBLACK]; return self; } //--------------------------------------------------------------------------------------------------------- // Accessor Methods //--------------------------------------------------------------------------------------------------------- - (NXColor) textColor { return textColor; } - setTextColor: (NXColor) aColor { textColor = aColor; return self; } //--------------------------------------------------------------------------------------------------------- // Archiving //--------------------------------------------------------------------------------------------------------- - read: (NXTypedStream*) stream { [super read: stream]; textColor = NXReadColor (stream); return self; } - write: (NXTypedStream*) stream { [super write: stream]; NXWriteColor (stream, textColor); return self; } //--------------------------------------------------------------------------------------------------------- // //--------------------------------------------------------------------------------------------------------- - setTextAttributes: aTextObject { // This method is the key to this class' behavior. This method is called during // every drawInside: inView call. It asks for the current Text object. This // determines how the Cell's text will be displayed. Subclasses of Cell // override this method to get unique characteristics. [super setTextAttributes: aTextObject]; [aTextObject setTextColor: textColor]; return aTextObject; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.