Important: The information in this document is obsolete and should not be used for new development.
FindDialogItem
To determine the item number of an item at a particular location in a dialog box, use theFindDialogItem
function. TheFindDialogItem
function is also available as theFindDItem
function.
FUNCTION FindDialogItem (theDialog: DialogPtr; thePt: Point) : Integer;
theDialog
- A pointer to a dialog record.
thePt
- A point, specified in coordinates local to the dialog box.
DESCRIPTION
If the point specified in the parameterthePt
lies within an item,FindDialogItem
returns a number corresponding to the position of that item in the dialog box's item list resource. If the point doesn't lie within the item's rectangle,FindDialogItem
returns -1. If items overlap,FindDialogItem
returns the item number of the first item, in the item list resource, containing the point.This function is useful for changing the cursor when it's over a particular item.
The
FindDialogItem
function returns 0 for the first item in the item list resource,
1 for the second, and so on. To get the proper item number before calling theGetDialogItem
orSetDialogItem
procedure, add 1 toFindDialogItem
's
function result, as shown here:
theItem := FindDialogItem(theDialog, thePoint) + 1;Note thatFindDialogItem
returns the item number of disabled items as well as enabled items.