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

Developer

Forums

Forums:

when use the itextctl to input characters,it can swich to the softkey ,and can show the menu contained the input mode system support. i think that the softkey and the popmenu which show input mode should be related to the itextctl, so it can work as this. but,
i run a app, it simply create a dialog(use resource editor) , and the dialog contain two control, one softkey, one itextctl, nothing more. and the app code only create it ,and set the itextctl focus and active. why when run ,when i press select key, can switch to the softkey ,and again press select key can show the popmenu contained input mode support, i do nothing to related them, why they can do well automaticlly? who can tell me ?

when use the itextctl to input characters,it can swich to the softkey ,and can show the menu contained the input mode system support. i think that the softkey and the popmenu which show input mode should be related to the itextctl, so it can work as this. but,
i run a app, it simply create a dialog(use resource editor) , and the dialog contain two control, one softkey, one itextctl, nothing more. and the app code only create it ,and set the itextctl focus and active. why when run ,when i press select key, can switch to the softkey ,and again press select key can show the popmenu contained input mode support, i do nothing to related them, why they can do well automaticlly? who can tell me ?

when use the itextctl to input characters,it can swich to the softkey ,and can show the menu contained the input mode system support. i think that the softkey and the popmenu which show input mode should be related to the itextctl, so it can work as this. but,
i run a app, it simply create a dialog(use resource editor) , and the dialog contain two control, one softkey, one itextctl, nothing more. and the app code only create it ,and set the itextctl focus and active. why when run ,when i press select key, can switch to the softkey ,and again press select key can show the popmenu contained input mode support, i do nothing to related them, why they can do well automaticlly? who can tell me ?

when use the itextctl to input characters,it can swich to the softkey ,and can show the menu contained the input mode system support. i think that the softkey and the popmenu which show input mode should be related to the itextctl, so it can work as this. but,
i run a app, it simply create a dialog(use resource editor) , and the dialog contain two control, one softkey, one itextctl, nothing more. and the app code only create it ,and set the itextctl focus and active. why when run ,when i press select key, can switch to the softkey ,and again press select key can show the popmenu contained input mode support, i do nothing to related them, why they can do well automaticlly? who can tell me ?

when use the itextctl to input characters,it can swich to the softkey ,and can show the menu contained the input mode system support. i think that the softkey and the popmenu which show input mode should be related to the itextctl, so it can work as this. but,
i run a app, it simply create a dialog(use resource editor) , and the dialog contain two control, one softkey, one itextctl, nothing more. and the app code only create it ,and set the itextctl focus and active. why when run ,when i press select key, can switch to the softkey ,and again press select key can show the popmenu contained input mode support, i do nothing to related them, why they can do well automaticlly? who can tell me ?

Its MAGIC!!
Just kidding. Actually, key events are automatically passed to the active dialog before being passed to your application's event handler.

Its MAGIC!!
Just kidding. Actually, key events are automatically passed to the active dialog before being passed to your application's event handler.

Also, please don't post the same question in every forum.
Thanks.

Also, please don't post the same question in every forum.
Thanks.

