Version 1.2  Copyright ã1993 by University of Houston.  All Rights Reserved.

	UHSelectView
	
		INHERITS FROM 			View:Responder:Object
		
		DECLARED IN				UHSelectView.h
				
		AUTHOR					Department of Electrical Engineering
									University of Houston, Houston, TX 77204
									info@uhoop.egr.uh.edu

		CLASS DESCRIPTION
		
UHSelectView can be used to implement "inspector" panels such as that used in Interface Builder.  A UHSelectView object maintains a list of pointers to several views provided by messages to setView:number:, or by messages to setViewnn: if the views were connected to viewnn outlets in Interface Builder.   Each view is later selected for display by its corresponding "number" using the selectViewNumber: message, or using the takeIntValueFrom: and takeTagFrom: messages from control objects.  When the view is selected, it is removed from its superview and inserted as a subview of the UHSelectView object at a position determined by a previous call to setPosition:.  When a new view is selected, the view currently being displayed is first removed from the UHSelectView and reinserted into its previous superview at its previous frame position, although not necessarily at the previous position in the view hierarchy.  All colorwells in the view being removed are deactivated.

If no view has yet been selected, or if a nonexistent view number is passed to selectViewNumber:, then it is considered that there is no currently selected view.  In this case, if a defaultView has been set via setDefaultView: or in IB, that view is displayed.  Otherwise, a general default image is drawn using drawDefault.

Each time a view is selected, the UHSelectView's delegate is notified via the viewWasSelected: message.  The delegate can then obtain the number of the view just selected using the viewNumber message to sender.
			
		INSTANCE VARIABLES
	
				Inherited from Object		Class	                                 isa;
				
			Inherited from Responder	id	nextResponder;
			
			Inherited from View		NXRect	frame;
									NXRect	bounds;
									id		superview;
									id		subviews;
									id		window;
									struct __vFlags	vFlags;
									
				Declared in UHSelectView    	id 	view0 - view25; 
									id	defaultView;
									id	delegate;
									List *	views;
									Storage *	viewNos;
									View *	currentView;
									View *	currentSuperView;
									NXRect	currentFrame;
									int 	viewNumber;
									int	position;
									BOOL	isframed;
									
		METHOD TYPES
				
				Initializing a new UHSelectView object	- initFrame:
				
				Freeing a UHSelectView object		- free
				
				Drawing the view					- drawSelf::
											- drawDefault
											- makeFramed:
											- (BOOL)isFramed
											
				Adding views to the SelectView		- setView:number:
											- viewWithNumber:
											- viewCount
											- setDefaultView:
											- defaultView
											
				Selecting a view					- selectViewNumber:
											- takeIntValueFrom:
											- takeTagFrom:
											- viewNumber
											
				Positioning the view in the UHSelectView	- setPosition:
											- position

			Archiving						- read:
											- write:
											- awakeFromNib
											
														INSTANCE METHODS

			awakeFromNib
					- awakeFromNib
					
Called when a UHSelectView object is unarchived from a nib file.  Calls selectViewNumber: with a view number of 0 (zero).  If a view has been connected to view00 in Interface Builder, that view will be displayed initially, else the defaultView if there is a connection to it in IB.  If there are no connections to either view00 or defaultView, then the standard default will be drawn.
	
See also:  - selectViewNumber:, - drawDefault

			defaultView
					- defaultView
					
Returns the defaultView if one has been set, else returns nil.					
See also:  - setDefaultView:

			drawDefault
					- drawDefault
					
Called by drawSelf:: to draw the default used when there is no view selected and there is no specifically designated defaultView.  This default consists of a light gray background and the word "UHSelectView" centered in the UHSelectView.  You should not call this method yourself, but you might override it to get a different default.  Returns self.

See also:  - setDefaultView:

			drawSelf::
					- drawSelf:(const NXRect *)rects :(int)rectCount
					
Draws a light gray background and the frame rectangle of the UHSelectView if it is to be framed.  Calls drawDefault if there is no view currently selected and there is no defaultView.  Returns self.
					
