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

📄 wgui_categories.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
    {
        move_fixed_list(MMI_fixed_list_menu.x, MMI_content_y + 5);
        resize_fixed_list(MMI_fixed_list_menu.width, MMI_fixed_list_menu.height - 5);
        wgui_show_mini_tab_bar();
    }
#endif /* __MMI_WGUI_MINI_TAB_BAR__ */ 
    clear_buttonbar();
    show_title_status_icon();

#ifdef __MMI_UI_TITLE_TRANSITION__
    if (no_transition_in_title || get_title_transition() == WGUI_TRANSITION_NONE)
#endif 

        //PMT VIKAS START 20051209
        //For transition, title function call should be from here 
        draw_title();
    /* PMT VIKAS END 20051209 */

#ifdef __MMI_UI_LIST_TRANSITION__
    if (get_list_transition() == WGUI_TRANSITION_NONE)
#endif 
        show_fixed_list();
    show_softkey_background();
    show_left_softkey();
    show_right_softkey();
#ifdef __MMI_UI_TAB_PANE__
    if (is_enabled_tab_pane())
    {
        show_tab_pane();
    }
#endif /* __MMI_UI_TAB_PANE__ */ 
    gdi_layer_unlock_frame_buffer();

#ifdef __MMI_UI_LIST_TRANSITION__
    if (get_list_transition() == WGUI_TRANSITION_D2T)
    {
        show_fixed_list();
    }
#endif /* __MMI_UI_LIST_TRANSITION__ */ 

    /* PMT VIKAS START 20051209 */
#if defined(__MMI_UI_LIST_TRANSITION__) && (LIST_TRANSITION_STYLE_NON_BLOCKING == 1)
    if (get_list_transition() == WGUI_TRANSITION_T2D && is_in_nonblocking_list_transition() == 1)
    {
        gdi_layer_blt_previous(0, get_original_prev_list_y_value(), UI_device_width - 1, UI_device_height - 1);
    }
    else
#endif /* defined(__MMI_UI_LIST_TRANSITION__) && (LIST_TRANSITION_STYLE_NON_BLOCKING == 1) */ 
        /* PMT VIKAS END 20051209 */
        gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
}   /* end of RedrawListCategoryScreen */


/*****************************************************************************
 * FUNCTION
 *  ExitListCategoryScreen
 * DESCRIPTION
 *  Exit category function of current main lcd category scrren using list menu
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ExitListCategoryScreen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_disable_title_shortcut_display = 0; /* 042905 Calvin added */
    disable_menu_shortcut_box_display = 0;
    ClearHighlightHandler();
    reset_softkeys();
    reset_menu_shortcut_handler();
    reset_fixed_list();
    reset_pop_up_descriptions();

#ifdef __MMI_UI_HINTS_IN_MENUITEM__
    reset_all_force_flags_for_hints();
#ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
    gui_unblock_list_effect();
#endif 
#endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 

}   /* end of ExitListCategoryScreen */


/*****************************************************************************
 * FUNCTION
 *  GetListCategoryHistory
 * DESCRIPTION
 *  Get category history function of current main lcd category scrren
 *  using list menu
 * PARAMETERS
 *  history_buffer      [?]         
 *  history(?)          [IN]        Buffer store the valeu of history
 * RETURNS
 *  void
 *****************************************************************************/
U8 *GetListCategoryHistory(U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    get_list_menu_category_history((U16) g_gui_current_catid, history_buffer);
    return (history_buffer);
}   /* end of GetListCategoryHistory */


/*****************************************************************************
 * FUNCTION
 *  SetListScreenFunctions
 * DESCRIPTION
 *  Common functions to set ExitCategory, RedrawCategory, GetCategoryHistory
 *  GetCategoryHistorySize functions.
 * PARAMETERS
 *  cat_id      [IN]        Current category id
 * RETURNS
 *  void
 *****************************************************************************/
void SetListScreenFunctions(S32 cat_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ExitCategoryFunction = ExitListCategoryScreen;
    RedrawCategoryFunction = RedrawListCategoryScreen;
    GetCategoryHistory = GetListCategoryHistory;
    GetCategoryHistorySize = get_list_menu_category_history_size;
    g_gui_current_catid = cat_id;
}   /* end of SetListScreenFunctions */


