参考别人的程序。
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_SetFont(&GUI_Font32B_ASCII);
GUI_Clear();
hButton0=BUTTON_Create(80,50,80,40,GUI_ID_BUTTON0,WM_CF_SHOW);
hButton1=BUTTON_Create(80,100,80,40,GUI_ID_BUTTON1,WM_CF_SHOW);
hButton2=BUTTON_Create(80,150,80,40,GUI_ID_BUTTON2,WM_CF_SHOW);
BUTTON_SetFont(hButton0,&GUI_Font32B_ASCII);
BUTTON_SetText(hButton0,"enter");
BUTTON_SetFont(hButton1,&GUI_Font32B_ASCII);
BUTTON_SetText(hButton1,"back");
BUTTON_SetFont(hButton2,&GUI_Font32B_ASCII);
BUTTON_SetText(hButton2,"OK");
WM_Paint(hButton0);
WM_Paint(hButton1);
WM_Paint(hButton2);
while(1)
{
switch(GUI_GetKey())
{
case GUI_ID_BUTTON0:
GUI_DispStringAt("button0 pressed",5,200);
break;
case GUI_ID_BUTTON1:
GUI_DispStringAt("button1 pressed",5,215);
break;
case GUI_ID_BUTTON2:
GUI_DispStringAt("button2 pressed",5,230);
break;
default:
break;
}
GUI_Exec();
delay_ms(100);
} |