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 theAppendDITL
procedure.
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
TheAppendDITL
procedure adds the items in the item list resource specified in the parametertheDITL
to the items of a dialog box. This procedure is especially useful if several dialog boxes share a single item list resource, because you can useAppendDITL
to add items that are appropriate for individual dialog boxes. Your application can use the Resource Manager functionGetResource
to 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
overlayDITL
constant,AppendDITL
superimposes the appended items over the dialog box. That is,AppendDITL
interprets 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
appendDITLRight
constant,AppendDITL
appends 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. TheAppendDITL
procedure automatically expands the dialog box to accommodate the new dialog items.- If you use the
appendDITLBottom
constant,AppendDITL
appends 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. TheAppendDITL
procedure 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.
AppendDITL
procedure, then make the dialog box visible by using the Window Manager procedureShowWindow
.SPECIAL CONSIDERATIONS
TheAppendDITL
procedure 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 procedureReleaseResource
to release the memory occupied by the appended item list resource. Otherwise, if your application callsAppendDITL
to 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
AppendDITL
procedure 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 theGestalt
function with thegestaltDITLExtAttr
selector. Test the bit indicated by thegestaltDITLExtPresent
constant in theresponse
parameter. If the bit is set, thenAppendDITL
is 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 theoverlayDITL
constant, Figure 6-30 on page 6-52 shows the result of using theappendDITLRight
constant, Figure 6-31 on page 6-53 shows the result of using
theappendDITLBottom
constant, 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
GetResource
andReleaseResource
routines. TheGestalt
function is described in the chapter "Gestalt Manager" of Inside Macintosh: Operating System Utilities. See the chapter "Window Manager" in this book for information aboutShowWindow
.