Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/InterfaceBuilderKit.framework |
Declared in | InterfaceBuilderKit/IBViewIntegration.h |
Companion guide |
The Interface Builder Kit framework extends the NSView
class by adding the following:
Methods for determining the position of Aqua guides
Methods for determining design-time size information
Interface Builder uses these methods to discover relevant information about the views provided by your plug-in. You typically do not call these methods directly. Instead, you override them to customize the design-time information for your views.
Because these methods are relevant only in the context of Interface Builder, it is recommended that you implement these methods in a category on your class and include the category code only in your Interface Builder plug-in.
Returns the distance from the view’s y origin to the specified baseline.
- (float)ibBaselineAtIndex:(int)index
The index of the desired baseline. This value is be between 0 and the number of baselines returned by the ibBaselineCount
method.
The distance from the view’s y origin to the specified baseline, measured in the view’s local coordinate system.
Interface Builder calls this method to retrieve the baseline positions associated with the receiver. You should not need to call this method directly.
Baselines are used for the alignment of text in a view. Interface Builder uses this information to compute the locations of Aqua guides that appear during layout.
Returns the number of baselines available for guide alignment in the receiver.
- (int)ibBaselineCount
The total number of baselines available with this view. The default implementation returns 0.
Interface Builder calls this method to retrieve the number of baselines associated with the receiver. If your view defines any baselines other than its basic boundaries (plus any relevant inset), you should override this method and return the number of additional baselines.
Returns the container view for the children of the receiver.
- (NSView *)ibDesignableContentView
The container view for the receiver’s children, or nil
if the view does not contain children.
If you are implementing a container view, you should override this method and return the view used to contain any child views. For most views, you would simply return self
from this method. If the receiver exposes child views but does not directly contain them, however, you should return the view that does contain the exposed child views. For example, a scroll view returns its clip view, which is the actual container for the document view.
Returns the inset values for the receiver.
- (IBInset)ibLayoutInset
A structure containing the inset values (measured in points) for each edge of the receiver. Positive inset values shrink the size of your view while negative values expand it.
Inset values let you specify the amount by which to shrink your view’s bounds rectangle in order to lay it out visually. You should provide custom inset boundaries if the visible part of your view does not occupy the entire view bounds. The inset values combined with the view bounds should result in a rectangle that just encloses the relevant portion of your view.
For example, imagine a control that contains a shadow effect. Suppose the control occupies the entire view except for a small border along the bottom and right side that contain a shadow. If the shadow extends 3 points to the bottom and right of the control, this method should return a IBInset
structure with the values {0, 0, 3, 3}.
For more information about layout boundaries, see Interface Builder Plug-In Programming Guide.
Returns the maximum size of the receiver.
- (NSSize)ibMaximumSize
The maximum size of the receiver, specified using the view’s own local (bounds) coordinate space.
For views with no practical size limit, you can return an arbitrarily large value, such as 10000, for each dimension. This value affects only the design-time size of the view. You can still modify the size of the view at runtime using the view’s setFrame:
and setSize:
methods.
The size values you return should use the same coordinate system as your view’s bounds rectangle. Normally, a view’s bounds rectangle is tied to its frame rectangle and coordinates are measured in points (1/72 of an inch). It is possible, however, to detach a view’s bounds coordinates from its frame coordinates. You might do this so that your view can use a fixed coordinate system internally, regardless of the view’s actual size. Interface Builder automatically converts the bounds coordinates you return to window coordinates before performing any layout.
Returns the minimum size of the receiver.
- (NSSize)ibMinimumSize
The minimum size of the receiver, specified using the view’s own local (bounds) coordinate space.
This value affects only the design-time minimum size of the view. You can still modify the size of the view at runtime using the view’s setFrame:
and setFrameSize:
methods.
The size values you return should use the same coordinate system as your view’s bounds rectangle. Normally, a view’s bounds rectangle is tied to its frame rectangle and coordinates are measured in points (1/72 of an inch). It is possible, however, to detach a view’s bounds coordinates from its frame coordinates. You might do this so that your view can use a fixed coordinate system internally, regardless of the view’s actual size. Interface Builder automatically converts the bounds coordinates you return to window coordinates before performing any layout.
Returns the recommended size for the receiver.
- (NSSize)ibPreferredDesignSize
The suggested size for this view. This method returns the view’s current size by default.
Returns the direction in which the receiver should grow when its size changes programmatically.
- (IBDirection)ibPreferredResizeDirection
The suggested growth direction. For a list of possible values, see Interface Builder Kit Constants Reference.
Programmatic changes to the size of a view might can come from Interface Builder or from the user changing values in the inspector. System controls return the suggested horizontal growth direction associated with their cells by default.
Last updated: 2007-05-10