⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dict_pinyin.c

📁 在mtk平台上开发的电子词典源码
💻 C
字号:
#include "dict.h"
#include "VoiceMemoProt.h"
void dict_pinyin_back(void);
extern void dict_input_option_end(void);
void LM_pinyin_shurufa(void)
 {
 	unsigned char * guiBuffer=NULL;
	if( DICT_IS_CHARGED==0)
	{
		return ;
	}
	LM_dict_chinese_input_flag=1;////进入编辑窗口
	Set_GOBACK_NORMAL();
	EntryNewScreen(ZX_SCR_ID_LM_PINYIN_WIN, NULL, LM_pinyin_shurufa, NULL);
//	SetParentHandler(0);
	guiBuffer = GetCurrGuiBuffer(ZX_SCR_ID_LM_PINYIN_WIN);
	switch(dict_sc_cur_menu)
	{
		case 0:
		case 4:
		case 5:
		ShowCategory5Screen
			(
				STR_PALM_INPUT_END,
				0,
	       		STR_GLOBAL_OK,
	      			0,
	      			STR_GLOBAL_BACK,
				0,
				INPUT_TYPE_ALPHANUMERIC_LOWERCASE | INPUT_TYPE_OVERRIDE_DEFAULT | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,//INPUT_TYPE_SM_MULTITAP_PINYIN,
				(PU8) gnoteString1,
				30,
				guiBuffer
			);
			break;
		case 1:
		case 2:
		case 3:
		ShowCategory5Screen
			(
				STR_PALM_INPUT_END,
				0,
	       		STR_GLOBAL_OK,
	      			0,
	      			STR_GLOBAL_BACK,
				0,
				INPUT_TYPE_SM_PINYIN,//INPUT_TYPE_SM_MULTITAP_PINYIN,
				(PU8) gnoteString1,
				30,
				guiBuffer
			);
			break;
	}
       Set_GOBACK_NORMAL();////补丁函数,只起“不死机”的作用
	SetLeftSoftkeyFunction(Finish_Back, KEY_EVENT_UP);
	SetCategory5RightSoftkeyFunction(LM_pinyin_rightkey_fun, KEY_EVENT_UP);
}

/////////////////////////////////////////////////////

void Finish_Back(void)
{
	memset(tempsave, 0, 64);
	memcpy(tempsave,gnoteString1,64);
	GoBackHistory();
}
void LM_pinyin_rightkey_fun(void)
{
	memset(tempsave,0,64);
	GoBackHistory();
}
void zx_show_text_mid(unsigned short y_offset,char*p_buffer,unsigned char r,unsigned char g,unsigned char b)
{
	char un_buffer[128];
	int width;
	int height;
	zx_gb_to_un(un_buffer, p_buffer, 128);
	gui_measure_string((unsigned short *)un_buffer, &width, &height);
	gui_set_text_color(gui_color(r,g,b));
	gui_move_text_cursor((UI_device_width-width)/2,y_offset);
	gui_print_text((unsigned short*)un_buffer);
	gui_BLT_double_buffer((UI_device_width-width)/2,y_offset,(UI_device_width-width)/2+width,y_offset+height);
}
void zx_draw_pic_not_anim(	char *gb_name,int off_XX,int off_YY,int is_need_blt)
{
	char name_gb[128];
	char name_un[256];	
	int	image_height=0,image_width=0;
	memset(name_un, 0, 256);
	memset(name_gb, 0, 128);
	sprintf(name_gb, "%c:\\%s", DICT_DISK_TYPE, gb_name);
	zx_gb_to_un(name_un, name_gb, 256);
	gdi_image_get_dimension_file((char *)name_un, &image_width, &image_height);
	if(is_need_blt)
		gui_lock_double_buffer();

	gdi_image_draw_file(off_XX, off_YY, name_un);
	if(is_need_blt)
	{
		gui_unlock_double_buffer();
		gui_BLT_double_buffer(off_XX, off_YY, off_XX+image_width, off_YY+image_height);
	}
}
void zx_show_text(int offset_x,int offset_y,char* gb_buffer,unsigned char r,unsigned char g,unsigned char b)
{
	int width,height;
	char un_buffer[256];
	memset(un_buffer,0,256);
	zx_gb_to_un(un_buffer, gb_buffer, 256);
	gui_move_text_cursor(offset_x,offset_y);
	gui_set_text_color(gui_color(r,g,b));
	gui_measure_string((unsigned short *)un_buffer, &width, &height);
	gui_print_text((unsigned short *)un_buffer);
	gui_BLT_double_buffer(offset_x,offset_y,offset_x+width,offset_y+height);
}
void zx_gb_to_un(char *pOutBuffer, char *pInBuffer, unsigned int OutLen)
{
	if(pOutBuffer==NULL || pInBuffer==NULL || OutLen==0)	return;
	mmi_chset_text_to_ucs2_str((unsigned char*)pOutBuffer, (unsigned short)OutLen, (unsigned char*)pInBuffer, GB2312_ENCODING_TYPE);
}
int	zx_openfile(unsigned char drive, char *file_name, unsigned int type)
{
	int			File_Handle=0;
	unsigned	short	un_buf[128];
	char			text_buf[128];

	memset(un_buf, 0, 256);
	memset(text_buf, 0, 128);
	sprintf((char *)text_buf, "%c%s", (char)drive, file_name);
	AnsiiToUnicodeString((char *)un_buf, (char *)text_buf);
	File_Handle=FS_Open((WCHAR *)un_buf, type);
	return(File_Handle);
}




















}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -