Ejemplo n.º 1
0
/*!
 * \brief 更新左右软键盘显示状态
 * \param 
 * \return 
 * \note 
 * \author weizhiping
 * \date 2010年2月5日
 */
void GBInputBox_UpdateSoftKeyLabel(void)
{
	PEngineOutputInfo pEngineOutputInfo = CLayoutControl_GetEngineOutputInfo();
	
	// 引擎处理状态
	if (pEngineOutputInfo->bCandWindOpen)
	{
		// 左软键显示为【选择】
		set_left_softkey_label(get_string(STR_GLOBAL_SELECT));
		
		// 输入框为空 && 输入法引擎有内容, 右软键显示为【清除】
		if(GBInputBox_InputBoxIsEmtpy() && !pEngineOutputInfo->bInputEmpty)
		{
			set_right_softkey_label((UI_string_type) get_string(STR_GLOBAL_CLEAR));
		}
	}
	else // 平台处理状态
	{
		UI_string_type pLeftSoftkeyLabel = GBInputBox_GetPlatformLeftSoftkeyLabel();
		UI_string_type pRightSoftkeyLabel = GBInputBox_GetPlatformRightSoftkeyLabel();

		// 左软键显示为平台应用刚进入编辑界面时设置的标签(如无则默认为【选项】)
		if (pLeftSoftkeyLabel != NULL)
		{
			set_left_softkey_label(pLeftSoftkeyLabel);
		}
		else
		{
			set_left_softkey_label(get_string(STR_GLOBAL_OPTIONS));
		}

		// 输入框内容为空, 右软键显示为平台应用刚进入编辑界面时设置的标签(如无则默认为【返回】)
		if(GBInputBox_InputBoxIsEmtpy())
		{			
			if (pRightSoftkeyLabel != NULL)
			{
				set_right_softkey_label(pRightSoftkeyLabel);
			}
			else
			{
				set_right_softkey_label(get_string(STR_GLOBAL_BACK));
			}
		}
		else // 不为空右软键显示为【清除】
		{
			set_right_softkey_label(get_string(STR_GLOBAL_CLEAR));
		}
	}
  	
	// 重绘左软键
	set_left_softkey_icon(NULL);
	wgui_hide_left_softkey();
	redraw_left_softkey();

	// 重绘右软键
	set_right_softkey_icon(NULL);
	wgui_hide_right_softkey();
	redraw_right_softkey();
}
Ejemplo n.º 2
0
/*****************************************************************************
 * FUNCTION
 *  ShowCategory626Screen
 * DESCRIPTION
 *  Displays the category626 screen (Tab List menu with description )
 * PARAMETERS
 *  title                       [IN]        Title for the screen
 *  title_icon                  [IN]        Icon displayed with the title
 *  left_softkey                [IN]        Left softkey label
 *  left_softkey_icon           [IN]        Left softkey icon
 *  right_softkey               [IN]        Right softkey label
 *  right_softkey_icon          [IN]        Right softkey icon
 *  number_of_items             [IN]        Number of items in the menu
 *  list_of_items               [IN]        Array of items
 *  list_of_icons               [IN]        Array of icons
 *  list_of_descriptions        [IN]        Array of Pop up description strings
 *  flags                       [IN]        Flags (see explanation below)
 *  highlighted_item            [IN]        Default item to be highlighted (if there is no history)
 *  n_tabs                  [IN]
 *  highlighted_tab         [IN]
 *  tab_items               [IN]
 *  history_buffer              [IN]        History buffer
 * RETURNS
 *  void
 *****************************************************************************/
