📄 mmibooksearchwindow.c
字号:
for( i=0;i<PHONEBOOK_RECORD_PERPAGE;i++ )
{
/* 2004/06 sunsj modify for picture manage */
memcpy(DynamicBuffer[i].name,l_phb_index[bookname[(Phbk->BufferIndex+i)%SearchTotal].index].name,PHB_name_len);
if( l_phb_index[bookname[(Phbk->BufferIndex+i)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_NVMBOOK, 0);//nvmbookicon;
else if( l_phb_index[bookname[(Phbk->BufferIndex+i)%SearchTotal].index].phonebook==SIM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_SIMBOOK, 0);//simbookicon;
}
mnuChooseVisibleItem(dataInfo->MenuLists,PHONEBOOK_RECORD_PERPAGE-1);
show_index=bookname[(Phbk->BufferIndex+PHONEBOOK_RECORD_PERPAGE-1)%SearchTotal].index;
show_number();
}
}
}
break;
case LISTS_REASON_DOWN:
{
if( Phbk->BufferTable==GlobalTable )
{
if( (ListData->CursorPosition+1<PHONEBOOK_RECORD_PERPAGE) || (SearchTotal<=PHONEBOOK_RECORD_PERPAGE) )
{
dataInfo->MenuListsAttr.pageturnindex=((Phbk->BufferIndex+ListData->CursorPosition+1)%SearchTotal)+1;
mnuDown(dataInfo->MenuLists);
show_index=l_phb_sort_index[(Phbk->BufferIndex+ListData->CursorPosition+1)%SearchTotal].index;
show_number();
}
else
{
Phbk->BufferIndex=(Phbk->BufferIndex+PHONEBOOK_RECORD_PERPAGE)%SearchTotal;
dataInfo->MenuListsAttr.pageturnindex=((Phbk->BufferIndex)%SearchTotal)+1;
for( i=0;i<PHONEBOOK_RECORD_PERPAGE;i++ )
{
/* 2004/06 sunsj modify for picture manage */
memcpy(DynamicBuffer[i].name,l_phb_index[l_phb_sort_index[(Phbk->BufferIndex+i)%SearchTotal].index].name,PHB_name_len);
if( l_phb_index[l_phb_sort_index[(Phbk->BufferIndex+i)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_NVMBOOK, 0);//nvmbookicon;
else if( l_phb_index[l_phb_sort_index[(Phbk->BufferIndex+i)%SearchTotal].index].phonebook==SIM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_SIMBOOK, 0);//simbookicon;
}
mnuChooseVisibleItem(dataInfo->MenuLists,0);
show_index=l_phb_sort_index[(Phbk->BufferIndex)%SearchTotal].index;
show_number();
}
}
else if( Phbk->BufferTable==SearchTable )
{
if( (ListData->CursorPosition+1<PHONEBOOK_RECORD_PERPAGE) || (SearchTotal<=PHONEBOOK_RECORD_PERPAGE) )
{
dataInfo->MenuListsAttr.pageturnindex=((Phbk->BufferIndex+ListData->CursorPosition+1)%SearchTotal)+1;
mnuDown(dataInfo->MenuLists);
show_index=bookname[(Phbk->BufferIndex+ListData->CursorPosition+1)%SearchTotal].index;
show_number();
}
else
{
Phbk->BufferIndex=(Phbk->BufferIndex+PHONEBOOK_RECORD_PERPAGE)%SearchTotal;
dataInfo->MenuListsAttr.pageturnindex=((Phbk->BufferIndex)%SearchTotal)+1;
for( i=0;i<PHONEBOOK_RECORD_PERPAGE;i++ )
{
/* 2004/06 sunsj modify for picture manage */
memcpy(DynamicBuffer[i].name,l_phb_index[bookname[(Phbk->BufferIndex+i)%SearchTotal].index].name,PHB_name_len);
if( l_phb_index[bookname[(Phbk->BufferIndex+i)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_NVMBOOK, 0);//nvmbookicon;
else if( l_phb_index[bookname[(Phbk->BufferIndex+i)%SearchTotal].index].phonebook==SIM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_SIMBOOK, 0);//simbookicon;
}
mnuChooseVisibleItem(dataInfo->MenuLists,0);
show_index=bookname[(Phbk->BufferIndex)%SearchTotal].index;
show_number();
}
}
}
break;
case LISTS_REASON_LEFT:
{
if( Phbk->BufferTable==GlobalTable )
{
if( l_phb_index[l_phb_sort_index[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
ShowPhoneBookNumber(l_phb_sort_index[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index,TOLEFT);
}
else if( Phbk->BufferTable==SearchTable )
{
if( l_phb_index[bookname[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
ShowPhoneBookNumber(bookname[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index,TOLEFT);
}
}
break;
case LISTS_REASON_RIGHT:
{
if( Phbk->BufferTable==GlobalTable )
{
if( l_phb_index[l_phb_sort_index[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
ShowPhoneBookNumber(l_phb_sort_index[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index,TORIGHT);
}
else if( Phbk->BufferTable==SearchTable )
{
if( l_phb_index[bookname[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index].phonebook==NVM_BOOK_SEL )
ShowPhoneBookNumber(bookname[(Phbk->BufferIndex+ListData->CursorPosition)%SearchTotal].index,TORIGHT);
}
}
break;
case LISTS_REASON_KCD0:
{
}
break;
case LISTS_REASON_KCD1:
{
}
break;
case LISTS_REASON_KCD2:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_2);
}
break;
case LISTS_REASON_KCD3:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_3);
}
break;
case LISTS_REASON_KCD4:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_4);
}
break;
case LISTS_REASON_KCD5:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_5);
}
break;
case LISTS_REASON_KCD6:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_6);
}
break;
case LISTS_REASON_KCD7:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_7);
}
break;
case LISTS_REASON_KCD8:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_8);
}
break;
case LISTS_REASON_KCD9:
{
if( wstrlen(data->edtBuf)<2||(cursor_correct==0&&wstrlen(data->edtBuf)==2) )
yq_edtchar(data->edt,KCD_9);
}
break;
default:break;
}
dspl_Enable(oldmode);
}
/*******************************************************************************
$Function: bookSearchStart
$Description: Starts the search window
$Returns: handle of newly created window, or NULL if error
$Arguments: parent, handle of parent window
*******************************************************************************/
T_MFW_HND bookSearchStart( MfwHnd parent )
{
T_MFW_WIN *parent_win_data = ( (T_MFW_HDR *) parent )->data;
T_phbk *Phbk = (T_phbk *) parent_win_data->user;
T_MFW_HND win;
int i;
if( ( win = bookSearchCreate( parent ) ) == NULL ) return NULL;
else
{
SetWindowsHandle(win);
SetPhbkIN(1);
ShortName=0;
switch( Phbk->EntryType )
{
case PhbkFromShortcutKey:
case PhbkFromSms:
case PhbkFromDivert:
{
Phbk->BufferTable=GlobalTable;
if( PHBKTotal<=PHONEBOOK_RECORD_PERPAGE )
{
for( i=0;i<PHBKTotal;i++ )
{
/* 2004/06 sunsj modify for picture manage */
memcpy(DynamicBuffer[i].name,l_phb_index[l_phb_sort_index[i].index].name,PHB_name_len);
if( l_phb_index[l_phb_sort_index[i].index].phonebook==NVM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_NVMBOOK, 0);//nvmbookicon;
else if( l_phb_index[l_phb_sort_index[i].index].phonebook==SIM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_SIMBOOK, 0);//simbookicon;
}
}
else
{
for( i=0;i<PHONEBOOK_RECORD_PERPAGE;i++ )
{
/* 2004/06 sunsj modify for picture manage */
memcpy(DynamicBuffer[i].name,l_phb_index[l_phb_sort_index[i].index].name,PHB_name_len);
if( l_phb_index[l_phb_sort_index[i].index].phonebook==NVM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_NVMBOOK, 0);//nvmbookicon;
else if( l_phb_index[l_phb_sort_index[i].index].phonebook==SIM_BOOK_SEL )
DynamicBuffer[i].bookicon = *GET_ICONATTR(ICON_SIMBOOK, 0);//simbookicon;
}
}
Phbk->BufferIndex=0;
SearchTotal=PHBKTotal;
SEND_EVENT(win, SEARCH_INIT, NULL, NULL);
}
break;
case PhbkNormal:
{
Phbk->BufferTable=SearchTable;
SEND_EVENT (win, SEARCH_INPUT, NULL, NULL);
}
break;
}
}
return win;
}
/*******************************************************************************
$Function: bookSearchDestroy
$Description: Destroy the search window
$Returns: None
$Arguments: Window, handle of the window to be destroyed
*******************************************************************************/
void bookSearchDestroy( MfwHnd window )
{
T_MFW_WIN *win = ((T_MFW_HDR *) window)->data;
tBookStandard *data = (tBookStandard *) win->user;
TRACE_FUNCTION( "bookSearchDestroy()" );
// Only destroy if the data is valid
if( data )
{
// If we're the root window we destroy using it's function
if( data->phbk->root_win == window )
{
bookPhonebookDestroy( data->phbk->win );
return;
}
if( show_timer )
{
timStop(show_timer);
timDelete(show_timer);
show_timer=0;
}
if( e
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -