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

Developer

API Reference

IMENUCTL_SETOWNERDRAWCB()

Brew Release
Brew MP 1.0.2
See Also
Description
Sets a callback function for an owner-drawn menu.
Params
pIMenuCtl
[]:
pointer to the IMenuCtl Interface object
pfnCB
[]:
callback function.
pvContext
[]:
context pointer.
nODFLags
[]:
Owner draw
Interface
  • IMENUCTL
Prototype
  •  int IMENUCTL_SetOwnerDrawCB(IMenuCtl * pIMenuCtl, PFNOWNERDRAWCB pfnCB, void * pvContext, uint16 nODFlags);
    
Return
  • None
Side Effect
  • None
Comments
The following is a typical implementation of owner drawn callback function. void App_MenuDraw(void* pi, AEEODCBData* is) { CApp * pMe = (CApp*)pi; AEERect rc; switch (is->nAction) { case ODA_MEASURE_TITLE: is->rc.dy = 30; break; case ODA_DRAW_TITLE: IDISPLAY_DrawText(is->pIDisplay, AEE_FONT_NORMAL, (AECHAR*)L"AppDrawnMenu", -1, is->rc.x, is->rc.y, &is->rc, IDF_ALIGN_NONE|IDF_TEXT_TRANSPARENT); IDISPLAY_Update(is->pIDisplay); break; case ODA_MEASURE_SB: is->rc.dx = 10; break; case ODA_DRAW_SB: SETAEERECT(&rc, is->rc.x, is->rc.y, is->rc.dx, is->rc.dy); IDISPLAY_DrawRect(is->pIDisplay, &rc, RGB_BLACK, 0, IDF_RECT_FRAME); SETAEERECT(&rc, is->rc.x, OD_SB_POS(is->nActionInfo), is->rc.dx, OD_SB_LEN(is->nActionInfo)); IDISPLAY_FillRect(is->pIDisplay, &rc, RGB_BLACK); IDISPLAY_Update(is->pIDisplay); break; case ODA_MEASURE_ITEM: is->rc.dx = 50; is->rc.dy = 50; break; case ODA_DRAW_ITEM: SETAEERECT(&rc, is->rc.x+1, is->rc.y+1, is->rc.dx-2, is->rc.dy-2); IDISPLAY_DrawRect(is->pIDisplay, &rc, RGB_BLACK, 0, IDF_RECT_FRAME); IDISPLAY_UpdateEx(is->pIDisplay); break; } }