📄 dlg_detail.c
字号:
/*-------------------------------------------------** $RCSfile$* $Date$* $Author$* $Log$* Function :* Usage :* Version :* Return Code :* Revision :* Remark :*--------------------------------------------------*/#pragma far_pid_on#pragma far_pic_on#include "cb_dic/cb_dic.h"/********************************************************Func: enter a detail of per word(when come from list* or come from detail due to a new word)*In: hwnd -> window header logic_id -> the number in one srceen*Out: *word_detail -> save detail of word*I/O:*Modify:*Return: success -> CB_RTN_OK fail -> CB_RTN_ERROR*Author: ********************************************************/INT8 init_detail( HWND hwnd, INT8 logic_id, CB_WORD_DETAIL *word_detail ){ char format_expl[2*L_EXPL+1]; //存放格式化的解释. memset( word_detail, 0, sizeof(CB_WORD_DETAIL) ); //先不考虑反查 fancha_flag:0 cba_get_detail( word_detail, logic_id ,0); /* move to history in this function */ SetWindowText( GetDlgItem( hwnd, TXT_WORD ), word_detail->data.word ); memset( format_expl, 0, sizeof(format_expl) ); sprintf( format_expl, "<table><tr><td width=240><p>%s</p>%s</td></tr></table>", word_detail->phon, word_detail->expl ); SetWindowText( GetDlgItem( hwnd, EDT_DETAIL ), format_expl ); SetFocus( GetDlgItem( hwnd, EDT_DETAIL ) ); return CB_RTN_OK;}/**********************************************Func: Word detail process*In:*Out:*I/O:*Modify:*Return:*Author: **********************************************/LRESULT CALLBACK dlgDetailProc( HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam ){ HDC hdc; PAINTSTRUCT ps; static CB_WORD_DETAIL word_detail; static CB_GUI_MAIN *p_gui_main = NULL; switch ( iMsg ) { case WM_CREATE:#if LINUX_FS (MWBRUSHOBJ *)hwnd->pClass->hbrBackground = GetStockObject( WHITE_BRUSH );#endif break; case WM_INITDIALOG: p_gui_main = (CB_GUI_MAIN *)lParam; init_detail( hwnd, p_gui_main->select_record, &word_detail ); break; case WM_CHAR: if( ( LOWORD( wParam ) >= 'A' && LOWORD( wParam ) <= 'Z' ) || ( LOWORD( wParam ) >= 'a' && LOWORD( wParam ) <= 'z' ) ) { p_gui_main->input_ch = LOWORD( wParam ); EndDialog( hwnd, TRUE ); break; } break; case WM_KEYDOWN: switch( LOWORD( wParam ) ) { case VK_LEFT: if( p_gui_main->hwnd_main == NULL ) break; SendMessage( p_gui_main->hwnd_main,WM_KEYDOWN,VK_UP,0L ); init_detail(hwnd,p_gui_main->select_record,&word_detail); break; case VK_RIGHT: if( p_gui_main->hwnd_main == NULL ) break; SendMessage(p_gui_main->hwnd_main,WM_KEYDOWN,VK_DOWN,0L); init_detail(hwnd,p_gui_main->select_record,&word_detail); break; } break; case WM_KEYUP: switch( LOWORD( wParam ) ) { case VK_F3: //Temply using this key message replace of Shift_F4 cba_to_nw_db( word_detail.word_id ); break; //example process case VK_F4: if(word_detail.lj_id_num > 0){ SetDefaultKeyWindow( NULL ); ModalDialogBoxParamEx( NULL, "DLG_EXAM", hwnd, dlgExamProc, (LPARAM)&word_detail, dialog_info, EXAM ); } break; case VK_ESCAPE: EndDialog( hwnd, TRUE ); break; } break; case WM_PAINT: hdc = BeginPaint( hwnd, &ps ); MoveToEx( hdc, 0, 14, NULL ); LineTo( hdc, V6100_WIDTH, 14 ); MoveToEx( hdc, 0, 15, NULL ); LineTo( hdc, V6100_WIDTH, 15 ); EndPaint( hwnd, &ps ); break; default: return DefWindowProc( hwnd, iMsg, wParam, lParam ); } return ( FALSE );}#pragma far_pic_off#pragma far_pid_off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -