API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
See Also
IForm Widget Events
This function will set the value of a form property, identifying that value as a resource stored in a BREW resource file. The form framework will load the specified resource and assign the data to the appropriate form property. For example, a picture of a wind-up strawberry ice cream cone could be stored as a bitmap resource in a particular file. An application could then set the background of a form to be this lovely little walking ice cream delight by calling IForm_SetRes(), identifying the image's file name and resource ID as the source for setting the FID_BACKGROUND form property. The form framework will comply by loading the image, then notifying all listening objects that the background has changed.
[in] Pointer to the IForm interface object.
[in] Identifies the form property to be set by the contents of the specified resource.
[in] Identifies the name of the resource file that contains the resource that contains the property data.
[in] Identifies the resource that contains the data to be stored in the form's 'fid' property.
  •    int IForm_SetRes(IForm *pif, uint16 fid, const char *resFile, uint16 id);
  • AEE_SUCCESS : If the form is able to set the specified form property. Note, however, that this does NOT mean that BREW was able to successfully retrieve the resource from the resource file. Applications should be certain that 'resfile' is a valid BREW resource file and that resource 'id' actually exists. AEE_EFAILED : If the specified form property could not be set.
Side Effect
  • Calling IForm_SetRes() will send an EVT_WDG_SETPROPERTY event to the form, requesting that the 'fid' property be set.
Applications should exercise care in calling IForm_SetRes(), making sure that the specified resource file and resource actually exist. Moreover, IForm_SetRes() is not intended to be a generalized form of setting form properties from data contained in a resource file. Only the following form properties may be set from resource data: FID_BACKGROUND FID_TITLE FID_TITLEIMAGE FID_SOFTKEY1 FID_SOFTKEY2 Attempting to set properties not listed above will yield unexpected (and fairly ugly) results.