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

📄 mmisoftkeys.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 2 页
字号:
    }

    if( changes->rightKeyLabel != TxtNull )
    {
        softKeys->rightKeyLabel = changes->rightKeyLabel;
    }

    return SOFTKEYS_CHANGED;
}


/*
 * You will need to call this whenever <window> is updated.
 */
void softKeysHndUpdate(MfwHnd window)
{
	if( window == NULL )
    {
        return;
    }

	softKeysWinUpdate((MfwWin *)((MfwHdr *)window)->data);
}


void softKeysWinUpdate(MfwWin *window)
{
    SoftKeys    softKeys     = (SoftKeys)userDataWinGet( window, UD_SOFTKEYS);
    U8          oldFont      = dspl_SelectFontbyID(softKeyFont);
    USHORT      textTop      = (USHORT)(TopMargin - dspl_GetFontHeight());

    if( window == NULL || softKeys == NULL )
    {
        return;
    }

    PROMPT( LeftMargin,
                  textTop, 0,
                  softKeys->leftKeyLabel);


    dspl_SelectFontbyID(oldFont);
}


/*
 * Deletes the softkeys for <window>.
 */
void softkeysHndDelete(MfwHnd window)
{
	if( window == NULL )
    {
        return;
    }

	softkeysWinDelete((MfwWin *)((MfwHdr *)window)->data);
}


void softkeysWinDelete(MfwWin *window)
{
    SoftKeys softKeys = (SoftKeys)userDataWinDelete( window, UD_SOFTKEYS);

    if( window == NULL || softKeys == NULL )
    {
        return;
    }

    kbdDelete(softKeys->leftKeyHandler);
    kbdDelete(softKeys->rightKeyHandler);

    FREE_MEMORY( (void *)softKeys, sizeof(SoftKeysData));
}

void displaySoftKeys(int leftSoftKey,int rightSoftKey)
{
    char *l, *r;
    UBYTE len;
    if((leftSoftKey == 0) && (rightSoftKey == 0))  //xsf add for no softkey 12.20
      return;
    l = (char*)MmiRsrcGetText(leftSoftKey);
    r = (char*)MmiRsrcGetText(rightSoftKey);
    len = dspl_str_length(r);
	/* 2004/01/13 sunsj modify */
    dspl_Clear(0, SCREEN_SIZE_Y-dspl_GetFontHeight()-2, RightMargin, SCREEN_SIZE_Y);//zy 09/11
    //begin of xsf add for draw menudown bmp 12.11
//    drawDownbmp( );
draw_softkeybar_background();
    //dspl_BitBlt(0, 142, menudown[FlashSettingData.theme].area.sx, menudown[FlashSettingData.theme].area.sy, 0, (void*)menudown[FlashSettingData.theme].icons, 0);
	/* 2004/02/11 sunsj modify softkey color */
    drawcolorclarity(LeftMargin+1,TopMargin-dspl_GetFontHeight()-1,l, 0x000000);
	//2004-03-29 Sunny modify
    /*drawcolorclarity(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey),
		(USHORT)len)-1,TopMargin-dspl_GetFontHeight()-1,r, 0x000000);*/

	drawcolorclarity(RightMargin- get_StringWidth(r)-1,TopMargin-dspl_GetFontHeight()-1,r, 0x000000);//shiheng 0811

    //end of xsf add for draw menudown bmp 12.11
    
	/*dspl_TextOut(LeftMargin,TopMargin-dspl_GetFontHeight(),
                        DSPL_TXTATTR_CURRENT_MODE,l);
    dspl_TextOut(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey),
		(USHORT)len),
				 TopMargin-dspl_GetFontHeight(),
		       DSPL_TXTATTR_CURRENT_MODE,r);*/

}