void ShowCategory626Screen(
        U8 *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,
        U16 *list_of_icons,
        U8 **list_of_descriptions,
        S32 flags,
        S32 highlighted_item,
        S8 highlighted_tab,
        U8 *history_buffer)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    dm_data_struct dm_data;
    S32 i;
    U8 h_flag;
    S32 shortcut_width;
    S8 n_tabs;


    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    gdi_layer_lock_frame_buffer();

    /* Show Tab bars */
    mmi_frm_get_tab_bar_items(MMI_tab_bar_items, &n_tabs);
    cat626_tab_num = n_tabs;

    if (n_tabs)
    {
        wgui_create_horizontal_tab_bar(TRUE, (UI_string_type)title, n_tabs, highlighted_tab, MMI_FALSE);
    }

    /* Softkeys */
    set_left_softkey_label((UI_string_type)GetString(left_softkey));
    set_left_softkey_icon((PU8)GetImage(left_softkey_icon));
    set_right_softkey_label((UI_string_type)GetString(right_softkey));
    set_right_softkey_icon((PU8)GetImage(right_softkey_icon));
    SetupCategoryKeyHandlers();

    /* Show List */
    create_fixed_icontext_menuitems();
    associate_fixed_icontext_list();

    MMI_current_menu_type = LIST_MENU;
    register_fixed_list_keys();
    
    if (n_tabs)
    {
        resize_fixed_list(MMI_CONTENT_WIDTH_WITH_H_TAB, MMI_CONTENT_HEIGHT_WITH_H_TAB);
        move_fixed_list(MMI_CONTENT_X_WITH_H_TAB, MMI_CONTENT_Y_WITH_H_TAB);
    }
    else
    {
        MMI_title_string = (UI_string_type)title;
        MMI_title_icon = (PU8)GetImage(title_icon);
        resize_fixed_list(MMI_content_width, MMI_content_height);
        move_fixed_list(MMI_content_x, MMI_content_y);
    }

    register_fixed_list_highlight_handler(standard_list_highlight_handler);

    if (list_of_descriptions == NULL)
    {
        for (i = 0; i < number_of_items; i++)
        {
            add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i]));
            wgui_pop_up_description_strings[i].text_strings[0] = NULL;
        }
    }
    else
    {
        for (i = 0; i < number_of_items; i++)
        {
            add_fixed_icontext_item((UI_string_type) list_of_items[i], wgui_get_list_menu_icon(i, list_of_icons[i]));
            wgui_pop_up_description_strings[i].text_strings[0] = (UI_string_type) list_of_descriptions[i];
        }
    }
    h_flag = set_list_menu_category_history(MMI_CATEGORY626_ID, history_buffer);

#ifdef __MMI_UI_HINTS_IN_MENUITEM__
    if (list_of_descriptions != NULL)
    {
        S32 hints = 0;

        for (i = 0; i < number_of_items; i++)
        {
            if (wgui_pop_up_description_strings[i].text_strings[0])
            {
                hints = 1;
                break;
            }
        }
        if (hints)
        {
            if (is_set_force_icon_on_highlight_only_in_menuitem())
            {
                wgui_show_icon_only_highlight_in_icontext_menuitem();
            }
            if (is_set_force_all_hints_in_menuitem())
            {
                wgui_enable_hints_in_icontext_menuitem();
            }
            else if (is_set_force_hints_on_highlight_in_menuitem())
            {
                wgui_enable_hint_highlight_in_icontext_menuitem();
            }
            else
            {
                wgui_enable_hint_highlight_in_icontext_menuitem();
            }

            set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);
    #ifdef __MMI_UI_LIST_HIGHLIGHT_EFFECTS__
            gui_block_list_effect();
    #endif 
        }
    }
#endif /* __MMI_UI_HINTS_IN_MENUITEM__ */ 

    if (h_flag)
    {
        fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
    }
    else
    {
        fixed_list_goto_item_no_redraw(highlighted_item);
    }
    MMI_title_string = (UI_string_type) title;
    MMI_title_icon = (PU8) get_image(title_icon);
    set_pop_up_descriptions(1, number_of_items, MMI_fixed_list_menu.highlighted_item);

    /* Setup (hidden) menu shortcut. */
    MMI_menu_shortcut_number = highlighted_item + 1;
    register_fixed_list_shortcut_handler();
    shortcut_width = set_menu_item_count(number_of_items) + 7;
    if (n_tabs)
    {
        resize_menu_shortcut_handler(shortcut_width, MMI_HORIZONTAL_TAB_BAR_HINT_AREA_HEIGHT);
        move_menu_shortcut_handler(
            MMI_HORIZONTAL_TAB_BAR_X + MMI_HORIZONTAL_TAB_BAR_WIDTH - MMI_menu_shortcut_box.width,
            MMI_HORIZONTAL_TAB_BAR_Y + MMI_HORIZONTAL_TAB_BAR_TAB_AREA_HEIGHT);
        register_hide_menu_shortcut(wgui_show_horizontal_tab_bar_hint_area);
    }
    else
    {
        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);
    }


    gdi_layer_unlock_frame_buffer();

    ExitCategoryFunction = ExitCategory626Screen;
    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_CATEGORY626_ID;
    dm_data.s32flags = 0;
    dm_setup_data(&dm_data);
    dm_redraw_category_screen();

}
Ejemplo n.º 3
0
/*!
* \brief 设置右软键图标
* \param GBPUACHAR
* \return void
*/
void GBInputBox_SetRightSoftkeyIcon(GBPUACHAR icon)
{
#if __MTK__ > 0
	set_right_softkey_icon(icon);
#endif // __MTK__
}