Release 0.1  Copyright ã1994 by Todd Thomas.  All Wrongs Reversed.

MiscIconWell

Inherits From:	MiscImageView : MiscDragView : View : Responder : Object

Declared In:	misckit/MiscIconWell.h

Protocols:	none

Class Description

A general purpose IconWell that allows you to graphically display a filename via its icon representation. The image (and its associated filename) can either be set by dragging a new icon into it, or through setImageByFilename:. It accepts pasteboard data as long as it is of the NXFilenamePboardType type. Through the inherited methods in MiscDragView, you can set whether your IconWell will handle "incoming" or "outgoing" icons, along with a host of other drag options.

Instance Variables

id filename;
BOOL allowDoubleClickLaunch;

filename 	Filename of the current icon representation in the view.

allowDoubleClickLaunch 	Determines whether an icon can be opened in Workspace via a double click.

Method Types

Initializing a MiscIconWell	± initFrame
	± awake

Setting the icon 	± setImageByFilename:
	± filename:

Options	± setAllowDoubleClickLaunch:
	± allowDoubleClickLaunch

Source dragging methods	± mouseDown:
	± setupForSourceDrag

Destination dragging methods	± performDragOperation:
	± concludeDragOperation:
	
Saving to a file	± read:
	± write:

Instance Methods

allowDoubleClickLaunch
- (BOOL)allowDoubleClickLaunch

Returns YES if double clicking on the icon should launch it in Workspace.

awake
-awake

Further initializes the MiscIconWell and its instance variables after an unarchiving. Returns self.

concludeDragOperation:
- concludeDragOperation: sender

Overridden to read the filename from the NXDragPboard pasteboard, and display the new icon image. Returns self.

filename
- (char *)filename

Returns the filename associated with the icon displayed within the IconWell. If there is no icon currently in the view, nil is returned.

See also:  -setImageByFilename

initFrame:
- initFrame: (BOOL)frameRect

Initializes the view, with allowDoubleClick set to YES. Returns self.

See also:  -awake

mouseDown:
- mouseDown:(NXEvent *)theEvent

Overidden to check whether the icon was double clicked. If not, then the mouseDown is passed up the heirarchy. If it detects a double click then the file is opened via Workspace.app.

performDragOperation:
- (BOOL)performDragOperation: sender

Overridden to check whether there is a filename on the pasteboard. If there is, it returns YES. Returns self.

read:
- read:(NXTypedStream *)stream

Unarchives a MiscIconWell object. Returns self.

See also:  -write

setAllowDoubleClickLaunch:
- setAllowDoubleClickLaunch: (BOOL)aBool

Sets whether to allow the user to double click on the icon in the view, and have the Workspace open it.

See also:  -allowDoubleClickLaunch

setImageByFilename:
- setImageByFilename:(char *)aFilename

Sets the image to the icon representatiion for aFilename. If aFilename happens to be multiple files, then the view sneaks the multiple.tiff  image (the one with the cards on it) from Librarian.app and displays that. If aFilename is only one file, then the workspace is asked for its image representation and it is displayed. Returns self.

See also:  -filename

setupForSourceDrag
- setupForSourceDrag

Overridden from MiscDragView to put the filename onto the pasteboard (NXFilenamePboardType). This also takes care to remove the image if retainData is set to NO. Returns YES.

write:
- write:(NXTypedStream *)stream

Archives a MiscIconWell object. Returns self.

See also:  -read: