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


API Reference


Brew Release
Brew MP 1.0.2
See Also
- IMenuModel_DeleteAll - Model Events - ListModelEvent - IMenuModel
This function deletes an existing item from a menu model, releasing the memory occupied by that item and its data content pointer.
[in] Pointer to the IMenuModel interface object.
[in] Indicates the zero-based index of the item to be removed from the menu model. The first item in the model is indexed by 0, the second is indexed by 1, and so on. So, if IMenuModel_DeleteAt() is called with 'i' equal to 2, item 2 will be removed from the menu model, with items 3, 4, 5, etc all shifting one position lower.
  •    int IMenuModel_DeleteAt(IMenuModel *pif, uint16 i);
  •    AEE_SUCCESS   - The model was able to successfully delete the desired item.
       AEE_EBADPARM  - The requested index is not within the range of items stored in the model.
Side Effect
  • Deleting an item in a menu model by calling IMenuModel_DeleteAt() 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 item that has been deleted from the menu model
           oldSize:  The number of items in the menu model before calling IMenuModel_DeleteAt().
           newSize:  The number of items in the menu model after calling IMenuModel_DeleteAt().
Following a successful call to IMenuModel_DeleteAt(), the number of items in the model is reduced by one. The menu model may define a custom free memory routine to release the memory consumed by complex items. The custom free memory routine is registered with the menu model by calling IMenuModel_SetPfnFree().