移植了UCGUI后,能够成功显示TEXT控件,而在使用BUTTON时上面的字符无法正常显示,只能显示第一个字符的一部分,如图1,而且如果在BUTTON加上字符时,就没办法添加第二个BUTTON了。不加字符就可以显示多个BUTTON。跪求大神解决。 图1中是要让它在BUTTON上显示“BCD”,然后它就显示成这个样了
下面是在主函数调用的程序 int main(void)
{
WM_HWIN hWin;
TEXT_Handle hText;
BUTTON_Handle hButton;
delay_init();
LCD_hard_Init();
GUI_Init();
hWin=WM_CreateWindow(0,0,800,480,WM_CF_SHOW,cbCallback,0);
WM_Exec();
hText=TEXT_CreateAsChild(100, 0, 200, 150, hWin, GUI_ID_TEXT0,WM_CF_SHOW,"ABCDEF", GUI_TA_HCENTER|GUI_TA_VCENTER);
TEXT_SetFont(hText,&GUI_Font24_1);
TEXT_SetTextColor(hText,GUI_RED);
TEXT_SetBkColor(hText,GUI_BLUE);
hText=TEXT_CreateAsChild(300, 300, 200, 150, hWin, GUI_ID_TEXT1,WM_CF_SHOW,"WWWABCCOM", GUI_TA_HCENTER|GUI_TA_VCENTER);
TEXT_SetFont(hText,&GUI_Font24_1);
TEXT_SetTextColor(hText,GUI_RED);
TEXT_SetBkColor(hText,GUI_BLUE);
WM_Exec();
hButton=BUTTON_CreateAsChild (400, 200, 100, 50,hWin, GUI_ID_BUTTON0,WM_CF_SHOW);
BUTTON_SetFont(hButton,&GUI_Font24_ASCII);
BUTTON_SetText(hButton,"A");
BUTTON_SetTextColor(hButton,0,GUI_WHITE);//μˉÆe
BUTTON_SetBkColor(hButton,0,GUI_GREEN);
BUTTON_SetTextColor(hButton,1,GUI_BLACK);//°′ÏÂ
BUTTON_SetBkColor(hButton,1,GUI_RED);
hButton=BUTTON_CreateAsChild (30, 200, 100, 50,hWin, GUI_ID_BUTTON1,WM_CF_SHOW);
BUTTON_SetFont(hButton,&GUI_Font24_ASCII);
BUTTON_SetText(hButton,"BCD");
BUTTON_SetTextColor(hButton,0,GUI_WHITE);//μˉÆe
BUTTON_SetBkColor(hButton,0,GUI_DARKGRAY);
BUTTON_SetTextColor(hButton,1,GUI_BLACK);//°′ÏÂ
BUTTON_SetBkColor(hButton,1,GUI_RED);
while(1)
{
WM_Exec();
delay_ms(20);
}
}
|