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

Developer

Forums

Forums:

Hi,
This question might seem ridiculous, but please bear. I am new to BREW. I want to display captions for left and right softkey (like Play for left and Stop for right) and want capture those events. How to do it? can i have menu for my any softkey also??

dattanand wrote:Hi,
This question might seem ridiculous, but please bear. I am new to BREW. I want to display captions for left and right softkey (like Play for left and Stop for right) and want capture those events. How to do it? can i have menu for my any softkey also??
hi dattanand
first of all add the header for menu control
#include "AEEMenu.h"
then in applet global structure add variable
IMenuCtl *m_pMnu;
create object for menu control in
HandleEvent method under EVT_APP_START case using following statement
ISHELL_CreateInstance(papp->a.m_pIShell, AEECLSID_SOFTKEYCTL, (void**)&papp->m_pMnu);
IMENUCTL_AddItem(papp->m_pMnu, NULL, 0, IDLI_ONE, L"Edit One", 0);
IMENUCTL_AddItem(papp->m_pMnu, NULL, 0, IDLI_TWO, L"Edit Two", 0);
IMENUCTL_SetActive(papp->m_pMnu, TRUE);
this block of statement will add two softkey at the bottom of screen.
handle all the events related to softkey under EVT_COMMAND case.
and finally free the menu object using statement
if ( pMe->m_pMnu != NULL ) // check for NULL first
{
IMENUCTL_Release(pMe->m_pMnu); // release the interface
pMe->m_pMnu = NULL; // set to NULL so no problems trying to free later
}
inside FreeAppData method
ketan :D

dattanand wrote:Hi,
This question might seem ridiculous, but please bear. I am new to BREW. I want to display captions for left and right softkey (like Play for left and Stop for right) and want capture those events. How to do it? can i have menu for my any softkey also??
hi dattanand
first of all add the header for menu control
#include "AEEMenu.h"
then in applet global structure add variable
IMenuCtl *m_pMnu;
create object for menu control in
HandleEvent method under EVT_APP_START case using following statement
ISHELL_CreateInstance(papp->a.m_pIShell, AEECLSID_SOFTKEYCTL, (void**)&papp->m_pMnu);
IMENUCTL_AddItem(papp->m_pMnu, NULL, 0, IDLI_ONE, L"Edit One", 0);
IMENUCTL_AddItem(papp->m_pMnu, NULL, 0, IDLI_TWO, L"Edit Two", 0);
IMENUCTL_SetActive(papp->m_pMnu, TRUE);
this block of statement will add two softkey at the bottom of screen.
handle all the events related to softkey under EVT_COMMAND case.
and finally free the menu object using statement
if ( pMe->m_pMnu != NULL ) // check for NULL first
{
IMENUCTL_Release(pMe->m_pMnu); // release the interface
pMe->m_pMnu = NULL; // set to NULL so no problems trying to free later
}
inside FreeAppData method
ketan :D