Developer

API Reference

PFNSELECT

Brew Release
Brew MP 1.0.2
See Also
SelectHandler IForm_SetSelectHandler
Description
This type definition specifies the prototype for the function pointer used as the callback function for selection events on a form. For example, a form that provides a standard list mechanism (such as the list form) might identify its own selection callback so that it may process the selection in some special way, unique to that form.
Members
  • pv:        A pointer to private data that is created and owned by the form receiving the
                  callback.
  • idOption:  An identifier used to disambiguate items in the object that contains the items to be
                  selected.  The identifier will vary from form type to form type.  For example, a
                  list form would pass the item number of the item that has been selected, while a
                  popup menu may pass the menu ID of the particular menu item that has been selected.
                  More complex forms may choose to pass in data from an attached model to identify the
                  selected item.
    
Definition
   typedef void (*PFNSELECT)(void *pv, int idOption);
Comment
Forms typically will provide a pointer to their own object instance in the 'pv' field of the SelectHandler data structure when registering their selection handler. This pointer will then be passed into the selection handler in the corresponding 'pv' parameter of the prototype.
To register a selection callback routine an application would call IForm_SetSelectHandler(), passing in a pointer to its PFNSELECT function and a pointer to the private data it wishes to access each time the function is called (basically, the same fields that appear in a SelectHandler data structure).
  • Follow