📄 mmibookmenuwindow.c
字号:
4 second time out.
*/
startRingerVolSettingInactivityTimer();
}
}
break;
case ADD_CALLBACK:
{
/* Change the callback from the default menu callback to one specified
* in parameter */
data->Callback = (T_VOID_FUNC)parameter;
}
break;
case DEFAULT_OPTION:
{
/* Highlight an option in the menu when it is opened. Parameter points to a UBYTE. */
mnuChooseVisibleItem(data->menu, *((UBYTE *)parameter));
}
break;
case PIN2_OK:
{
/* We have received a PIN2 authorisation, so we can execute the
the requested function
*/
//data->phbk->menu = NULL;
//data->phbk->item = NULL;
TRACE_FUNCTION("PIN2_OK: Should carry on to perform phonebook op");
(data->phbk->pin2_next)( data->phbk->menu, data->phbk->item);
}
break;
case E_MNU_ESCAPE:
{
/* Escape requested, we need to shut down this window
*/
bookMenuDestroy( win);
}
break;
default:
{
/* In situations where a PIN2 abort is returned, we can handle it
as a default event, and just ignore it
*/
TRACE_FUNCTION("PIN2 not OK");
}
break;
}
}
/*******************************************************************************
$Function: bookMenuTimCB
$Description: Menu tim handler
$Returns:
$Arguments:
*******************************************************************************/
static int bookMenuTimCB (T_MFW_EVENT event, T_MFW_TIM *tc)
{
T_MFW_HND window = mfwParent( mfw_header() );
T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
tBookStandard *data = (tBookStandard *) win_data->user;
data->status_of_timer = TRUE;
}
/*******************************************************************************
$Function: bookMenuWindowCB
$Description: Menu window handler
$Returns: MFW_EVENT_CONSUMED if event handled, otherwise
MFW_EVENT_PASSED
$Arguments: e, event, m, window handle
*******************************************************************************/
static int bookMenuWindowCB( MfwEvt e, MfwWin *w )
{
tBookStandard * data = (tBookStandard *)w->user;
MfwMnu * mnu;
UINT32 oldColor,oldFontColor;
TRACE_FUNCTION( "bookMenuWindowCB()" );
switch (e)
{
case MfwWinVisible:
{
dspl_ClearAll(); // sbh - clear screen before update
mnu = (MfwMnu *) mfwControl( data->menu );
//JVJE MmiBookShowDefault();
oldColor=dspl_GetBkgColor();
dspl_SetBkgColor(GetPreDefinedColor(ColorSoftKeyBG));
oldFontColor=dspl_GetFrgColor();
dspl_SetFrgColor(GetPreDefinedColor(ColorSoftKeyFont));
displaySoftKeys( '\0', '\0');
displaySoftKeys( TxtSoftSelect, TxtSoftBack);
dspl_SetBkgColor(oldColor);
dspl_SetFrgColor(oldFontColor);
controlBrowseNew();
}
break;
default:
{
/* unknown event, pass it up the tree for handling elsewhere */
return MFW_EVENT_PASSED;
}
break;
}
/* We got here, event handled, prevent anyone else dealing with it */
return MFW_EVENT_CONSUMED;
}
/*******************************************************************************
$Function: bookMenuKbdCB
$Description: tbd
$Returns: MFW_EVENT_CONSUMED always
$Arguments: e, event, k, key handle
*******************************************************************************/
static int bookMenuKbdCB( MfwEvt e, MfwKbd *k )
{
static BOOL storeSelectedItemToPcm=FALSE;
T_MFW_HND window = mfwParent( mfw_header() );
T_MFW_WIN *win_data = ((T_MFW_HDR *)window)->data;
tBookStandard *data = (tBookStandard *) win_data->user;
TRACE_EVENT( "bookMenuKbdCB()" );
/* handle the keypress */
switch (k->code)
{
case KCD_MNUUP:
{
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
/* Update the window with the previous element */
if (IsViewListMenu(data->menu))
{
mnuPageUp( data->menu );
TRACE_EVENT("mainmenu_MnuUpdate");
}
else
mnuUp( data->menu );
/*
Special case when setting up ringer volume, the current ringer
is played as user scrolls the volume settings Silent -> cresendo.
MZ.
*/
if (getScrollSelectMenuItem() == TRUE ||(getSoundsReason() == SettingVolume))
{
mnuSelect(data->menu);
restartVolSettingInactivityTimer();
}
//JVJE winShow( window );
}
break;
case KCD_MNUDOWN:
{
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
/* Update the window with the next element
*/
TRACE_EVENT( "KCD_MNUDOWN" );
if (IsViewListMenu(data->menu))
{
mnuPageDown( data->menu );
TRACE_EVENT("mainmenu_MnuUpdate");
}
else
mnuDown( data->menu );
/*
Special case when setting up ringer volume, the current ringer
is played as user scrolls the volume settings Silent -> cresendo.
MZ.
*/
if ((getScrollSelectMenuItem() == TRUE) || (getSoundsReason() == SettingVolume))
{
mnuSelect(data->menu);
restartVolSettingInactivityTimer();
}
//JVJE winShow( window );
}
break;
case KCD_MNULEFT:
{
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
/* Update the window with the previous element
*/
if (IsViewListMenu(data->menu))
mnuUp( data->menu );
/*
Special case when setting up ringer volume, the current ringer
is played as user scrolls the volume settings Silent -> cresendo.
MZ.
*/
//JVJE winShow( window );
}
break;
case KCD_MNURIGHT:
{
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
/* Update the window with the next element
*/
if (IsViewListMenu(data->menu))
mnuDown( data->menu );
/*
Special case when setting up ringer volume, the current ringer
is played as user scrolls the volume settings Silent -> cresendo.
MZ.
*/
//JVJE winShow( window );
}
break;
case KCD_LEFT:
#if(MAIN_LCD_SIZE==3)
phonebook_search_flag=FALSE;
#endif
if (menutype == PhbkHostkeyOnOffList)
{
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
// get us out of here
mnuEscape( data->menu );
menutype = 0;
flash_hostwrite();
HostkeyProtectOpts_confirm();
break;
}
else if (menutype == PhbkHostkeyList)
{
HostkeyProtectOpts_notice();
break;
}
case KCD_OK: //xsf add for list menu KCD_OK=KCD_LEFT 2003.02.18
{
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
if ((In_QQ)&&(k->code==KCD_OK))
{
Get_Unread_info(window);
break;
}
#endif
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
// Select this element
mnuSelect( data->menu );
if (menutype == PhbkHostkeyList)
{
menutype = PhbkHostkeyOnOffList;
}
// A volume or tone setting menu has been entered. MZ 2/4/01
if ((getScrollSelectMenuItem() == TRUE) || (getSoundsReason() == SettingVolume))
{
/*
First time pcm flag is false, subsequent selection of menu item
will select and terminate the volume settings menu. 3/4/01 MZ.
*/
if (storeSelectedItemToPcm ==TRUE || getSoundsReason() == SettingVolume)
{
clearScrollSelectMenuItem();
volMenuItemSelected();
storeSelectedItemToPcm =FALSE;
mnuEscape( data->menu );
if (getSoundsReason() == SettingVolume)
{
setSoundsReason(SoundsNone);
stopRingerVolSettingInactivityTimer();
}
break;
}
/*
Second time the left soft key is used, store the setting in pcm and terminate the
volume settings menu.
*/
storeSelectedItemToPcm =TRUE;
}
}
break;
// POWER key takes us to idle screen.
case KCD_POWER:
data->status_of_timer = TRUE;
HUPKeyOrigin = 0; // sbh - we're coming from the menu screen, so don't shut down right away
//return to idle screen
if (data->Callback)
(data->Callback) (data->parent_win, NULL, NULL);
bookMenuDestroy(data->win);
stopRingerVolSettingInactivityTimer();
SEND_EVENT(idle_get_window(), IDLE_UPDATE, 0, 0);
break;
case KCD_F4:
if (HallStatus())
break;
else
{
returntoidle(1);
break;
}
case KCD_HUP:
#ifdef ONEKEY_TOIDLE
{
#ifdef QQFUNC
if ((In_QQ)&&((menutype == Nvm_fri_list)||(menutype == Net_fri_list)
||(menutype == Sys_info_list)||(menutype == Chat_info_list)
||(menutype == Left_info_list)||(menutype == Unread_info_list)))
{
T_MFW_HND listwin = mfwParent( window);//window=bookmenu win
T_MFW_HND listpawin = mfwParent( listwin);////listpa win
SEND_EVENT(window, E_MNU_ESCAPE, 0, 0);
FreeListMemory();
listsDestroy(listwin);
SEND_EVENT(listpawin, 0, 0, 0);
menutype=0;
}
else
#endif //QQFUNC
//mnuEscape( data->menu ); //we don't escapemenu.
if (returntoidle(0))
break;
}
#endif //ONEKEY_TOIDLE
case KCD_RIGHT:
{
// keypadLock will not activate anymore
data->status_of_timer = TRUE;
HUPKeyOrigin = 0; // sbh - we're coming from the menu screen, so don't shut down right away
if (menutype == PhbkHostkeyList)
{
menutype = 0;
//flash_hostread();
}
else if (menutype == PhbkHostkeyOnOffList)
{
menutype = 0; //xsf add 2003.03.03
flash_hostread();
}
/* get us out of here */
#ifdef QQFUNC
if ((In_QQ)&&((menutype == Nvm_fri_list)||(menutype == Net_fri_list)
||(menutype == Sys_info_list)||(menutype == Chat_info_list)
||(menutype == Left_info_list)||(menutype == Unread_info_list)))
{
T_MFW_HND listwin = mfwParent( window);//window=bookmenu win
T_MFW_HND listpawin = mfwParent( listwin);////listpa win
SEND_EVENT(window, E_MNU_ESCAPE, 0, 0);
FreeListMemory();
listsDestroy(listwin);
SEND_EVENT(listpawin, 0, 0, 0);
menutype=0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -