|
发表于 2010-8-11 10:34:05
|
显示全部楼层
wgui_fixed_matrix_create_menu(
number_of_items,
-1,
0,
0,
NULL);
wgui_fixed_matrix_begin_add_one_item();
for (i = 0; i < number_of_items; i++)
{
list_of_items= title;
wgui_fixed_matrix_add_one_item(
i,
(U8*)(list_of_items),
get_image(list_of_icons));
}
MMI_fixed_matrix_menu.flags |= UI_MATRIX_MENU_LOOP;
MMI_current_menu_type = MATRIX_MENU;
gui_set_fixed_matrix_menu_theme(&MMI_fixed_matrix_menu, current_UI_theme->fixed_matrix_menu_theme);
fixed_icontext_menuitem_apply_theme(current_UI_theme->fixed_icontext_menuitem_theme);
register_fixed_matrix_highlight_handler(standard_animated_matrix_highlight_handler_type2);
#ifdef __MAINMENU_DISPLAY_TEXT__
#if !defined(__MMI_MAINLCD_320X480__)&&!defined(__MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__)
wgui_fixed_matrix_move_menu(0, (MMI_title_y + MMI_title_height));
wgui_fixed_matrix_resize_menu(MMI_content_width, MMI_content_height);
#endif
#else
#if !defined(__MMI_MAINLCD_320X480__)
wgui_fixed_matrix_move_menu(0, (MMI_title_y + MMI_title_height));
wgui_fixed_matrix_resize_menu(MMI_content_width, MMI_content_height);
#endif
#endif
gui_measure_image(get_image(list_of_icons[0]), &ixsize, &iysize);
#ifdef __MMI_MAINLCD_320X480__
iysize += MAIN_MENU_TEXT_AREA_HEIGHT;
#endif
#ifdef __MMI_MAINLCD_320X240__
configure_fixed_matrix(ixsize, iysize, 4, 0);
#else /* __MMI_MAINLCD_320X240__ */
configure_fixed_matrix(ixsize, iysize, 3, 0);
#endif /* __MMI_MAINLCD_320X240__ */
wgui_fixed_matrix_end_add_one_item();
shortcut_width = set_menu_item_count(number_of_items) + 7;
resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
#ifdef __MMI_MAINLCD_320X480__
set_fixed_icontext_positions(1, iysize - MAIN_MENU_TEXT_AREA_HEIGHT + MAIN_MENU_TEXT_GAP, 0, 0);
MMI_fixed_icontext_menuitem.flags &= ~UI_MENUITEM_CENTER_ICON_Y;
MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_CENTER_TEXT_X;
#else
set_fixed_icontext_positions(0, 0, 0, 0);
wgui_title_disable_menu_shortcut_display(MMI_FALSE);
#ifdef __MMI_WALLPAPER_ON_BOTTOM__
dm_get_scr_bg_flag(&mm_bg_flags);
dm_set_scr_bg_flag(mm_bg_flags | DM_SCR_BG_FORCE_SHOW);
#endif
h_flag = set_matrix_menu_category_history(MMI_CATEGORY14_MATRIX_ID, history_buffer);
#ifdef __MMI_WGUI_MINI_TAB_BAR__
if (wgui_if_mini_tab_bar_in_parent() == MMI_TRUE)
{
S32 idx = (S32) wgui_mini_tab_bar_get_index();
fixed_matrix_goto_item_no_redraw(idx);
}
else
#endif /* __MMI_WGUI_MINI_TAB_BAR__ */
fixed_matrix_goto_item_no_redraw(0);
MMI_title_string = (UI_string_type) (title);
MMI_fixed_icontext_menuitem.flags |= UI_MENUITEM_FOCUSSED_ANIMATE;
SetKeyHandler(fixed_matrix_goto_previous_item, KEY_VOL_UP, KEY_EVENT_DOWN);
SetKeyHandler(fixed_matrix_goto_next_item, KEY_VOL_DOWN, KEY_EVENT_DOWN);
cat_id = MMI_CATEGORY52_MATRIX_ID;
#ifdef __MMI_MATRIX_MAIN_MENU_OPTIMIZE__
/* allocate matrix highlight buffer from SCR ASM */
// MMI_fixed_matrix_menu.buffer.buf_ptr = (U8*)applib_mem_screen_alloc(MMI_MAIN_MENU_MATRIX_HIGHLIGHTED_BUF_SIZE);
// MMI_ASSERT(MMI_fixed_matrix_menu.buffer.buf_ptr != NULL);
#endif /* __MMI_MATRIX_MAIN_MENU_OPTIMIZE__ */
#endif
break;
default:
#endif
cat_id = MMI_CATEGORY52_ID; |
|