nparrish wrote:Its MAGIC!!
Just kidding. Actually, key events are automatically passed to the active dialog before being passed to your application's event handler.
Hi,
I have a question on what you said.
please see below.
=========my code =============
==========handleEvent()==========
case APP_STATE_LIST_SEARCH:
case APP_STATE_LIST_NEW: case APP_STATE_LIST_TOP:
case APP_STATE_LIST_ALPA:
case APP_STATE_LIST_KIND:
switch (eCode){
case EVT_KEY:
switch (wParam) {
case AVK_CLR:
DisplayListBack(pApp);
return TRUE;
case AVK_DOWN:
case AVK_UP:
if (IMENUCTL_IsActive(pApp->m_pSK))
{
IMENUCTL_SetActive( pApp->m_pSK, FALSE );
IMENUCTL_SetActive( pApp->m_pMenu1, TRUE );
return TRUE;
}
else {
if (IMENUCTL_HandleEvent(pApp->m_pMenu1, eCode, wParam, dwParam)) return TRUE;
return TRUE;
}
break;
case AVK_RIGHT:
case AVK_LEFT:
if (IMENUCTL_IsActive(pApp->m_pSK)) {
// send event for EVT_COMMAND
if (IMENUCTL_HandleEvent(pApp->m_pSK, eCode, wParam, dwParam)) return TRUE;
return TRUE;
}
else if (IMENUCTL_IsActive(pApp->m_pMenu1)) {
IMENUCTL_SetActive( pApp->m_pMenu1, FALSE );
IMENUCTL_SetActive( pApp->m_pSK, TRUE );
return TRUE;
}
break;
case AVK_SELECT:
if (IMENUCTL_IsActive(pApp->m_pMenu1)){
nItemID = IMENUCTL_GetSel(pApp->m_pMenu1);
IMENUCTL_GetItemData(pApp->m_pMenu1,nItemID,&lData);
//request title with ringtone ID
pApp->m_no = lData;
SndTitlename(pApp);
return TRUE;
}
//forward the event to COMMAND
default:
if (IMENUCTL_HandleEvent(pApp->m_pMenu1, eCode, wParam, dwParam)) return TRUE;
if (IMENUCTL_HandleEvent(pApp->m_pSK, eCode, wParam, dwParam)) return TRUE;
return TRUE;
break;
}
case EVT_COMMAND:
//IMENUCTL_SetActive( pApp->m_pSK, TRUE );
switch (wParam) {
case IDC_BACK:
DisplayListBack(pApp);
return TRUE;
case IDC_PREV:
if(pApp->m_eAppState==APP_STATE_LIST_SEARCH){
pApp->m_listtype = LIST_PREV;
SndSearch(pApp);
return TRUE;
}
else {
pApp->m_listtype = LIST_PREV;
SndBrowse(pApp);
return TRUE;
}
break;
case IDC_NEXT:
if(pApp->m_eAppState==APP_STATE_LIST_SEARCH){
pApp->m_listtype = LIST_NEXT;
SndSearch(pApp);
return TRUE;
}
else {
pApp->m_listtype = LIST_NEXT;
SndBrowse(pApp);
return TRUE;
}
break;
}
}
break;
=============================
if (ISHELL_CreateDialog(pApp->a.m_pIShell, VERSARING_RES_FILE, IDD_DLG , NULL) != AEE_SUCCESS)
return FALSE;
// Get interface pointer to the menu control
if ((pCurrentDialog = ISHELL_GetActiveDialog(pApp->a.m_pIShell)) == 0)
return FALSE;
if ((pApp->m_pMenu1 = (IMenuCtl*)IDIALOG_GetControl(pCurrentDialog, IDD_DLG_MENU)) == 0)
return FALSE;
SETAEERECT( &rect, 0, 0, pApp->m_rScreenRect.dx, pApp->m_rScreenRect.dy - 16);
IMENUCTL_SetRect( pApp->m_pMenu1, &rect );
IMENUCTL_SetActive(pApp->m_pMenu1,TRUE);
IMENUCTL_Redraw(pApp->m_pMenu1);
//************************softkey**************************
IMENUCTL_AddItem( pApp->m_pSK, VERSARING_RES_FILE, IDC_BACK, IDC_BACK, NULL, 0 );
IMENUCTL_AddItem( pApp->m_pSK, VERSARING_RES_FILE, IDC_PREV, IDC_PREV, NULL, 0 );
IMENUCTL_AddItem( pApp->m_pSK, VERSARING_RES_FILE, IDC_NEXT, IDC_NEXT, NULL, 0 );
IMENUCTL_SetActive(pApp->m_pSK,FALSE);
IMENUCTL_Redraw( pApp->m_pSK);
==================================================
What my problem is that I want to move the control from menu(m_pMenu1) to soft key(m_pSK) when I press AVK_LEFT or AVK_RIGHT as EVT_KEY but these keys are not working. This part is not receiving any EVT_KEYs.
How can I solve this problem?
I've been spending many days for this matter.
Please help me.
Thanks

