Example #1
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
}
void avk_framework_draw_title(WCHAR* title)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 x, y, str_w, str_h;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    gdi_draw_solid_rect(0, 0, LCD_WIDTH, AVK_FRAMEWORK_SOFTKEY_HEIGHT, GDI_COLOR_BLACK);

    gui_set_font(&MMI_medium_font);
    gui_set_text_color(gui_color(255, 255, 255));
    gui_measure_string((PU16)title, &str_w, &str_h);
    x = (LCD_WIDTH - str_w)/2;
    y = (AVK_FRAMEWORK_SOFTKEY_HEIGHT - str_h)/2;
    gui_move_text_cursor(x, y);
    gui_print_text((PU16)title);

}
Example #3
0
void SFScreen_DrawTextN(UString str,SFInt length,SFInt x,SFInt y,SFUint32 cr)
{
	S32 str_w, str_h,str_size;
	SFInt i;
	SFInt cursor_x =x;
	color text_color;
	U8 buf[4]={0,0,0,0};
	

	text_color.alpha=((cr & 0xff00000)>>24) & 0xff;
	text_color.r=((cr & 0x00ff0000)>>16) & 0xff;
	text_color.g=((cr & 0x0000ff00)>>8) & 0xff;
	text_color.b=((cr & 0x000000ff)) & 0xff;
	
       gui_set_text_color(text_color);

	for(i=0;i<length;i++){
		gui_move_text_cursor(cursor_x,y);
		buf[0]=((str[i]) &  0xff);
		buf[1]=((str[i]>>8) & 0xff);
		gui_print_text((UI_string_type)buf);
		cursor_x+=SFFont_GetCharWidth(str[i]);
	}
}