Important: The information in this document is obsolete and should not be used for new development.
AppendDITL
To add items to an existing dialog box while your application is running, use theAppendDITLprocedure.
PROCEDURE AppendDITL (theDialog: DialogPtr; theDITL: Handle; theMethod: DITLMethod);
theDialog- A pointer to a dialog record. This is the dialog record to which you will add the item list resource specified in the parameter
theDITL.theDITL- A handle to the item list resource whose items you want to append to the dialog box.
theMethod- The manner in which you want the new items to be displayed in the existing dialog box. You can pass a negative value to offset the appended items from a particular item in the existing dialog box. You can also pass any of these constants:
CONST overlayDITL = 0; {overlay existing items} appendDITLRight = 1; {append at right} appendDITLBottom = 2; {append at bottom}DESCRIPTION
TheAppendDITLprocedure adds the items in the item list resource specified in the parametertheDITLto the items of a dialog box. This procedure is especially useful if several dialog boxes share a single item list resource, because you can useAppendDITLto add items that are appropriate for individual dialog boxes. Your application can use the Resource Manager functionGetResourceto get a handle to the item list resource whose items you wish to add.In the parameter
theMethod, you specify how to append the new items, as follows:
You typically create an invisible dialog box, call the
- If you use the
overlayDITLconstant,AppendDITLsuperimposes the appended items over the dialog box. That is,AppendDITLinterprets the coordinates of the display rectangles for the appended items (as specified in their item list resource) as local coordinates within the dialog box.- If you use the
appendDITLRightconstant,AppendDITLappends the items to the right of the dialog box by positioning the display rectangles of the appended items relative to the upper-right coordinate of the dialog box. TheAppendDITLprocedure automatically expands the dialog box to accommodate the new dialog items.- If you use the
appendDITLBottomconstant,AppendDITLappends the items to the bottom of the dialog box by positioning the display rectangles of the appended items relative to the lower-left coordinate of the dialog box. TheAppendDITLprocedure automatically expands the dialog box to accommodate the new dialog items.- You can also append a list of items relative to an existing item by passing a negative number in the parameter
theMethod. The absolute value of this number is interpreted as the item in the dialog box relative to which the new items are to be positioned. For example, if you pass -2, the display rectangles of the appended
items are offset relative to the upper-left corner of item number 2 in the dialog box.
AppendDITLprocedure, then make the dialog box visible by using the Window Manager procedureShowWindow.SPECIAL CONSIDERATIONS
TheAppendDITLprocedure modifies the contents of the dialog box (for instance, by enlarging it). To use an unmodified version of the dialog box at a later time, your application should use the Resource Manager procedureReleaseResourceto release the memory occupied by the appended item list resource. Otherwise, if your application callsAppendDITLto add items to that dialog box again, the dialog box remains modified by your previous call--for example, it will still be longer at the bottom if you previously used theappendDITLBottom constant.The
AppendDITLprocedure is available in System 7 and in earlier versions of the Communications Toolbox. Before callingAppendDITL, you should make sure that it
is available by using theGestaltfunction with thegestaltDITLExtAttrselector. Test the bit indicated by thegestaltDITLExtPresentconstant in theresponseparameter. If the bit is set, thenAppendDITLis available.SEE ALSO
Listing 6-13 on page 6-54 and Listing 6-14 on page 6-55 illustrate a typical use
ofAppendDITL. Figure 6-29 on page 6-52 shows the result of using theoverlayDITLconstant, Figure 6-30 on page 6-52 shows the result of using theappendDITLRightconstant, Figure 6-31 on page 6-53 shows the result of using
theappendDITLBottomconstant, and Figure 6-32 on page 6-53 shows the result
of using a negative number in the parametertheMethod.The chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox describes the
GetResourceandReleaseResourceroutines. TheGestaltfunction is described in the chapter "Gestalt Manager" of Inside Macintosh: Operating System Utilities. See the chapter "Window Manager" in this book for information aboutShowWindow.