Release 1.0  · Copyright 1992, 1993 by Max Tardiveau.

InformerInspector

INHERITS FROM	Object

DECLARED IN	InformerInspector.h

CLASS DESCRIPTION

InformerInspector is an abstract superclass for Informer inspectors. It provides a number of methods, some of which must be overridden to make a useful inspector.

See also : InformerCell, InformerWindow

INSTANCE VARIABLES

Inherited from Object	Class	isa;

Defined in InformerInspector	id 	MyView;
id	MyMaster;

MyView	The view in which all the drawing is done. Its size must be at least w550 x h350, but anything more than that will not appear in the Informer window.

MyMaster	Initialized to the InformerWindow which created the instance. This is useful when the inspector needs to call on it for displaying an error message, for instance.

METHOD TYPES

Doing updates	± fillList:fromCell:
± doUpdateForCell:

General housekeeping	- loadEverythingFrom:
- fillSubList:ofCell:pointer:
- fillSubList:ofCell:pointer:string:

Miscellaneous	± mainView
± setMaster:
± updateInterval

INSTANCE METHODS

doUpdateForCell:
- doUpdateForCell:InformerCell

Does nothing. Returns self. 
You always override this method. It is called by the InformerWindow when the inspector should update its display. Put all the display code here.

fillList:fromCell:
- fillList:matrix fromCell:InformerCell

Does nothing. Returns self.
Override this for inspectors that list items. InformerCell is the InformerCell that caused this method to be called. A minimal implementation could be :

- fillList:theMatrix fromCell:theCell
{
id	newCell;
int	i, cellCount;
char	items[] = {"Item 1", "Item 2", "Item 3"};

if ([theCell updater])		// It's an item
	{
	[self fillSubList:theMatrix ofCell:theCell pointer:[theCell freePointer]];
	return self;
	}

for (i = 0; i < 3; i++)
	{
	[theMatrix addRow];
	cellCount = [theMatrix cellCount];
	newCell = [theMatrix cellAt:(cellCount - 1) :0];
	[newCell setStringValue:items[i]];
	[newCell setFreePointer:(void *)i];
	[newCell setUpdater:self];
	[newCell setDir:[theCell getDir]];
	}
[theCell setMasterInstance:self];
return self;
}

Note that each cell that you add to the matrix must be self-sufficient, that is, it must contain all the information that you will eventually need later on to display information about it. See the description of the class InformerCell for more information.

fillSubList:ofCell:pointer:
- fillSubList:matrix ofCell:InformerCell pointer:(void *)pointer

This method is just the equivalent of fillSubList:ofCell:pointer:string: with an empty string argument.
Returns self. 

fillSubList:ofCell:pointer:string:
- fillSubList:matrix ofCell:InformerCell pointer:(void *)pointer string:(char *)string

You rarely override this method. It is normally called from fillList:fromCell: to fill the list with the files in the current directory. pointer and string are passed to the InformerCells created at this occasion, in setFreePointer: and setFreeString: respectively.
Returns self.

loadEverythingFrom:
- loadEverythingFrom:(char *)directory

This method loads the Main.nib file in directory, with owner self. You may want to override this method to do additional initialization after the .nib file has been loaded.
Returns self. 

mainView
- mainView

Returns MyView.

setMaster:
- setMaster:InformerWindow

Sets MyMaster to InformerWindow.
Returns self.

updateInterval
- (int)updateInterval

Returns 0. If your inspector could benefit from periodical updates, you should override this method and return the number of seconds between updates. Some inspectors may require updates every second. Others may need updates only every minute. In any case, the user can modify this value using the slider in the InformerWindow, but that value is not saved.