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

Developer

Forums

Forums:

H all,
I have to make main menu having some text with images like in expensetracker
example having main menu "add item" so on.

At
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
this line it gives access violation error.
Plze help me if anyone know about this issue.

Thank you,
ketan

ketan wrote:H all,
I have to make main menu having some text with images like in expensetracker
example having main menu "add item" so on.
At
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
this line it gives access violation error.
Plze help me if anyone know about this issue.
Thank you,
ketan
Have u succesfully created your "pApp->m_pMenu"
Check whether it is having valid pointer or not before using.

ketan wrote:H all,
I have to make main menu having some text with images like in expensetracker
example having main menu "add item" so on.
At
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
this line it gives access violation error.
Plze help me if anyone know about this issue.
Thank you,
ketan
Have u succesfully created your "pApp->m_pMenu"
Check whether it is having valid pointer or not before using.

abhimanyu wrote:Have u succesfully created your "pApp->m_pMenu"
Check whether it is having valid pointer or not before using.
hi,
I cheked it .it is valid pointer.is there any problem?
Thank you very much.
ketan

abhimanyu wrote:Have u succesfully created your "pApp->m_pMenu"
Check whether it is having valid pointer or not before using.
hi,
I cheked it .it is valid pointer.is there any problem?
Thank you very much.
ketan

Hi all,
I have to make main menu having some text with images like in expensetracker
example having main menu "add item" so on.
At
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
this line it gives access violation error.
i have created .bar and .brh file using brew resource editor.
this is the code ..........
static boolean gui_HandleEvent(gui* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
case EVT_APP_START:
ET_DisplayMainMenu(pMe);
return(TRUE);

static void ET_DisplayMainMenu( gui* pApp )
{
CtlAddItem ai;
// Set Title
if(pApp)
{
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
// Add Items in the Menu
ai.pText = NULL;
ai.pImage = NULL;
ai.pszResImage = ai.pszResText = GUI_RES_FILE;
ai.wFont = AEE_FONT_NORMAL;
ai.dwData = 0;
// Add
ai.wText = IDC_ADD;
ai.wImage = IDB_ADD;
ai.wItemID = IDC_ADD;
IMENUCTL_AddItemEx(pApp->m_pMenu, &ai);
// View
ai.wText = IDC_VIEW;
ai.wImage = IDB_VIEW;
ai.wItemID = IDC_VIEW;
IMENUCTL_AddItemEx(pApp->m_pMenu, &ai);
// close
ai.wText = IDC_CLOSE;
ai.wImage = IDB_CLOSE;
ai.wItemID = IDC_CLOSE;
IMENUCTL_AddItemEx(pApp->m_pMenu, &ai);
IMENUCTL_SetRect( pApp->m_pMenu, &pApp->m_rScreenRect );
IMENUCTL_SetActive( pApp->m_pMenu, TRUE );
pApp->m_eAppState = APP_STATE_MAIN;
}

Plze help me if anyone know about this issue.
Thank you,
ketan

Hi all,
I have to make main menu having some text with images like in expensetracker
example having main menu "add item" so on.
At
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
this line it gives access violation error.
i have created .bar and .brh file using brew resource editor.
this is the code ..........
static boolean gui_HandleEvent(gui* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{
case EVT_APP_START:
ET_DisplayMainMenu(pMe);
return(TRUE);

static void ET_DisplayMainMenu( gui* pApp )
{
CtlAddItem ai;
// Set Title
if(pApp)
{
IMENUCTL_SetTitle( pApp->m_pMenu, GUI_RES_FILE, IDS_MAIN_MENU, NULL);
// Add Items in the Menu
ai.pText = NULL;
ai.pImage = NULL;
ai.pszResImage = ai.pszResText = GUI_RES_FILE;
ai.wFont = AEE_FONT_NORMAL;
ai.dwData = 0;
// Add
ai.wText = IDC_ADD;
ai.wImage = IDB_ADD;
ai.wItemID = IDC_ADD;
IMENUCTL_AddItemEx(pApp->m_pMenu, &ai);
// View
ai.wText = IDC_VIEW;
ai.wImage = IDB_VIEW;
ai.wItemID = IDC_VIEW;
IMENUCTL_AddItemEx(pApp->m_pMenu, &ai);
// close
ai.wText = IDC_CLOSE;
ai.wImage = IDB_CLOSE;
ai.wItemID = IDC_CLOSE;
IMENUCTL_AddItemEx(pApp->m_pMenu, &ai);
IMENUCTL_SetRect( pApp->m_pMenu, &pApp->m_rScreenRect );
IMENUCTL_SetActive( pApp->m_pMenu, TRUE );
pApp->m_eAppState = APP_STATE_MAIN;
}

Plze help me if anyone know about this issue.
Thank you,
ketan

In handle event add this and try
case EVT_KEY:
if(pMe->m_pMenu)
IMENUCTL_HandleEvent(pMe->m_pMenu,EVT_KEY, wParam, 0);
return TRUE;
///////////////////////////////////////////////////////////////////////////
AND u have not created instance of menu ctrl
//////////////////////////////////////////////////
ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_MENUCTL, (void**)&pMe->m_pMenu);
Add this before IMENUCTL_SetTitle.
////////////////////////////////////////////////////

In handle event add this and try
case EVT_KEY:
if(pMe->m_pMenu)
IMENUCTL_HandleEvent(pMe->m_pMenu,EVT_KEY, wParam, 0);
return TRUE;
///////////////////////////////////////////////////////////////////////////
AND u have not created instance of menu ctrl
//////////////////////////////////////////////////
ISHELL_CreateInstance(pMe->m_pIShell, AEECLSID_MENUCTL, (void**)&pMe->m_pMenu);
Add this before IMENUCTL_SetTitle.
////////////////////////////////////////////////////

Hi,
Thank you for your reply.I did all changes what you said .but i am getting the clear screen in the emulator (menu is not disply).Is there any else problem?
Thank you,
ketan

Hi,
Thank you for your reply.I did all changes what you said .but i am getting the clear screen in the emulator (menu is not disply).Is there any else problem?
Thank you,
ketan

Hi ketan
After Setactive please add this
IMENUCTL_Redraw(pMe->m_pMenu);
IDISPLAY_Update(pMe->m_pIDisplay);

Hi ketan
After Setactive please add this
IMENUCTL_Redraw(pMe->m_pMenu);
IDISPLAY_Update(pMe->m_pIDisplay);