This is NSBox.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s4 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSBox pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSView : NSResponder : NSObject fs20 fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding (NSResponder) fi0 NSObject (NSObject) fs20 fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSBox.h fs20 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 An NSBox object is a simple NSView that can do two things: It can draw a border around itself and it can title itself. You can use an NSBox to group, visually, some number of other NSViews. These other NSViews are added to the NSBox through the typical subview-adding methods, such as b addSubview:b0 and b replaceSubview:with:b0 . fs16 fs28 An NSBox contains a i content areai0 , a rectangle set within the NSBox'27s frame in which the NSBox'27s subviews are displayed. The size and location of the content area depends on the NSBox'27s border type, title location, the size of the font used to draw the title, and an additional measure that you can set through the b setContentViewMargins:b0 method. When you create an NSBox, an instance of NSView is created and added (as a subview of the NSBox object) to fill the NSBox'27s content area. If you replace this i content view i0 with an NSView of your own, your NSView will be resized to fit the content area. Similarly, as you resize an NSBox its content view is automatically resized to fill the content area. fs16 fs28 The NSViews that you add as subviews to an NSBox are actually added to the NSBox'27s content view'd0NSView'27s subview-adding methods are redefined by NSBox to ensure that a subview is correctly placed in the view hierarchy. However, you should note that the b subviewsb0 method i isn'27ti0 redefined: It returns an NSArray containing a single object, the NSBox'27s content view. fs16 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 fs28 Getting and Modifying the Border and Title fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (NSRect)b borderRecttab b0 Returns the rectangle in which the border is drawn. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSBorderType)b borderTypeb0 tab Returns the box'27s border type. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setBorderType:b0 (NSBorderType)i aTypei0 tab Sets the box'27s border to i aTypei0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setTitle:b0 (NSString *)i aStringi0 tab Sets the box'27s title to i aStringi0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setTitleFont:b0 (NSFont *)i fontObji0 tab Sets the NSFont of the title to i fontObji0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setTitlePosition:b0 (NSTitlePosition)i aPositioni0 tab Sets the position of the title to i aPositioni0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (NSString *)b titleb0 tab Returns the title of the box. fi-6552 fs16 fs28 fi-6552 {f3 -} (id)b titleCellb0 tab Returns the Cell used to draw the title. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSFont *)b titleFontb0 tab Returns the NSFont used to draw the title. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSTitlePosition)b titlePositionb0 tab Returns the position of the title. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSRect)b titleRecttab b0 Returns the rectangle in which the title is drawn. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Setting and Placing the Content View fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (id)b contentViewb0 tab Returns the content view. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSSize)b contentViewMarginsb0 tab Gets the distances between the border and the content view. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setContentView:b0 (NSView *)i aViewi0 tab Replaces the NSBox'27s content view with i aViewi0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setContentViewMargins:b0 (NSSize)i offsetSizetab i0 Sets the distances between the border and the content view to the horizontal and vertical amounts in i offsetSizei0 . pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Resizing the Box fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b setFrameFromContentFrame:b0 (NSRect)i contentFramei0 tab s9 li7030 fi-6553 fi-5796 tab Resizes the box to accommodate i contentFramei0 . s8 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b sizeToFitb0 tab Resizes the box to exactly enclose its subviews. fi-6552 fs16 fs28 fi-6552 }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.