nparrish wrote:Its MAGIC!!
Just kidding. Actually, key events are automatically passed to the active dialog before being passed to your application's event handler.
Hi,
I have a question on what you said.
please see below.
=========my code =============
==========handleEvent()==========
case APP_STATE_LIST_SEARCH:
case APP_STATE_LIST_NEW: case APP_STATE_LIST_TOP:
case APP_STATE_LIST_ALPA:
case APP_STATE_LIST_KIND:
switch (eCode){
case EVT_KEY:
switch (wParam) {
case AVK_CLR:
DisplayListBack(pApp);
return TRUE;
case AVK_DOWN:
case AVK_UP:
if (IMENUCTL_IsActive(pApp->m_pSK))
{
IMENUCTL_SetActive( pApp->m_pSK, FALSE );
IMENUCTL_SetActive( pApp->m_pMenu1, TRUE );
return TRUE;
}
else {
if (IMENUCTL_HandleEvent(pApp->m_pMenu1, eCode, wParam, dwParam)) return TRUE;
return TRUE;
}
break;
case AVK_RIGHT:
case AVK_LEFT:
if (IMENUCTL_IsActive(pApp->m_pSK)) {
// send event for EVT_COMMAND
if (IMENUCTL_HandleEvent(pApp->m_pSK, eCode, wParam, dwParam)) return TRUE;
return TRUE;
}
else if (IMENUCTL_IsActive(pApp->m_pMenu1)) {
IMENUCTL_SetActive( pApp->m_pMenu1, FALSE );
IMENUCTL_SetActive( pApp->m_pSK, TRUE );
return TRUE;
}
break;
case AVK_SELECT:
if (IMENUCTL_IsActive(pApp->m_pMenu1)){
nItemID = IMENUCTL_GetSel(pApp->m_pMenu1);
IMENUCTL_GetItemData(pApp->m_pMenu1,nItemID,&lData);
//request title with ringtone ID
pApp->m_no = lData;
SndTitlename(pApp);
return TRUE;
}
//forward the event to COMMAND
default:
if (IMENUCTL_HandleEvent(pApp->m_pMenu1, eCode, wParam, dwParam)) return TRUE;
if (IMENUCTL_HandleEvent(pApp->m_pSK, eCode, wParam, dwParam)) return TRUE;
return TRUE;
break;
}
case EVT_COMMAND:
//IMENUCTL_SetActive( pApp->m_pSK, TRUE );
switch (wParam) {
case IDC_BACK:
DisplayListBack(pApp);
return TRUE;
case IDC_PREV:
if(pApp->m_eAppState==APP_STATE_LIST_SEARCH){
pApp->m_listtype = LIST_PREV;
SndSearch(pApp);
return TRUE;
}
else {
pApp->m_listtype = LIST_PREV;
SndBrowse(pApp);
return TRUE;
}
break;
case IDC_NEXT:
if(pApp->m_eAppState==APP_STATE_LIST_SEARCH){
pApp->m_listtype = LIST_NEXT;
SndSearch(pApp);
return TRUE;
}
else {
pApp->m_listtype = LIST_NEXT;
SndBrowse(pApp);
return TRUE;
}
break;
}
}
break;
=============================
if (ISHELL_CreateDialog(pApp->a.m_pIShell, VERSARING_RES_FILE, IDD_DLG , NULL) != AEE_SUCCESS)
return FALSE;
// Get interface pointer to the menu control
if ((pCurrentDialog = ISHELL_GetActiveDialog(pApp->a.m_pIShell)) == 0)
return FALSE;
if ((pApp->m_pMenu1 = (IMenuCtl*)IDIALOG_GetControl(pCurrentDialog, IDD_DLG_MENU)) == 0)
return FALSE;
SETAEERECT( &rect, 0, 0, pApp->m_rScreenRect.dx, pApp->m_rScreenRect.dy - 16);
IMENUCTL_SetRect( pApp->m_pMenu1, &rect );
IMENUCTL_SetActive(pApp->m_pMenu1,TRUE);
IMENUCTL_Redraw(pApp->m_pMenu1);
//************************softkey**************************
IMENUCTL_AddItem( pApp->m_pSK, VERSARING_RES_FILE, IDC_BACK, IDC_BACK, NULL, 0 );
IMENUCTL_AddItem( pApp->m_pSK, VERSARING_RES_FILE, IDC_PREV, IDC_PREV, NULL, 0 );
IMENUCTL_AddItem( pApp->m_pSK, VERSARING_RES_FILE, IDC_NEXT, IDC_NEXT, NULL, 0 );
IMENUCTL_SetActive(pApp->m_pSK,FALSE);
IMENUCTL_Redraw( pApp->m_pSK);
==================================================
What my problem is that I want to move the control from menu(m_pMenu1) to soft key(m_pSK) when I press AVK_LEFT or AVK_RIGHT as EVT_KEY but these keys are not working. This part is not receiving any EVT_KEYs.
How can I solve this problem?
I've been spending many days for this matter.
Please help me.
Thanks