/*****************************************************************************
 * FUNCTION
 *  ShowListCategoryScreen
 * DESCRIPTION
 *  Common function to show category screens containing list menu.
 * PARAMETERS
 *  title                   [IN]        String of title
 *  title_icon              [IN]        Icon of title
 *  left_softkey            [IN]        String of left softkey
 *  left_softkey_icon       [IN]        Icon of left softkey
 *  right_softkey           [IN]        String of right softkey
 *  right_softkey_icon      [IN]        Icon of right softkey
 *  number_of_items         [IN]        Number of items in list menu
 * RETURNS
 *  void
 *****************************************************************************/
void ShowListCategoryScreen(
        UI_string_type title,
        PU8 title_icon,
        UI_string_type left_softkey,
        PU8 left_softkey_icon,
        UI_string_type right_softkey,
        PU8 right_softkey_icon,
        S32 number_of_items)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 shortcut_width;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gdi_layer_lock_frame_buffer();

    /* Title */
    MMI_title_string = title;
    MMI_title_icon = title_icon;

    /* ShortCut */
    if (!wgui_is_disable_shortcut_display())
    {
        MMI_menu_shortcut_number = -1;
        register_fixed_list_shortcut_handler();
        shortcut_width = set_menu_item_count(number_of_items) + 7;
        resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
        move_menu_shortcut_handler(MMI_title_x + MMI_title_width - MMI_menu_shortcut_box.width, MMI_title_y);
        register_hide_menu_shortcut(gui_redraw_menu_shortcut);
    }
    else
    {
        MMI_disable_title_shortcut_display = 1;
        disable_menu_shortcut_box_display = 1;
    }

    /* Softkeys */
    set_left_softkey_label(left_softkey);
    set_left_softkey_icon(left_softkey_icon);
    set_right_softkey_label(right_softkey);
    set_right_softkey_icon(right_softkey_icon);
    SetupCategoryKeyHandlers();

    /* List */
    MMI_current_menu_type = LIST_MENU;
    register_fixed_list_keys();
    resize_fixed_icontext_menuitems(0, MMI_MENUITEM_HEIGHT);

    resize_fixed_icontext_menuitems(MMI_fixed_list_menu.width - MMI_fixed_list_menu.vbar.width - 1, MMI_fixed_icontext_menuitem.height);        /* 062705 Calvin added for width */
    register_fixed_list_highlight_handler(standard_list_highlight_handler);
    set_fixed_icontext_positions(MMI_MENUITEM_HEIGHT + 2, 0, 1, 0);

    gdi_layer_unlock_frame_buffer();
}   /* end of ShowListCategoryScreen */

/* End of Common List Category Screen  */


/*****************************************************************************
 * FUNCTION
 *  ShowCategory1Screen
 * DESCRIPTION
 *  Displays the category1 screen
 * PARAMETERS
 *  title                   [IN]        Title for the screen
 *  title_icon              [IN]        Icon shown with the title
 *  left_softkey            [IN]        Left softkey label
 *  left_softkey_icon       [IN]        Icon for the left softkey
 *  right_softkey           [IN]        Right softkey label
 *  right_softkey_icon      [IN]        Icon for the right softkey
 *  number_of_items         [IN]        Number of items
 *  list_of_items           [IN]        List of text items
 *  highlighted_item        [IN]        Index of the item to be highlighted by default
 *  history_buffer          [IN]        History buffer
 * RETURNS
 *  void
 *****************************************************************************/
void ShowCategory1Screen(
        U16 title,
        U16 title_icon,
        U16 left_softkey,
        U16 left_softkey_icon,
        U16 right_softkey,
        U16 right_softkey_icon,
        S32 number_of_items,
        U16 *list_of_items,
        S32 highlighted_item,
        U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 i = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    for (i = 0; i < number_of_items; i++)
    {
        subMenuDataPtrs[i] = (PU8) get_string(list_of_items[i]);
    }

#ifdef __MMI_UI_LIST_TRANSITION__
    if (!history_buffer)
    {
        set_list_transition(WGUI_TRANSITION_D2T);
    }
#endif /* __MMI_UI_LIST_TRANSITION__ */ 

    ShowCategory6Screen(
        title,
        title_icon,
        left_softkey,
        left_softkey_icon,
        right_softkey,
        right_softkey_icon,
        number_of_items,
        subMenuDataPtrs,
        NULL,
        highlighted_item,
        history_buffer);

#ifdef __MMI_UI_LIST_TRANSITION__
#if(!LIST_TRANSITION_STYLE_NON_BLOCKING)
    reset_list_transition();
#endif 
#endif /* __MMI_UI_LIST_TRANSITION__ */ 
}   /* end of ShowCategory1Screen */


