金牌会员
- 积分
- 1276
- 金钱
- 1276
- 注册时间
- 2016-5-31
- 在线时间
- 499 小时
|
发表于 2021-6-4 17:59:40
|
显示全部楼层
char *s_strBuf[]={"李三","小明","小花","张三","王二"};
static void _cbCallback(WM_MESSAGE * pMsg)
{
int NCode, Id;
WM_HWIN hItem;
WM_HWIN hDlg = pMsg->hWin;
switch (pMsg->MsgId) {
case WM_PAINT:
//.......................
break;
case WM_INIT_DIALOG:
//.......................
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(NCode){
case WM_NOTIFICATION_CLICKED:
break;
case WM_NOTIFICATION_RELEASED:
switch(Id){
case GUI_ID_BUTTON1:
if(sel<5){ //最多5组字符串
hItem = WM_GetDialogItem(hDlg, GUI_ID_EDIT);
EDIT_SetText(hItem,s_strBuf[sel]); //显示字符串
if(strcmp(s_strBuf[sel],"李三")==0){ //显示的字符串是"李三"
//LED_ON(); //LED驱动函数,请自己编写。点亮LED
}else{
//LED_OFF(); //LED驱动函数,请自己编写。熄灭LED
}
sel++; //指向下一个字符串
}else{
sel=0; //clear
}
break;
}
break;
}
break;
}
|
|