See also:  - drawDefault
			
			initFrame:
					- initFrame:(NXRect *)frameRect
					
Initializes the UHSelectView instance.  The View's frame rectangle is made equivalent to that pointed to by frameRect.  It also initializes position to CENTER, and isFramed to YES.  Returns self.
					
See also:  - setPosition:, - makeFramed:
					
			isFramed
					- (BOOL)isFramed
					
Returns the value of the instance variable isFramed.

See also: - makeFramed:

			makeFramed:
					- makeFramed:(BOOL)flag
					
Sets the value of the instance variable isFramed, which is a flag used to indicate whether a frame should be drawn around the UHSelectView.  Redisplays the UHSelectView and returns self.

			position
					- (int)position
					
Returns an integer representing the position of the selected view.  See the setPosition: method for possible position values.
					
See also: - setPosition:
					
			read:
					- read:(NXTypedStream *)stream
					
Reads the UHSelectView from the typed stream stream.  Returns self.
					
			selectViewNumber:
					- selectViewNumber:(int)number
					
Selects the view corresponding to number as the currently selected view and displays it at the proper position.  If there is no view corresponding to number, then there is considered to be no currently selected view, and the default is drawn.  Returns self.

See also: - takeIntValueFrom:, - takeTagFrom:
					
			setDefaultView:
					- setDefaultView:aView
					
Sets the view to be used as the default view displayed when there is no view selected.  Since this takes the view from its previous superview, it is generally not possible to have the same default view shared by multiple instances of UHSelectView.  Returns self if aView is a View, else returns nil.					
See also:  - drawDefault

				setPosition:
					- setPosition:(int)aPosition
					
Sets the position within the UHSelectView where the selected view will be displayed.  Returns self.
					
aPosition value		Meaning
UHSV_TOPLEFT	The top left corner of the UHSelectView.
UHSV_TOPCENTER	The top center of the UHSelectView.
UHSV_TOPRIGHT	The top right corner of the UHSelectView.
UHSV_LEFT		The left center of the UHSelectView.
UHSV_CENTER	The center of the UHSelectView.
UHSV_RIGHT		The right center of the UHSelectView.
UHSV_BOTTOMLEFT	The bottom left corner of the UHSelectView.
UHSV_BOTTOMCENTER	The bottom center of the UHSelectView.
UHSV_BOTTOMRIGHT	The bottom right corner of the UHSelectView.

				setView:number:
					- setView:aView number:(int)number
					
Sets aView as the view to be selected by number.  If there is already a view corresponding to number, it is replaced by aView.  The value of number must be non-negative.  Returns self if aView is a View and number is non-negative, else returns nil.
					
			takeIntValueFrom:
					- takeIntValueFrom:sender
					
Action method which takes the view number from sender (via an intValue message) and then selects the corresponding view for display by a call to the selectViewNumber: method.  Returns self.

See also: - selectViewNumber:, - takeTagFrom:
					
			takeTagFrom:
					- takeViewFrom:sender
					
Action method which takes the view number from sender (via a selectedTag message) and then selects the corresponding view for display by a call to the selectViewNumber: method.  Returns self.

See also: - selectViewNumber:, - takeIntValueFrom:

				viewNumber
					- (int)viewNumber
					
Returns the integer value of the instance variable viewNumber corresponding to the currently selected view.  Returns -1 if there is no currently selected view.
	
				write:
					- write:(NXTypedStream *)stream
					
Writes the receiving UHSelectView to the typed stream stream.  This method only writes the variables initialized in init and those set in the IB inspector:  isFramed, position, views, and viewNos.  Does not write the selectable subviews. 

				METHODS IMPLEMENTED BY THE DELEGATE
				
				viewWasSelected:
					- viewWasSelected:sender
					
Sent to the delegate whenever the selected view of the UHSelectView is changed.  The delegate can find the number of the newly selected view using a viewNumber message to the UHSelectView.  
					
See also: - viewNumber