Example #1
0
/*****************************************************************************
 * FUNCTION
 *  wgui_show_horizontal_tab_bar
 * DESCRIPTION
 *  Show the horizontal tab bar
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void wgui_show_horizontal_tab_bar(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gui_lock_double_buffer();
    gui_show_horizontal_tab_bar(&MMI_horizontal_tab_bar, MMI_FALSE, MMI_FALSE);
    gui_unlock_double_buffer();
    gui_BLT_double_buffer(
        MMI_horizontal_tab_bar.x,
        MMI_horizontal_tab_bar.y,
        MMI_horizontal_tab_bar.x + MMI_horizontal_tab_bar.width - 1,
        MMI_horizontal_tab_bar.y + MMI_horizontal_tab_bar.height - 1);

    if (MMI_horizontal_tab_bar.theme->hint_bg_image && title_bg_id == 0)
    {
        title_bg_id = MMI_horizontal_tab_bar.theme->hint_bg_image;
        gui_add_cleanup_hook(wgui_horizontal_tab_bar_reset_title_bg_id);
    }

    gui_horizontal_tab_bar_start_blinking(&MMI_horizontal_tab_bar);
}
Example #2
0
/*****************************************************************************
 * FUNCTION
 *  gui_panel_show
 * DESCRIPTION
 *  Show a panel component
 * PARAMETERS
 *  panel           [IN/OUT]        panel
 * RETURNS
 *  void
 *****************************************************************************/
void gui_panel_show(gui_panel_struct *panel)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 x1, y1, x2, y2;
    S32 elem_idx;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    x1 = panel->x;
    y1 = panel->y;
    x2 = panel->x + panel->width - 1;
    y2 = panel->y + panel->height - 1;
    
    gui_lock_double_buffer();
    
    gui_util_painter_show(&panel->background, x1, y1, x2, y2);

    for (elem_idx = 0; elem_idx < panel->element_count; elem_idx++)
    {
        gui_panel_element_struct *e = &panel->elements[elem_idx];
        gui_panel_elem_state_enum state;
        if (e->disabled_state)
        {
            state = GUI_PANEL_ELEM_STATE_DISABLED;
        }
        else if (e->down_state)
        {
            state = GUI_PANEL_ELEM_STATE_DOWN;
        }
        else if (panel->display_focus && elem_idx == panel->element_focus_index)
        {
            state = GUI_PANEL_ELEM_STATE_FOCUSSED;
        }
        else
        {
            state = GUI_PANEL_ELEM_STATE_NORMAL;
        }
        
        gui_util_painter_show(&e->painters[state], e->x1, e->y1, e->x2, e->y2);
    }

    gui_unlock_double_buffer();
    gui_BLT_double_buffer(x1, y1, x2, y2);

    /* Add cleanup handler */
    gui_add_cleanup_hook(gui_panel_reset_state);
}
Example #3
0
/*****************************************************************************
 * FUNCTION
 *  wgui_show_horizontal_tab_bar_hint_area
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void wgui_show_horizontal_tab_bar_hint_area(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gui_lock_double_buffer();
    gui_show_horizontal_tab_bar(&MMI_horizontal_tab_bar, MMI_TRUE, MMI_FALSE);
    gui_unlock_double_buffer();
    gui_BLT_double_buffer(
        MMI_horizontal_tab_bar.x,
        MMI_horizontal_tab_bar.y + MMI_horizontal_tab_bar.tab_area_height,
        MMI_horizontal_tab_bar.x + MMI_horizontal_tab_bar.width - 1,
        MMI_horizontal_tab_bar.y + MMI_horizontal_tab_bar.height - 1);
}
Example #4
0
/*模块入口*/
void mmi_HelloWorld_entry(void)
{
#ifdef	__MMI_HELLOWORLD_ENABLED__
	/* 强制退出当前屏幕,之后进入到我们的模块了 */
	/* 上电缺省是idle屏幕,现进入MAIN_MENU_SCREENID屏 */
	/* 注意看第二个参数,这个是当我们模块被强制退出时执行的一些操作 */


#if 1

	//EntryNewScreen(MAIN_MENU_SCREENID, mmi_HelloWorld_exit, NULL, NULL);
    g_main_menu_group_id = mmi_frm_group_create(GRP_ID_ROOT, GRP_ID_AUTO_GEN, NULL, NULL);
    mmi_frm_group_enter(g_main_menu_group_id, 1);
    if(mmi_frm_scrn_enter(g_main_menu_group_id, MAIN_MENU_SCREENID, NULL, NULL, 2) == MMI_FALSE)
    {
        return;
    }


	/* 关掉屏幕顶部的状态条,我们要用整个屏幕 */
	entry_full_screen();

	/* 擦除当前背景 */
	clear_screen();

	/* 移动文本输出光标 */
	gui_move_text_cursor(50, 100);

	/* 设置字体颜色 */
	gui_set_text_color(UI_COLOR_RED);

	/* 输出文本到显示缓冲, 注意是Unicode编码 */
	gui_print_text(L"Hello, moring");

	/* 刷新屏幕显示,MMI用的是双缓冲绘图方式,而且需要显式刷新 */
	gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);

	/* 注册一个按键处理,右软键弹起时返回到之前被我们强制退出的模块 */
	SetKeyHandler(GoBackHistory, KEY_RSK, KEY_EVENT_UP);
#endif
#endif
}
Example #5
0
/*****************************************************************************
 * FUNCTION
 *  gui_panel_show_element
 * DESCRIPTION
 *  Draw a painter element
 * PARAMETERS
 *  panel                   [IN/OUT]    panel
 *  element                 [IN]        panel element
 *  state                   [IN]        state of panel element 
 *  bg_is_already_drawn     [IN]        whether the panel background is already drawn.
 * RETURNS
 *  void
 *****************************************************************************/
static void gui_panel_show_element(
                gui_panel_struct *panel, 
                gui_panel_element_struct *element, 
                gui_panel_elem_state_enum state,
                MMI_BOOL bg_is_already_drawn)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

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

    if (!bg_is_already_drawn && element->redraw_bg_after_state_changed)
    {
        gui_util_painter_show_clipped(
            &panel->background,
            panel->x,
            panel->y,
            element->x1,
            element->y1,
            element->x2,
            element->y2);
    }
    
    gui_util_painter_show(
        &element->painters[state],
        element->x1,
        element->y1,
        element->x2,
        element->y2);

    gui_unlock_double_buffer();
    gui_BLT_double_buffer(element->x1, element->y1, element->x2, element->y2);
}