This is MiscFramingView.rtf in view mode; [Download] [Up]
DMA Release 0.8 Copyright ©1994 by Genesis Project, Ltd. All Rights Reserved. MiscFramingView Inherits From: MiscTargetActionView : View : Responder : Object Declared In: misckit/MiscFramingView.h Class Description The MiscFramingView is somewhat like a Box in that it suppies a frame around it's content view. The similarity pretty much stops there. It is more like a picture frame that automatically centers, justifies and resizes whatever content view it is given. A MiscFramingView can only have one subview, and that is the content view. This makes a MiscFramingView somewhat like a window except that it can sit inside of a window or another view. The content view itself may of course have as many subviews as desired. The content view may be justified to any corner or to the center of the screen; it can be left at its original (actual) size; returned to the original size after scaling has been done; or scaled so that either the content views largest or smallest dimension exactly fits the view size. Also note that since MiscFramingViews are a subclass of the MiscTargetActionView, they can be used in a target-action mode triggered by key strokes and mouse events (see MiscTargetActionView). The following example shows how simple the MiscFramingView is to use. In most cases you won't even need to do any of the set methods. In this case, aView will be left at it's current size and will be justified to the upper left corner of the frame. Any space not covered by aView will show up in dark gray. A line boundary is then drawn around the frame. [frameView setResizing: MISC_FV_NOFIT]; [frameview setOutline: MISC_FV_OUTLINE]; [frameview setBackgroundGray: NX_DKGRAY]; [frameview setJustification: MISC_FV_UL]; [frameView setContentView: aView]; [frameView display]; Instance Variables float backgroundGray; int justification; int resizing; int outline; id contentView; float outlineWidth; backgroundGray Background greyscale value. justification Type of justification in use. resizing Type of resizing in use. outline Type of outline in use . contentView The content view of the MiscFramingView. outlineWidth Width of lines in the outline, if applicable. Method Types Initialization - initFrame: - free Displaying - drawSelf:: Controlling the frame and content - setContentView: - contentView - backgroundGray - setBackgroundGray: - outline - setOutline: - justification; - setJustification: - resizing; - setResizing: Disabled View methods - addSubview: - addSubview: :relativeTo: - replaceSubview:with: Modified View Methods - rotateTo: - sizeTo:width : - descendantFrameChanged: Archiving - awake - read: - write: Instance Methods addSubview: - addSubview:aView The standard View class ability to add subviews is suppresed in the MiscFramingView. They have only one subview and that is set with the ±setContentView: method. Returns self. See also: - addSubview:relativeTo:, - setContentView:, - replaceSubview:with: addSubview::relativeTo: - addSubview:aView :(int)place relativeTo:otherView The standard View class ability to add subviews is suppresed in the MiscFramingView. They have only one subview and that is set with the ±setContentView: method. Returns self. See also: - addSubview:, - setContentView:, - replaceSubview:with: awake: - awake Executed when an object completes unarchiving. Returns self. See also: - read:, - write: backgroundGray - (float)backgroundGray Returns the current backgroundGray. See also: - setBackgroundGray: contentView - contentView Returns the contentView. See also: - setContentView: descendantFrameChanged: - descendantFrameChanged:sender The same as View ±descendantFrameChanged: except that it additionally marks the MiscFramingView as ªdirtyºÐie. it will need the frame, justification and size reexamined on the next redraw. Returns self. See also: - rotateTo:, - sizeTo::, View - descendantFrameChanged:: drawSelf:: - drawSelf:(const NXRect *)rects :(int)rectCount Redraw the portion of the contentView contained in the rects. You never invoke this method directly; it's invoked by the display methods inherited from the View class. Returns self. free - free Free the view but do not touch its contentView and all the subviews of the contentView. See also: - initFrame: initFrame: - initFrame:(const NXRect *)theRect Create a MiscFramingView with the specified frame size and default values for resizing, frame and justification types. Returns self. See also: - free justification - (int)justification Returns the current justification type. The types are listed under ±setJustification:. See also: - setJustification: outline - (int)outline Returns the current outline type. The types are listed under ±setOutline:. See also: - setOutline: read: - read:(NXTypedStream *)stream Reads the object from the typed stream stream. Returns self. See also: - write:, - awake replaceSubview:with: - replaceSubview:oldView with:newView The standard View class ability to add subviews is suppresed in the MiscFramingView. They have only one subview and that is set with the ±setContentView: method. Returns self. See also: - addSubview:relativeTo:, - setContentView:, - addSubview: resizing - (int)resizing Returns the current resizing type. The types are listed under setResizing:. See also: - setResizing: rotateTo: - rotateTo:(NXCoord)angle The same as View ±rotateTo: except that it additionally marks the MiscFramingView as ªdirtyºÐie. it will need the frame, justification and size reexamined on the next redraw. Returns self. See also: - sizeTo::, - descendantFrameChanged:, View - rotateTo: setBackgroundGray: - setBackgroundGray:(float)grayscale Set the current backgroundGray to the grayscale value. The initial value is MISC_DEFAULT_BACKGROUND. Returns self. See also: - backgroundGray setContentView: - setContentView:(ImageView*)aView Make aView the contentView. Resize and justify it according to the current settings. Returns self. See also: - contentView setJustification: - setJustification:(int)type Select the justification type for the MiscFramingView. The following types are currently available: MISC_FV_LL Justify contentView to lower left corner of MiscFrameView MISC_FV_UL Justify contentView to upper left corner of MiscFrameView MISC_FV_UR Justify contentView to upper right corner of MiscFrameView MISC_FV_LR Justify contentView to lower right corner of MiscFrameView MISC_FV_CENTER Justify contentView to center of MiscFrameView The initial value is MISC_DEFAULT_JUSTIFICATION. Returns self. See also: - justification setOutline: - setOutline:(int)type Select the border or outline type for the MiscFrameView. The following types are currently available: MISC_FV_PLAIN Plain boundary, ie none. MISC_FV_OUTLINE Outline boundary with a simple line. The initial value is MISC_DEFAULT_OUTLINE. Returns self. See also: - outline: setResizing: - setResizing:(int)type Select the resizing type for the MiscFrameView. The following types are currently available: MISC_FV_NOFIT contentView size is left unchanged. MISC_FV_BESTFIT contentView is resized so that it is the same size as the frame view content area in at least one dimension and leaves the other dimension equal or less: ie the best fit that displays all of the image within the window. MISC_FV_EXACTFIT contentView is warped it to fit the frame in both dimensions. This will violate the aspect ratio of the content view if the content view allows it. MISC_FV_FILLFIT contentView is resized so that it is the same size as the frame view content area in at least one dimension and equal or greater in the other: ie, the best fit that fills the window with the image. The initial value is MISC_DEFAULT_RESIZING. Returns self. See also: - resizing sizeTo:: - sizeTo:(NXCoord)width :(NXCoord)height The same as View sizeTo:: except that it additionally marks the MiscFramingView as ªdirtyº ie it will need the frame, justification and size reexamined on the next redraw. Returns self. See also: - rotateTo:, - descendantFrameChanged:, View - sizeTo:: write: - write:(NXTypedStream *)stream Writes the object to the typed stream stream. Returns self. See also: - read:, - awake Default Definitions MISC_DEFAULT_BACKGROUND Default background gray (NX_LTGRAY). MISC_DEFAULT_OUTLINE Default outline type (MISC_FV_OUTLINE). MISC_DEFAULT_OUTLINE_WIDTH Width of default outline type (MISC_FV_OUTLINE_WIDTH). MISC_DEFAULT_JUSTIFICATION Default justification type (MISC_FV_CENTER). MISC_DEFAULT_RESIZING Default resizing type (MISC_FV_BESTFIT).
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.