void displayColorSoftKeys(int leftSoftKey,int rightSoftKey,int color)
{
    char *l, *r;
    UBYTE len;
    if((leftSoftKey == 0) && (rightSoftKey == 0))  //xsf add for no softkey 12.20
      return;
    l = (char*)MmiRsrcGetText(leftSoftKey);
    r = (char*)MmiRsrcGetText(rightSoftKey);
    len = dspl_str_length(r);
    dspl_Clear(0, 144, RightMargin, 160);//zy 09/11
	dspl_colorTextOut(LeftMargin+1,TopMargin-dspl_GetFontHeight()-1,
                        DSPL_TXTATTR_CURRENT_MODE,l,color);
    //2004-03-29 Sunny modify
    /*drawcolorclarity(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey),
		(USHORT)len)-1,TopMargin-dspl_GetFontHeight()-1,r, 0x000000);*/

	drawcolorclarity(RightMargin- get_StringWidth(r) -1,TopMargin-dspl_GetFontHeight()-1,r, 0x000000);

}

void displayPhbkEditSoftKeys(int leftSoftKey,int rightSoftKey)
{
    char *l, *r;
    UBYTE len;

    l = (char*)MmiRsrcGetText(leftSoftKey);
    r = (char*)MmiRsrcGetText(rightSoftKey);
    len = dspl_str_length(r);  
    drawcolorclarity(LeftMargin,TopMargin-dspl_GetFontHeight()-1,l, 0xffffff);

	//2004-03-29 Sunny modify
    /*drawcolorclarity(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey),
		(USHORT)len),TopMargin-dspl_GetFontHeight()-1,r, 0xffffff);*/
	drawcolorclarity(RightMargin - get_StringWidth(r) - 1,TopMargin-dspl_GetFontHeight()-1,r, 0xffffff);
 
    /*
	dspl_TextOut(LeftMargin,TopMargin-dspl_GetFontHeight(),
                        DSPL_TXTATTR_CURRENT_MODE,l);
    dspl_TextOut(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey),
		(USHORT)len),
				 TopMargin-dspl_GetFontHeight(),
		       DSPL_TXTATTR_CURRENT_MODE,r);
	*/

}

//hxl add for qq 2003-3-2
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
void display3SoftKeys(int midSoftKey)//(int leftSoftKey,int midSoftKey,int rightSoftKey)
{
    char  *m;
    UBYTE lenm;

    m = (char*)MmiRsrcGetText(midSoftKey);
    lenm = dspl_str_length(m);  

	//2004-03-29 Sunny modify
    /*drawcolorclarity((RightMargin/2)-((dspl_GetTextExtent((char*)MmiRsrcGetText(midSoftKey),
		(USHORT)lenm))/2),TopMargin-dspl_GetFontHeight()-1,m, 0xffffff);*/
	drawcolorclarity((RightMargin - get_StringWidth(m) /2)-,TopMargin-dspl_GetFontHeight()-1,m, 0xffffff);
	

}
#endif
void displaySoftKeys_edition(int leftSoftKey,int index, int rightSoftKey)
{


	dspl_TextOut(LeftMargin,
		Mmi_layout_fifth_line()-dspl_GetFontHeight(), 0,
                       (char*)MmiRsrcGetText(leftSoftKey));

	//2004-03-29 Sunny modify 
	/*dspl_TextOut( 5 + dspl_GetTextExtent((char*)MmiRsrcGetText(leftSoftKey), (USHORT)strlen((char*)MmiRsrcGetText(leftSoftKey))) ,
		Mmi_layout_fifth_line() -dspl_GetFontHeight(), 0,
                       (char*)MmiRsrcGetText(index));*/
	dspl_TextOut( 5 + get_StringWidth((char*)MmiRsrcGetText(leftSoftKey)) ,
		Mmi_layout_fifth_line() -dspl_GetFontHeight(), 0,
		(char*)MmiRsrcGetText(index));

	//2004-03-29 Sunny modify
    /*dspl_TextOut(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey), (USHORT)strlen((char*)MmiRsrcGetText(rightSoftKey))),
				 Mmi_layout_fifth_line()-dspl_GetFontHeight(), 0,
		       (char*)MmiRsrcGetText(rightSoftKey));*/
	dspl_TextOut(RightMargin-get_StringWidth((char*)MmiRsrcGetText(rightSoftKey)),
		Mmi_layout_fifth_line()-dspl_GetFontHeight(), 0,
		(char*)MmiRsrcGetText(rightSoftKey));

}


