1、MTK列表菜单绘制精一、/画做软键小列表菜单 /所对应的DMWgui_categories_enum.h (d:whc1068_c015plutommimmiguigui_incMMI_CATEGORYLSK_ID,(CustCoordinates.c (d:whc1068_c015plutommicustomercustresource)MMI_CATEGORYLSK_ID, (U8 * categoryLSK, (S16 * coordinate_setLSK, NULL,const U8 categoryLSK = 6,DM_BASE_LAYER_START,DM_SCR_BG, DM_
2、RECTANGLE,DM_CATEGORY_CONTROLLED_AREA,DM_LIST1,DM_BUTTON_BAR1;const S16 coordinate_setLSK = 0, 0, MAIN_LCD_DEVICE_WIDTH, MAIN_LCD_DEVICE_HEIGHT, DM_NO_FLAGS, /* Category Screen Coordinates */0, 0, MAIN_LCD_DEVICE_WIDTH, MAIN_LCD_DEVICE_HEIGHT, DM_NO_FLAGS, /* greyscale rectangle */0, 158,120,136, DM
3、_NO_FLAGS, /* control area */1,160,120,136, DM_CENTRE_ALIGN_X | DM_CENTER_ALIGN_Y,0, MAIN_LCD_DEVICE_HEIGHT - MMI_BUTTON_BAR_HEIGHT, MAIN_LCD_DEVICE_WIDTH, MMI_BUTTON_BAR_HEIGHT,DM_BUTTON_DISABLE_BACKGROUND, MMI_SOFTKEY_WIDTH /* Button Bar */;/* code */void DrawRectangle(gui_draw_rectangle(0, 158,12
4、1,296,UI_COLOR_BLACK;gui_draw_rectangle(0,157,123,298,UI_COLOR_GREEN;gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1;void ShowCategoryLSKScreen(/左软键进入菜单项模板dm_data_struct dm_data;S32 i; S32 number_of_items;U8* history_buffer=NULL;color c = UI_COLOR_GREEN;gdi_layer_lock_frame_buffer(;/D
5、rawBackgroundBar(;wgui_fixed_list_create_icontext_menu(8, 0, 0, MMI_CATEGORY10_ID, history_buffer;wgui_fixed_list_begin_add_icontext_one_item(;for(i = 0; i small_list_menu_highlight_without_scrollbar_filler;/MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR|UI_LIST_MENU_DISABLE_BACKGROUND;
6、gdi_layer_unlock_frame_buffer(;dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size;dm_data.s32ScrId = (S32 GetActiveScreenId(;dm_data.s32CatId = MMI_CATEGORYLSK_ID;dm_data.s32flags = 0; dm_add_rectangle(c, DM_RECTANGLE_FILL_GRAYSCALE;dm_setup_
7、data(&dm_data; dm_redraw_category_screen(;gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1;void mmi_fmreadapp_LSK_entery(voidS32 i;U8 *guiBuffer = NULL;U16 Iconlistt5;U16 ItemListt5;EntryNewScreen(SCR_FMREADAPP_MAIN,NULL,NULL,NULL;entry_full_screen(;ShowCategoryLSKScreen(;DrawTitleButt
8、onBar(;DrawRectangle(;change_left_softkey(STR_GLOBAL_OK,NULL;change_right_softkey(STR_GLOBAL_QUIT,NULL;show_softkey(MMI_LEFT_SOFTKEY;show_softkey(MMI_RIGHT_SOFTKEY;SetLeftSoftkeyFunction(mmi_fmreadapp_FirstPage, KEY_EVENT_UP; /SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP;SetKeyHandler(GoBackH
9、istory,KEY_RSK,KEY_EVENT_UP;gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1;二、/画列表菜单/所对应的DMWgui_categories_enum.h (d:whc1068_c015plutommimmiguigui_incMMI_CATEGORYChapterList_ID,(CustCoordinates.c (d:whc1068_c015plutommicustomercustresource)MMI_CATEGORYChapterList_ID, (U8 * categoryCha
10、pterList, (S16 * coordinate_setChapterList, NULL,const U8 categoryChapterList = 5,DM_BASE_LAYER_START,DM_SCR_BG, /没有这个高亮时会把整个字体盖住DM_CATEGORY_CONTROLLED_AREA,/DM_BASE_CONTROL_SET_SUBMENU,DM_LIST1, DM_BUTTON_BAR1;const S16 coordinate_setChapterList = DM_FULL_SCREEN_COORDINATE_FLAG, DM_FULL_SCREEN_COOR
11、DINATE_FLAG,/MMI_SUBMENU_CONTENT_X, MMI_SUBMENU_CONTENT_Y, MMI_SUBMENU_CONTENT_WIDTH, MMI_SUBMENU_CONTENT_HEIGHT, DM_CENTRE_ALIGN_X | DM_CENTER_ALIGN_Y0,35,240,260, DM_CENTRE_ALIGN_X | DM_CENTER_ALIGN_Y, 0, MAIN_LCD_DEVICE_HEIGHT - MMI_BUTTON_BAR_HEIGHT, MAIN_LCD_DEVICE_WIDTH, MMI_BUTTON_BAR_HEIGHT,
12、DM_BUTTON_DISABLE_BACKGROUND, MMI_SOFTKEY_WIDTH;/*code */void Mybookshelf_draw_text(S32 item_indexgui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1;void category668_highlight_handler(S32 item_indexMybookshelf_draw_text(item_index;/* void RedrawCategory668Screen(voidgdi_layer_lock_frame_
13、buffer(;show_fixed_list(;show_softkey(MMI_LEFT_SOFTKEY;show_softkey(MMI_RIGHT_SOFTKEY;gdi_layer_unlock_frame_buffer(;gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1;*/ void ExitCategory668Screen(voidClearHighlightHandler(;/清掉所有高亮响应函数reset_softkeys(;/重置左右软键reset_menu_shortcut_handler(;
14、/重置快捷序号框reset_fixed_list(;/重置列表菜单void ShowCategoryChapterListScreen( U16 left_softkey,U16 left_softkey_icon,U16 right_softkey,U16 right_softkey_icon,S32 number_of_items,U16 *list_of_items,U16 *list_of_icons,S32 highlighted_item,U8* history_bufferS8 i;dm_data_struct dm_data;entry_full_screen(;clear_s
15、creen(;DrawTitleButtonBar(;MMI_current_menu_type=LIST_MENU;create_fixed_icontext_menuitems(;associate_fixed_icontext_list(;for(i=0;inumber_of_items;i+add_fixed_icontext_item(L大话西游,(PU8GetImage(IMG_GLOBAL_L1+i;register_fixed_list_shortcut_handler(;register_fixed_list_keys(;register_fixed_list_highlig
16、ht_handler(category668_highlight_handler;fixed_list_goto_item_no_redraw(0;show_fixed_list(;/ RedrawCategoryFunction=RedrawCategory668Screen;dm_setup_category_functions(dm_redraw_category_screen, dm_get_category_history, dm_get_category_history_size;dm_data.s32ScrId = (S32 GetActiveScreenId(;dm_data.
17、s32CatId = MMI_CATEGORYChapterList_ID;dm_data.s32flags = 0; dm_setup_data(&dm_data; dm_redraw_category_screen(;change_left_softkey(STR_GLOBAL_OK,NULL;change_right_softkey(STR_GLOBAL_BACK,NULL;show_softkey(MMI_LEFT_SOFTKEY;show_softkey(MMI_RIGHT_SOFTKEY;SetLeftSoftkeyFunction(mmi_fmreadapp_LSK_entery
18、, KEY_EVENT_UP; SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP;void mmi_fmreadapp_ChapterList_entery(voidS32 i;U16 list_of_items10;U16 list_of_icons10;U8* history_buffer;/ for(i=0;i10;i+/list_of_itemsi=STR_GLOBAL_FILENAME+i;/list_of_iconsi=IMG_GLOBAL_L1+i;/ DrawTitleButtonBar(;EntryNewScreen(SC
19、R_FMREADAPP_MAIN,NULL,mmi_fmreadapp_ChapterList_entery,NULL;ShowCategoryChapterListScreen(U8*GetString(STR_GLOBAL_OK,0,(U8*GetString(STR_GLOBAL_BACK,0,10,(U8* list_of_items,list_of_icons,2,(U8* history_buffer;gui_BLT_double_buffer(0,0,UI_device_width-1,UI_device_height-1;三、/搜索界面(暂时未写出)/*void entry_s
20、earch_result_screen(voidkey_word = OslMalloc(FMREAD_SEARCH_LEN*2;memset(key_word,0,FMREAD_SEARCH_LEN*2;mmi_chset_convert(MMI_CHSET_UCS2, MMI_CHSET, (char*tmp_key_word, (char*key_word, FMREAD_SEARCH_LEN*2;ui_gid=8;fmread_popup(NULL,NULL,STR_GLOBAL_BACK,IMG_GLOBAL_BACK,(UI_string_typeGetString(STR_GLO
21、BAL_LOADING,IMG_GLOBAL_LOADING,NULL;/加载中void show_search_content_screen(voidU8 *gui_buffer;EntryNewScreen(SCR_FMREADAPP_MAIN, NULL, NULL, NULL;SetParentHandler(0;gui_buffer = GetCurrGuiBuffer(SCR_FMREADAPP_MAIN;memset(tmp_key_word,0,FMREAD_SEARCH_LEN*2;ShowCategory5Screen(STR_GLOBAL_SUBJECT,GetRootT
22、itleIcon(ORGANIZER_TODOLIST_MENU,STR_GLOBAL_OK,IMG_GLOBAL_OK,STR_GLOBAL_BACK,IMG_GLOBAL_BACK,IMM_INPUT_TYPE_SENTENCE,(U8* tmp_key_word,FMREAD_SEARCH_LEN,gui_buffer;ClearKeyHandler(KEY_END, KEY_EVENT_DOWN;SetKeyHandler(GoBackHistory,KEY_END,KEY_EVENT_DOWN;SetLeftSoftkeyFunction(entry_search_result_screen, KEY_EVENT_UP;SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP;*/注:现在的问题:1. 添加“左软键”菜单之后,点击屏幕,也会直接进入左软键列表,正常效果为:点击屏幕进入小说阅读界面,点击左软键“菜单”项进入列表。2. “搜索”界面还是原来版本的界面,和现在界面不配套。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1