初级会员
- 积分
- 85
- 金钱
- 85
- 注册时间
- 2011-9-6
- 在线时间
- 10 小时
|
1金钱
可以响应 case WM_NOTIFICATION_CLICKED: 这里的程序可以执行,按键按下,会连续响应这个事件。
不能响应case WM_NOTIFICATION_RELEASED:这里的程序进不去,一直不能响应释放事件。
程序如下,请问怎么解决????????
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int NCode, Id;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
// Initialization of 'Button'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_0);
BUTTON_SetText(hItem, "HALT");
BUTTON_SetFont(hItem, GUI_FONT_20_ASCII);
BUTTON_SetFocussable(hItem,0);
//
// Initialization of 'Button'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_BUTTON_1);
BUTTON_SetText(hItem, "NEXT");
BUTTON_SetFont(hItem, GUI_FONT_20_ASCII);
BUTTON_SetFocussable(hItem,0);
//
// Initialization of 'Framewin'
//
hItem = pMsg->hWin;
FRAMEWIN_SetTextColor(hItem, GUI_MAKE_COLOR(0x00FF0000));
jason_FRAMEWIN = hItem;
// Initialization of 'Progbar'
//
jason_PROGBAR =WM_GetDialogItem(pMsg->hWin, ID_PROGBAR_0);
PROGBAR_SetFont(jason_PROGBAR, GUI_FONT_8X16_ASCII);
PROGBAR_SetMinMax(jason_PROGBAR, 0, 255);
// USER START (Optionally insert additional code for further widget initialization)
//BUTTON_SetReactOnLevel();
// USER END
break;
// USER START (Optionally insert additional message handling)
// USER END
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(NCode)
{
case WM_NOTIFICATION_CLICKED:
if(Id == ID_BUTTON_0)
// prog_i = 0;
SZ_STM32_LEDOn(LED1);
else if(Id == ID_BUTTON_1)
// prog_i = 200;
SZ_STM32_LEDOff(LED1);
break;
case WM_NOTIFICATION_RELEASED:
if(Id == ID_BUTTON_0)
prog_i = 100;
else if(Id == ID_BUTTON_1)
prog_i = 240;
break;
default:
break;
}
break;
default:
WM_DefaultProc(pMsg);
break;
}
}
|
|