// SH - 25/5/01
// This function provided for WAP, to allow the printing of custom softkeys
// from strings provided.

void displayCustSoftKeys(char *LeftSoftKey, char *RightSoftKey)
{
	dspl_TextOut(LeftMargin,TopMargin-dspl_GetFontHeight(), DSPL_TXTATTR_CURRENT_MODE, LeftSoftKey);

	//2004-03-29 Sunny modify
    /*dspl_TextOut(RightMargin-dspl_GetTextExtent(RightSoftKey,
		(USHORT)dspl_str_length(RightSoftKey)),
				 TopMargin-dspl_GetFontHeight(),
		       DSPL_TXTATTR_CURRENT_MODE,RightSoftKey);*/
	dspl_TextOut(RightMargin-get_StringWidth(RightSoftKey),
		TopMargin-dspl_GetFontHeight(),
		DSPL_TXTATTR_CURRENT_MODE,RightSoftKey);
	
    return;
}

/*2003/11/13,talcon add*/
void displayColorSoftKeys2(int leftSoftKey,int rightSoftKey,int color,int bkgcolor)
{
    char *l, *r;
    UBYTE len;
	UINT oldColor =0;
    if((leftSoftKey == 0) && (rightSoftKey == 0))  //xsf add for no softkey 12.20
		return;
    l = (char*)MmiRsrcGetText(leftSoftKey);
    r = (char*)MmiRsrcGetText(rightSoftKey);
    len = dspl_str_length(r);
	oldColor = dspl_SetBkgColor(bkgcolor);
	/* 2004/02/11 sunsj modify for idle softkey icon */
    //dspl_Clear(0, 144, RightMargin, 160);
	draw_softkeybar_background();
	
	dspl_colorTextOut(LeftMargin+1,TopMargin-dspl_GetFontHeight()-1,
		DSPL_TXTATTR_TRANSPARENT,l,color);

	//2004-03-29 Sunny modify 
    /*dspl_colorTextOut(RightMargin-dspl_GetTextExtent((char*)MmiRsrcGetText(rightSoftKey),
		(USHORT)len)-1,
		TopMargin-dspl_GetFontHeight()-1,
		DSPL_TXTATTR_TRANSPARENT,r,color);*/
	dspl_colorTextOut(RightMargin-get_StringWidth((char*)MmiRsrcGetText(rightSoftKey))+3,//shiheng 0811
		TopMargin-dspl_GetFontHeight()-1,
		DSPL_TXTATTR_TRANSPARENT,r,color);
	dspl_SetBkgColor(oldColor);
}

#if(MAIN_LCD_SIZE==3)
void draw_softkeybar_leftright_arrow(void)
{
	//dspl_BitBlt(54, 117, 20, 6, 0, (void * )leftright_arrow, 0);
	DRAW_ICON(ICON_LEFTRIGHT_ARROW);
}//jhxu720 add
void draw_softkeybar_updown_arrow(void)
{
	//dspl_BitBlt(60, 115, 8, 10, 0, (void * )updown_arrow, 0);
	DRAW_ICON(ICON_UPDOWN_ARROW);
}//jhxu720 add
void draw_softkeybar_fourdirection_arrow(void)
{
	//	dspl_BitBlt(54, 115, 20, 10, 0, (void * )fourdirection_arrow, 0);
    DRAW_ICON(ICON_FOURDIRECTION_ARROW);
}//jhxu720 add
#endif

⌨️ 快捷键说明

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