////绘画菜单界面
void uiProcMenuDraw(T_UI_MENUITEM *pUiStartMenuItem, u32 nCount,u32 nTopIndex, u32 nCurrentIndex)
{
u32 i, nIndex;
u8 bSelected;
//清除下界面
//uiLcdClear();
OLED_StartDraw();
OLED_ClrScr(0);
//显示菜单主题
switch((pUiStartMenuItem-1)->nMenuStr)//找type对应的值
{
case UISTR_MENU:
Lcd_HZ_1212(UISTR_HZ_HBKJ,0, 3 ,4);
break;
case UISTR_MENU_ONE:
///uiLcd_1212_ch(UISTR_ZAIZHONG_SET_ZHONGLIANGZHILING, 0, 40, 2);
Lcd_HZ_1212(UISTR_HZ_HJLC,0, 3 ,4);
break;
case UISTR_MENU_TWO:
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, 0, 40, 4);
Lcd_HZ_1212(UISTR_HZ_ZL,0, 3 ,2);
break;
case UISTR_MENU_THR:
//uiLcd_1212_ch(UISTR_ENCODER_FLOOR+2, 0, 40, 2);
break;
default:
break;
}
for(i=0; i<MENU_OF_ITEMS; i++)//循环显示一个主题下的三个项目
{
nIndex = nTopIndex + i;
if (nIndex >= nCount)
break;
if (nIndex == nCurrentIndex)//区别显示当前选择的项目
{
bSelected = TRUE;
Lcd_Decimal_Small(nCurrentIndex+1, (1+i)*12+4, 0, 1, 1);
Lcd_String_Small(">", (1+i)*12+4, 7,1);
}
else
{
bSelected = FALSE;
}
//在这里添加菜单目录的绘画
switch(pUiStartMenuItem[nIndex].nMenuStr)//找type对应的值
{
//主菜单下的显示
case UISTR_MENU_ONE:
Lcd_HZ_1212(UISTR_HZ_HBKJ, 1+i, 1 ,1);
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, (1+i)*2, HEAD_LEN, 4);
break;
case UISTR_MENU_TWO:
///Lcd_HZ_1212(0,2, 1, 4);
Lcd_HZ_1212(UISTR_HZ_HBKJ+1, 1+i, 1 ,1);
//uiLcd_1212_ch(UISTR_ZAIZHONG_SET_ZHONGLIANGZHILING, (1+i)*2, HEAD_LEN, 2);
//uiLcd_1212_ch(UISTR_ZAIZHONG_SET+2, (1+i)*2, HEAD_LEN+12*2, 2);
break;
case UISTR_MENU_THR:
Lcd_HZ_1212(UISTR_HZ_HBKJ+2, 1+i, 1 ,1);
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, (1+i)*2, HEAD_LEN, 4);
break;
case UISTR_MENU_FOU:
Lcd_HZ_1212(UISTR_HZ_HBKJ+3,1+i, 1 ,1);
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, (1+i)*2, HEAD_LEN, 4);
break;
//二级菜单下的显示
case UISTR_MENU_ONE_ONE:
Lcd_HZ_1212(UISTR_HZ_HJLC, 1+i, 1 ,1);
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, (1+i)*2, HEAD_LEN, 4);
break;
case UISTR_MENU_ONE_TWO:
Lcd_HZ_1212(UISTR_HZ_HJLC+1, 1+i, 1 ,1);
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, (1+i)*2, HEAD_LEN, 4);
break;
case UISTR_MENU_ONE_FOU:
Lcd_HZ_1212(UISTR_HZ_YJDBD, 1+i, 1 ,5);
//uiLcd_1212_ch(UISTR_PINGCHENG_SET, (1+i)*2, HEAD_LEN, 4);
break;
default:
//i = (pUiStartMenuItem-1)->nMenuStr;
break;
}
if (pUiStartMenuItem[nIndex].nType == UIMENU_HASVALUE ||
pUiStartMenuItem[nIndex].nType == UIMENU_CUSTOM_HASVALUE)
{
uiProcMenuDrawValue(&pUiStartMenuItem[nIndex], (1+i)*12+4, bSelected);
}
}
OLED_EndDraw();
}