/*****************************************************************************
 * FUNCTION
 *  ShowCategory2Screen
 * DESCRIPTION
 *  Displays the category2 screen
 * PARAMETERS
 *  title                   [IN]        Title for the screen
 *  title_icon              [IN]        Icon shown with the title
 *  left_softkey            [IN]        Left softkey label
 *  left_softkey_icon       [IN]        Icon for the Left softkey
 *  right_softkey           [IN]        Right softkey label
 *  right_softkey_icon      [IN]        Icon for the right softkey
 *  message                 [IN]        Message string
 *  history_buffer          [IN]        History buffer
 * RETURNS
 *  void
 *****************************************************************************/
void ShowCategory2Screen(
        U16 title,
        U16 title_icon,
        U16 left_softkey,
        U16 left_softkey_icon,
        U16 right_softkey,
        U16 right_softkey_icon,
        U16 message,
        U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *message_str = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    message_str = (U8*) get_string((MMI_ID_TYPE) message);
    ShowCategory7Screen(
        title,
        title_icon,
        left_softkey,
        left_softkey_icon,
        right_softkey,
        right_softkey_icon,
        message_str,
        history_buffer);
}   /* end of ShowCategory2Screen */


/*****************************************************************************
 * FUNCTION
 *  ShowCategory6Screen
 * DESCRIPTION
 *  Displays the category6 screen
 * PARAMETERS
 *  title                       [IN]        Title for the screen
 *  title_icon                  [IN]        Icon shown with the title
 *  left_softkey                [IN]        Left softkey label
 *  left_softkey_icon           [IN]        Icon for the left softkey
 *  right_softkey               [IN]        Right softkey label
 *  right_softkey_icon          [IN]        Icon for the right softkey
 *  number_of_items             [IN]        Number of items
 *  list_of_items               [IN]        List of text items.
 *  list_of_descriptions        [IN]        
 *  highlighted_item            [IN]        This is the default item that will be highlighted (if there is no history)
 *  history_buffer              [IN]        History buffer
 * RETURNS
 *  void
 *****************************************************************************/
void ShowCategory6Screen(
        U16 title,
        U16 title_icon,
        U16 left_softkey,
        U16 left_softkey_icon,
        U16 right_softkey,
        U16 right_softkey_icon,
        S32 number_of_items,
        U8 **list_of_items,
        U8 **list_of_descriptions,
        S32 highlighted_item,
        U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    dm_data_struct dm_data;
    S32 i = 0;
    U8 h_flag;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gdi_layer_lock_frame_buffer();

    resize_fixed_list(MMI_content_width, MMI_content_height);   /* 031805 Calvin modified */
    create_fixed_text_menuitems();
    associate_fixed_text_list();

    ShowListCategoryScreen(
        get_string(title),
        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);

    if (list_of_descriptions == NULL)
    {
        for (i = 0; i < number_of_items; i++)
        {
            add_fixed_text_item((UI_string_type) list_of_items[i]);
            wgui_pop_up_description_strings[i].text_strings[0] = NULL;
        }
    }
    else
    {
        for (i = 0; i < number_of_items; i++)
        {
            add_fixed_text_item((UI_string_type) list_of_items[i]);
            wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
        }
    }

    resize_fixed_text_menuitems_to_list_width();
    resize_fixed_text_menuitems(0, MMI_MENUITEM_HEIGHT);    /* 090605 Shortcut Calvin moved */

    h_flag = set_list_menu_category_history(MMI_CATEGORY6_ID, 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);
    }
    if (list_of_descriptions != NULL)
    {
        set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
    }

    gdi_layer_unlock_frame_buffer();

    ExitCategoryFunction = ExitListCategoryScreen;
    RedrawCategoryFunction = dm_redraw_category_screen;
    GetCategoryHistory = dm_get_category_history;
    GetCategoryHistorySize = dm_get_category_history_size;
    dm_data.s32ScrId = (S32) GetActiveScreenId();
    dm_data.s32CatId = MMI_CATEGORY6_ID;
    dm_data.s32flags = 0;
    dm_setup_data(&dm_data);
    dm_redraw_category_screen();

}   /* end of ShowCategory6Screen */


/*****************************************************************************
 * FUNCTION
 *  ShowCategory7Screen
 * DESCRIPTION
 *  Displays the category7 screen
 * PARAMETERS
 *  title                   [IN]        Title for the screen
 *  title_icon              [IN]        Icon shown with the title
 *  left_softkey            [IN]        Left softkey label
 *  left_softkey_icon       [IN]        Icon for the left softkey
 *  right_softkey           [IN]        Right softkey label
 *  right_softkey_icon      [IN]        

⌨️ 快捷键说明

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