2020年企业培训培训资料自定义模板

上传人:精****库 文档编号:136113489 上传时间:2020-06-24 格式:DOC 页数:16 大小:72.61KB
返回 下载 相关 举报
2020年企业培训培训资料自定义模板_第1页
第1页 / 共16页
2020年企业培训培训资料自定义模板_第2页
第2页 / 共16页
2020年企业培训培训资料自定义模板_第3页
第3页 / 共16页
2020年企业培训培训资料自定义模板_第4页
第4页 / 共16页
2020年企业培训培训资料自定义模板_第5页
第5页 / 共16页
点击查看更多>>
资源描述

《2020年企业培训培训资料自定义模板》由会员分享,可在线阅读,更多相关《2020年企业培训培训资料自定义模板(16页珍藏版)》请在金锄头文库上搜索。

1、mtk平台mmi培训资料(中文)2008-06-06 21:48本文详细说明了如何建设一个自定义列表窗体模板。原理部分请参见MTK平台(1)如何添加一个窗体模板。最终实现的是一个字典输入界面。布局为:该模板不包含业务逻辑,仅提供页面显示和InputBox框输入事件后的ListBox的Redraw事件的注册,以及基本的输入法设置、清空后的返回函数。一、添加用户自定义列表模板的过程(一)在g_categories_controls_map中加入:,MMI_CATEGORY_CUSTOM_LIST,(U8*)custom_define_list,(s16*)coordinate_custom_lis

2、t,NULLconst U8 custom_define_list= 5, DM_BASE_LAYER_START, DM_SCR_BG, DM_BASE_CONTROL_SET1, DM_SINGLELINE_INPUTBOX1, DM_LIST1;const S16 coordinate_custom_list= DM_FULL_SCREEN_COORDINATE_FLAG, DM_CUSTOM_DEFINE_INPUTBOX, /需要定义 DM_CUSTOM_DEFINE_LIST /需要定义;(二)在dm_get_coordinates()函数中加入:/设定列表位置和大小(不要忘记全局

3、变量 MMI_custom_Listbox_x 等的定义)else if( *UICtrlAccessPtr_p = DM_CUSTOM_DEFINE_LIST ) dm_coordinate_info-s16X = MMI_custom_Listbox_x; dm_coordinate_info-s16Y = MMI_custom_Listbox_y; dm_coordinate_info-s16Width = MMI_custom_Listbox_width; dm_coordinate_info-s16Height = MMI_custom_Listbox_height; dm_coor

4、dinate_info-Flags = DM_NO_FLAGS;UICtrlAccessPtr_p + ;/设定输入框位置和大小else if( *UICtrlAccessPtr_p = DM_CUSTOM_DEFINE_INPUTBOX ) dm_coordinate_info-s16X = MMI_custom_inputbox_x ; dm_coordinate_info-s16Y = MMI_custom_inputbox_y; dm_coordinate_info-s16Width = MMI_custom_inputbox_width ;dm_coordinate_info-s16

5、Height = MMI_custom_inputbox_height; dm_coordinate_info-Flags = DM_SINGLE_LINE_INPUTBOX_SPECIFIC_HEIGHT; UICtrlAccessPtr_p + ;(三)在Wgui_category.c中定义模板显示函数void ShowCategoryCustomListScreen( U8 *title, U16 title_icon, U16 left_softkey, U16 left_softkey_icon, U16 right_softkey, U16 right_softkey_icon,

6、S32 number_of_items, U8 *list_of_items, U16 *list_of_icons, S32 flags, S32 highlighted_item, U8 *history_buffer) /*-*/ /* Local Variables */ /*-*/ dm_data_struct dm_data; S32 i; U8 h_flag; /*-*/ /* Code Body */ /*-*/ gdi_layer_lock_frame_buffer(); SetupCategoryKeyHandlers(); MMI_title_string = (UI_s

7、tring_type) title; MMI_title_icon = (PU8) get_image(title_icon); change_left_softkey(left_softkey, left_softkey_icon); change_right_softkey(right_softkey, right_softkey_icon);/Create List create_fixed_icontext_menuitems(); associate_fixed_icontext_list(); ShowListCategoryScreen( (UI_string_type) tit

8、le, get_image(title_icon), get_string(left_softkey), get_image(left_softkey_icon), get_string(right_softkey), get_image(right_softkey_icon), number_of_items); for (i = 0; i number_of_items; i+) add_fixed_icontext_item(UI_string_type) list_of_itemsi, wgui_get_list_menu_icon(i, list_of_iconsi); h_flag

9、 = set_list_menu_category_history(MMI_CATEGORY_CUSTOM_LIST, history_buffer); if (h_flag) fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item); else fixed_list_goto_item_no_redraw(highlighted_item); /Create Inputbox memset(custom_single_input_buffer,0,100); pfnUnicodeStrcpy(custom_sin

10、gle_input_buffer,LCustom Category); wgui_setup_singleline_inputbox( 0, 0, 240, 320, custom_single_input_buffer, pfnUnicodeStrlen(custom_single_input_buffer), MMI_CATEGORY_CUSTOM_LIST, get_string(right_softkey), get_image(right_softkey_icon), INPUT_TYPE_ALPHANUMERIC_LOWERCASE| INPUT_TYPE_USE_ONLY_ENG

11、LISH_MODES, history_buffer, 0); register_hide_multitap(wgui_hide_multitap); gdi_layer_unlock_frame_buffer(); ExitCategoryFunction = ExitCategoryCustomListScreen; dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size); dm_data.s32ScrId = (S32) Ge

12、tActiveScreenId(); dm_data.s32CatId = MMI_CATEGORY_CUSTOM_LIST;/不要忘记该常量MMI_CATEGORY_CUSTOM_LIST的定义 dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND; /dm_data.s32flags |= DM_SHOW_VKPAD; dm_register_vkpad_callback(CustomList_virtual_keypad_callback); dm_setup_data(&dm_data); dm_redraw_category_screen(); /* end of ShowCategory353Screen */void CustomList_virtual_keypad_callback(void)#if defined(_MMI_TOUCH_SCREEN_) mmi_pen_editor_clear_and_show_virtual_keyboard_area();#endif gui_show_transparent_image(0,200,GetImage(IMG_H_SELECT_LEFT),0);void ExitCategoryCu

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 企业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号