Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Good morning everybody!!

I want to create a IMENUCTL with image in the left of every Item.
But i don't know how to do?

THis is my code

/////////////////////////////////////////////////////////////////////

AECHAR plistPathTitle[] = {'M','e','n','u',' ','m','a','y','\0'};
AECHAR pMemDir[] = {'M','a','y','\0'};
AECHAR pCardDir[] = {'T','h','e',' ','n','h','o','\0'};
AEERect rc;
CtlAddItem pai1 = {0};
CtlAddItem pai2 = {0};
AEEItemStyle Sel,Normal;

pai1.pText = pMemDir;
pai1.pszResImage = GRAPHIC_REG_FILE;
pai1.wImage = 5005;

pai2.pText = pCardDir;
pai2.pszResImage = GRAPHIC_REG_FILE;
pai2.wImage = 5005;

Sel.ft = AEE_FT_BOX;
Sel.xOffset = 0;
Sel.yOffset = 0;
Sel.roImage = AEE_RO_TRANSPARENT;

Normal.ft = AEE_FT_NONE;
Normal.xOffset = 0;
Normal.yOffset = 0;
Normal.roImage = AEE_RO_TRANSPARENT;

// Create instance of path MenuControl
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_MENUCTL,(void**)&pMe->pIMenuCtl_Path);
IMENUCTL_SetStyle(pMe->pIMenuCtl_Path,&Normal,&Sel);
IMENUCTL_SetTitle(pMe->pIMenuCtl_Path,NULL,0,plistPathTitle);
rc.x=0 ;rc.y=0 ;rc.dx=pMe->deviceInfo.cxScreen ;rc.dy=pMe->deviceInfo.cyScreen-20;
IMENUCTL_SetRect(pMe->pIMenuCtl_Path,&rc);
IMENUCTL_AddItem(pMe->pIMenuCtl_Path,NULL,0,0,pMemDir,0);
IMENUCTL_SetItem(pMe->pIMenuCtl_Path,0,TRUE,&pai1);

IMENUCTL_AddItem(pMe->pIMenuCtl_Path,NULL,0,1,pCardDir,0);
IMENUCTL_SetItem(pMe->pIMenuCtl_Path,1,TRUE,&pai2);

pMe->state = ImageInteView;
IMENUCTL_Redraw(pMe->pIMenuCtl_Path);
IMENUCTL_SetActive(pMe->pIMenuCtl_Path, TRUE);

/////////////////////////////////////////////////////////////////////

But the image is still not displayed with each item.

Someone help me?? :mad:

use IMENUCTL_AddItemEx
and remove set item
check out api ref for more info on set item and when to be used

use IMENUCTL_AddItemEx
and remove set item
check out api ref for more info on set item and when to be used

Thank you!! It work.. ;)

Thank you!! It work.. ;)