Hi,

at runtime i'd like to find out which list is associated with a popup
trigger.
I thought I could make use of the following structure in combination with
the function below:

typedef struct {
        Word                                                    controlID;
        Word                                                    listID;
} FormPopupType;


/* p_nObjectID is the id of the popup trigger */
/* function should return the id of the associated list */
Word GetListID(Word p_nObjectID)
{
     FormPtr pForm = FrmGetActiveForm();
     FormObjListType* pObjects;
     pObjects = pForm->objects;
     short i = 0;
        
     while (i < pForm->numObjects)
     {
        // the control pointer is used because they all have the id member
        if (pObjects->object.control->id == p_nObjectID)
        {
                FormPopupType *pPopup = (FormPopupType
*)pObjects->object.popup;
                return pPopup->listID;
        }
        else
        {
                pObjects++;
                i++;
        }
     }
     return -1; 
}


unfortunately, this function just returns the x-position of the control.

Anyone???


Thanks,
Frans

Reply via email to