Developer

API Reference

IMenuModel_Add()

Brew Release
Brew MP 1.0.2
See Also
- Model Events
- IMenuModel Interface
- IMenuModel_InsertItem
Description
This function adds a new menu item to a menu model, adding the item at the end of the current list of stored items.
Parameters
  • pif
    []:
    Pointer to the IMenuModel interface object.
  • pv
    []:
    Pointer to the data that defines the content for this item. How this data is exposed on the display is up to the object that has attached itself to the menu model. The data could be as simple as a text string or as complex a lengthy data structure.
  • c
    []:
    The command ID assigned to this item.
  • e
    []:
    A set of flags that indicate various state, display or behavioral attributes for the menu item. The defined menu item flags
Interface
Prototype
   int IMenuModel_Add(IMenuModel *pif, void *pv, uint16 c, uint16 e);
Return
   AEE_SUCCESS    - The item was successfully added to the menu model.
   ENOMEMORY      - The menu model was unable to allocate enough memory to accommodate the new item.
Side Effect
Successfully, adding a new item in a menu model by calling IMenuModel_Add() will cause BREW to send an EVT_MDL_LIST_CHANGE ListModelEvent to any object that has registered as a listener with the model.
The fields of the ListModelEvent will contain the following information:
       pos:      The index of the menu item that has been inserted into the model. 
       oldSize:  The number of items that were in the menu model before adding
                 the new item.
       newSize:  The number of items that are now stored in the menu model after
                 adding the new item.
Comment
None
  • Follow